{"type": "func", "start": 8798292, "end": 8798656, "name": "GJBaseGameLayer::queueButton", "pseudocode": "// \n// GJBaseGameLayer::queueButton from 0x864054 to 0x8641c0 (364 bytes)\n// \n// 28 xrefs:\n// > UILayer::handleKeypress @ 0x5c6d88\n// > UILayer::handleKeypress @ 0x5c6e1c\n// > UILayer::handleKeypress @ 0x5c6e58\n// > UILayer::handleKeypress @ 0x5c6e90\n// > UILayer::handleKeypress @ 0x5c6ea8\n// > UILayer::handleKeypress @ 0x5c6ef0\n// > UILayer::handleKeypress @ 0x5c7030\n// > UILayer::handleKeypress @ 0x5c7050\n// > UILayer::processUINodeTouch @ 0x5c73e4\n// > UILayer::processUINodeTouch @ 0x5c7428\n// > UILayer::processUINodeTouch @ 0x5c7444\n// > UILayer::processUINodeTouch @ 0x5c7470\n// > UILayer::processUINodeTouch @ 0x5c74a8\n// > UILayer::processUINodeTouch @ 0x5c74c4\n// > UILayer::processUINodeTouch @ 0x5c7504\n// > UILayer::processUINodeTouch @ 0x5c7544\n// > UILayer::processUINodeTouch @ 0x5c7560\n// > UILayer::ccTouchBegan @ 0x5c7744\n// > UILayer::ccTouchBegan @ 0x5c77c0\n// > UILayer::ccTouchEnded @ 0x5c789c\n// > UILayer::ccTouchEnded @ 0x5c78bc\n// > PlayLayer::resetLevel @ 0x5e572c\n// > PlayLayer::resetLevel @ 0x5e594c\n// > EditorUI::playerTouchBegan @ 0x690610\n// > EditorUI::playerTouchBegan @ 0x690634\n// > EditorUI::playerTouchEnded @ 0x690680\n// > EditorUI::playerTouchEnded @ 0x6906a0\n// > <???> @ 0x8e500\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nvoid GJBaseGameLayer::queueButton(GJBaseGameLayer *a1, int a2, bool a3, bool a4, double a5)\n{\n  float *v5; // x21\n  PlayerButtonCommand *m_finish; // x4\n  PlayerButtonCommand *m_start; // x0\n  signed __int64 v10; // x24\n  unsigned __int64 v12; // x19\n  unsigned __int64 v13; // x6\n  unsigned __int64 v14; // x22\n  PlayerButtonCommand *v15; // x23\n  char *v16; // x5\n  bool v17; // [xsp+50h] [xbp+50h]\n  bool v18; // [xsp+58h] [xbp+58h]\n\n  if ( !a2 )\n    return;\n  v5 = &a1->m_varianceValues.__elems_[1975];\n  m_finish = a1->m_queuedButtons.m_finish;\n  if ( m_finish != a1->m_queuedButtons.m_reserveEnd )\n  {\n    if ( m_finish )\n    {\n      m_finish->m_button = a2;\n      m_finish->m_isPush = a3;\n      m_finish->m_isPlayer2 = a4;\n      m_finish->m_step = 0;\n      *(&m_finish->m_step + 1) = 0;\n      m_finish->m_timestamp = a5;\n    }\n    a1->m_queuedButtons.m_finish = m_finish + 1;\n    return;\n  }\n  m_start = a1->m_queuedButtons.m_start;\n  v10 = (char *)m_finish - (char *)m_start;\n  v12 = 0xAAAAAAAAAAAAAAABLL * (((char *)m_finish - (char *)m_start) >> 3);\n  if ( v12 )\n  {\n    v13 = 0x5555555555555556LL * (((char *)m_finish - (char *)m_start) >> 3);\n    v14 = -16;\n    if ( 0xAAAAAAAAAAAAAAABLL * (((char *)m_finish - (char *)m_start) >> 3) <= v13 && v13 <= 0xAAAAAAAAAAAAAAALL )\n    {\n      v15 = nullptr;\n      v14 = 16 * (((char *)m_finish - (char *)m_start) >> 3);\n      if ( !v13 )\n        goto LABEL_10;\n    }\n  }\n  else\n  {\n    v14 = 24;\n  }\n  v17 = a4;\n  v18 = a3;\n  v15 = (PlayerButtonCommand *)operator new(v14);\n  m_start = a1->m_queuedButtons.m_start;\n  a4 = v17;\n  v10 = (char *)a1->m_queuedButtons.m_finish - (char *)m_start;\n  a3 = v18;\n  v12 = 0xAAAAAAAAAAAAAAABLL * (v10 >> 3);\nLABEL_10:\n  v16 = (char *)v15 + v10;\n  if ( (char *)v15 + v10 )\n  {\n    *(PlayerButton *)((char *)&v15->m_button + v10) = a2;\n    v16[4] = a3;\n    v16[5] = a4;\n    *((_DWORD *)v16 + 2) = 0;\n    *((_DWORD *)v16 + 3) = 0;\n    *((double *)v16 + 2) = a5;\n  }\n  if ( v12 )\n  {\n    memmove(v15, m_start, v10);\n    m_start = a1->m_queuedButtons.m_start;\n  }\n  if ( m_start )\n    operator delete(m_start);\n  a1->m_queuedButtons.m_start = v15;\n  *((_QWORD *)v5 + 106) = (char *)v15 + v10 + 24;\n  *((_QWORD *)v5 + 107) = (char *)v15 + v14;\n}", "assembly": "; \n; GJBaseGameLayer::queueButton from 0x864054 to 0x8641c0 (364 bytes)\n; \n; 28 xrefs:\n; > UILayer::handleKeypress @ 0x5c6d88\n; > UILayer::handleKeypress @ 0x5c6e1c\n; > UILayer::handleKeypress @ 0x5c6e58\n; > UILayer::handleKeypress @ 0x5c6e90\n; > UILayer::handleKeypress @ 0x5c6ea8\n; > UILayer::handleKeypress @ 0x5c6ef0\n; > UILayer::handleKeypress @ 0x5c7030\n; > UILayer::handleKeypress @ 0x5c7050\n; > UILayer::processUINodeTouch @ 0x5c73e4\n; > UILayer::processUINodeTouch @ 0x5c7428\n; > UILayer::processUINodeTouch @ 0x5c7444\n; > UILayer::processUINodeTouch @ 0x5c7470\n; > UILayer::processUINodeTouch @ 0x5c74a8\n; > UILayer::processUINodeTouch @ 0x5c74c4\n; > UILayer::processUINodeTouch @ 0x5c7504\n; > UILayer::processUINodeTouch @ 0x5c7544\n; > UILayer::processUINodeTouch @ 0x5c7560\n; > UILayer::ccTouchBegan @ 0x5c7744\n; > UILayer::ccTouchBegan @ 0x5c77c0\n; > UILayer::ccTouchEnded @ 0x5c789c\n; > UILayer::ccTouchEnded @ 0x5c78bc\n; > PlayLayer::resetLevel @ 0x5e572c\n; > PlayLayer::resetLevel @ 0x5e594c\n; > EditorUI::playerTouchBegan @ 0x690610\n; > EditorUI::playerTouchBegan @ 0x690634\n; > EditorUI::playerTouchEnded @ 0x690680\n; > EditorUI::playerTouchEnded @ 0x6906a0\n; > <???> @ 0x8e500\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nSTP             X29, X30, [SP,#var_60]!                                ; +0x0, 0x864054\nUXTB            W2, W2                                                 ; +0x4, 0x864058\nUXTB            W3, W3                                                 ; +0x8, 0x86405c\nMOV             X29, SP                                                ; +0xc, 0x864060\nSTP             X19, X20, [SP,#0x60+var_50]                            ; +0x10, 0x864064\nSTP             X21, X22, [SP,#0x60+var_40]                            ; +0x14, 0x864068\nSTP             X23, X24, [SP,#0x60+var_30]                            ; +0x18, 0x86406c\nSTR             X25, [SP,#0x60+var_20]                                 ; +0x1c, 0x864070\nSTR             D8, [SP,#0x60+var_18]                                  ; +0x20, 0x864074\nCBZ             W1, loc_8640B4                                         ; +0x24, 0x864078\nADD             X21, X0, #3,LSL#12                                     ; +0x28, 0x86407c\nLDR             X4, [X21,#0x350]                                       ; +0x2c, 0x864080\nLDR             X5, [X21,#0x358]                                       ; +0x30, 0x864084\nCMP             X4, X5                                                 ; +0x34, 0x864088\nB.EQ            loc_8640D0                                             ; +0x38, 0x86408c\nCBZ             X4, loc_8640AC                                         ; +0x3c, 0x864090\nSTR             W1, [X4]                                               ; +0x40, 0x864094\nSTRB            W2, [X4,#4]                                            ; +0x44, 0x864098\nSTRB            W3, [X4,#5]                                            ; +0x48, 0x86409c\nSTR             WZR, [X4,#8]                                           ; +0x4c, 0x8640a0\nSTR             WZR, [X4,#0xC]                                         ; +0x50, 0x8640a4\nSTR             D0, [X4,#0x10]                                         ; +0x54, 0x8640a8\nADD             X4, X4, #0x18                                          ; +0x58, 0x8640ac\nSTR             X4, [X21,#0x350]                                       ; +0x5c, 0x8640b0\nLDP             X19, X20, [SP,#0x60+var_50]                            ; +0x60, 0x8640b4\nLDP             X21, X22, [SP,#0x60+var_40]                            ; +0x64, 0x8640b8\nLDP             X23, X24, [SP,#0x60+var_30]                            ; +0x68, 0x8640bc\nLDR             X25, [SP,#0x60+var_20]                                 ; +0x6c, 0x8640c0\nLDR             D8, [SP,#0x60+var_18]                                  ; +0x70, 0x8640c4\nLDP             X29, X30, [SP+0x60+var_60],#0x60                       ; +0x74, 0x8640c8\nRET                                                                    ; +0x78, 0x8640cc\nMOV             X20, X0                                                ; +0x7c, 0x8640d0\nLDR             X0, [X0,#0x3348]                                       ; +0x80, 0x8640d4\nMOV             X5, #0xAAAAAAAAAAAAAAAA                                ; +0x84, 0x8640d8\nMOV             W25, W1                                                ; +0x88, 0x8640dc\nSUB             X24, X4, X0                                            ; +0x8c, 0x8640e0\nASR             X19, X24, #3                                           ; +0x90, 0x8640e4\nFMOV            D8, D0                                                 ; +0x94, 0x8640e8\nMADD            X19, X5, X19, X19                                      ; +0x98, 0x8640ec\nCBZ             X19, loc_864180                                        ; +0x9c, 0x8640f0\nLSL             X6, X19, #1                                            ; +0xa0, 0x8640f4\nMOV             X22, #0xFFFFFFFFFFFFFFF0                               ; +0xa4, 0x8640f8\nCMP             X19, X6                                                ; +0xa8, 0x8640fc\nB.LS            loc_8641A0                                             ; +0xac, 0x864100\nMOV             X0, X22; unsigned __int64                              ; +0xb0, 0x864104\nSTR             X3, [X29,#0x60+var_10]                                 ; +0xb4, 0x864108\nSTR             X2, [X29,#0x60+var_8]                                  ; +0xb8, 0x86410c\nBL              _Znwm; operator new(ulong)                             ; +0xbc, 0x864110\nLDR             X19, [X20,#0x3350]                                     ; +0xc0, 0x864114\nMOV             X23, X0                                                ; +0xc4, 0x864118\nLDR             X0, [X20,#0x3348]; p                                   ; +0xc8, 0x86411c\nMOV             X5, #0xAAAAAAAAAAAAAAAA                                ; +0xcc, 0x864120\nLDR             X3, [X29,#0x60+var_10]                                 ; +0xd0, 0x864124\nSUB             X24, X19, X0                                           ; +0xd4, 0x864128\nLDR             X2, [X29,#0x60+var_8]                                  ; +0xd8, 0x86412c\nASR             X19, X24, #3                                           ; +0xdc, 0x864130\nMADD            X19, X5, X19, X19                                      ; +0xe0, 0x864134\nADDS            X5, X23, X24                                           ; +0xe4, 0x864138\nB.EQ            loc_864158                                             ; +0xe8, 0x86413c\nSTR             W25, [X23,X24]                                         ; +0xec, 0x864140\nSTRB            W2, [X5,#4]                                            ; +0xf0, 0x864144\nSTRB            W3, [X5,#5]                                            ; +0xf4, 0x864148\nSTR             WZR, [X5,#8]                                           ; +0xf8, 0x86414c\nSTR             WZR, [X5,#0xC]                                         ; +0xfc, 0x864150\nSTR             D8, [X5,#0x10]                                         ; +0x100, 0x864154\nCBNZ            X19, loc_864188                                        ; +0x104, 0x864158\nADD             X19, X24, #0x18                                        ; +0x108, 0x86415c\nADD             X19, X23, X19                                          ; +0x10c, 0x864160\nCBZ             X0, loc_86416C                                         ; +0x110, 0x864164\nBL              _ZdlPv; operator delete(void *)                        ; +0x114, 0x864168\nSTR             X23, [X20,#0x3348]                                     ; +0x118, 0x86416c\nADD             X22, X23, X22                                          ; +0x11c, 0x864170\nSTR             X19, [X21,#0x350]                                      ; +0x120, 0x864174\nSTR             X22, [X21,#0x358]                                      ; +0x124, 0x864178\nB               loc_8640B4                                             ; +0x128, 0x86417c\nMOV             X22, #0x18                                             ; +0x12c, 0x864180\nB               loc_864104                                             ; +0x130, 0x864184\nMOV             X1, X0; void *                                         ; +0x134, 0x864188\nMOV             X2, X24; size_t                                        ; +0x138, 0x86418c\nMOV             X0, X23; void *                                        ; +0x13c, 0x864190\nBL              .memmove                                               ; +0x140, 0x864194\nLDR             X0, [X20,#0x3348]                                      ; +0x144, 0x864198\nB               loc_86415C                                             ; +0x148, 0x86419c\nMOVK            X5, #0xAAA,LSL#48                                      ; +0x14c, 0x8641a0\nCMP             X6, X5                                                 ; +0x150, 0x8641a4\nB.HI            loc_864104                                             ; +0x154, 0x8641a8\nMOV             X22, #0x18                                             ; +0x158, 0x8641ac\nMOV             X23, #0                                                ; +0x15c, 0x8641b0\nMUL             X22, X6, X22                                           ; +0x160, 0x8641b4\nCBZ             X6, loc_864138                                         ; +0x164, 0x8641b8\nB               loc_864104                                             ; +0x168, 0x8641bc", "xrefs": ["UILayer::handleKeypress @ 0x5c6d88", "UILayer::handleKeypress @ 0x5c6e1c", "UILayer::handleKeypress @ 0x5c6e58", "UILayer::handleKeypress @ 0x5c6e90", "UILayer::handleKeypress @ 0x5c6ea8", "UILayer::handleKeypress @ 0x5c6ef0", "UILayer::handleKeypress @ 0x5c7030", "UILayer::handleKeypress @ 0x5c7050", "UILayer::processUINodeTouch @ 0x5c73e4", "UILayer::processUINodeTouch @ 0x5c7428", "UILayer::processUINodeTouch @ 0x5c7444", "UILayer::processUINodeTouch @ 0x5c7470", "UILayer::processUINodeTouch @ 0x5c74a8", "UILayer::processUINodeTouch @ 0x5c74c4", "UILayer::processUINodeTouch @ 0x5c7504", "UILayer::processUINodeTouch @ 0x5c7544", "UILayer::processUINodeTouch @ 0x5c7560", "UILayer::ccTouchBegan @ 0x5c7744", "UILayer::ccTouchBegan @ 0x5c77c0", "UILayer::ccTouchEnded @ 0x5c789c", "UILayer::ccTouchEnded @ 0x5c78bc", "PlayLayer::resetLevel @ 0x5e572c", "PlayLayer::resetLevel @ 0x5e594c", "EditorUI::playerTouchBegan @ 0x690610", "EditorUI::playerTouchBegan @ 0x690634", "EditorUI::playerTouchEnded @ 0x690680", "EditorUI::playerTouchEnded @ 0x6906a0", "<???> @ 0x8e500"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}