{"type": "func", "start": 4675324, "end": 4675574, "name": "GJBaseGameLayer::queueButton", "pseudocode": "// \n// GJBaseGameLayer::queueButton from 0x4756fc to 0x4757f6 (250 bytes)\n// \n// 13 xrefs:\n// > UILayer::handleKeypress @ 0x30d4e6\n// > UILayer::processUINodeTouch @ 0x30d868\n// > UILayer::processUINodeTouch @ 0x30d88e\n// > UILayer::processUINodeTouch @ 0x30d90c\n// > UILayer::processUINodeTouch @ 0x30d922\n// > UILayer::processUINodeTouch @ 0x30d946\n// > UILayer::processUINodeTouch @ 0x30d980\n// > UILayer::processUINodeTouch @ 0x30d994\n// > UILayer::ccTouchBegan @ 0x30db4c\n// > UILayer::ccTouchEnded @ 0x30dbd4\n// > PlayLayer::resetLevel @ 0x31fe0c\n// > EditorUI::playerTouchBegan @ 0x381fdc\n// > EditorUI::playerTouchEnded @ 0x38204a\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  std::vector<PlayerButtonCommand> *p_m_queuedButtons; // r6\n  PlayerButtonCommand *m_finish; // r5\n  int v10; // r1\n  __int64 v11; // r2\n  int v12; // r5\n  int v13; // r2\n  bool v14; // cf\n  unsigned int v15; // r2\n  int v16; // r5\n  PlayerButtonCommand *v17; // r11\n  PlayerButtonCommand *m_start; // r12\n  signed int v19; // r10\n  char *v20; // r7\n  int v21; // r1\n  __int64 v22; // r2\n  int v23; // r10\n  _QWORD v24[3]; // [sp+8h] [bp-1Ch] BYREF\n\n  if ( a2 )\n  {\n    p_m_queuedButtons = &a1->m_queuedButtons;\n    memset(v24, 0, sizeof(v24));\n    m_finish = p_m_queuedButtons->m_finish;\n    if ( m_finish == p_m_queuedButtons->m_reserveEnd )\n    {\n      v12 = -1431655765 * (((char *)m_finish - (char *)p_m_queuedButtons->m_start) >> 3);\n      if ( v12 )\n        v13 = v12;\n      else\n        v13 = 1;\n      v14 = __CFADD__(v13, v12);\n      v15 = v13 + v12;\n      v16 = 178956970;\n      if ( v14 || v15 > 0xAAAAAAA || (v16 = v15) != 0 )\n        v17 = (PlayerButtonCommand *)operator new(24 * v16);\n      else\n        v17 = nullptr;\n      m_start = p_m_queuedButtons->m_start;\n      v19 = (char *)p_m_queuedButtons->m_finish - (char *)p_m_queuedButtons->m_start;\n      if ( (char *)v17 + v19 )\n      {\n        *(double *)&v24[2] = a5;\n        BYTE4(v24[0]) = a3;\n        v20 = (char *)v17 + v19;\n        LODWORD(v24[0]) = a2;\n        BYTE5(v24[0]) = a4;\n        v21 = HIDWORD(v24[0]);\n        v22 = v24[1];\n        *(_DWORD *)v20 = a2;\n        *((_DWORD *)v20 + 1) = v21;\n        *((_QWORD *)v20 + 1) = v22;\n        *(_QWORD *)((char *)&v17->m_timestamp + v19) = v24[2];\n      }\n      if ( -1431655765 * (v19 >> 3) )\n        memmove(v17, m_start, v19);\n      v23 = v19 + 24;\n      if ( p_m_queuedButtons->m_start )\n        operator delete(p_m_queuedButtons->m_start);\n      p_m_queuedButtons->m_start = v17;\n      p_m_queuedButtons->m_finish = (PlayerButtonCommand *)((char *)v17 + v23);\n      p_m_queuedButtons->m_reserveEnd = &v17[v16];\n    }\n    else\n    {\n      if ( m_finish )\n      {\n        *(double *)&v24[2] = a5;\n        BYTE4(v24[0]) = a3;\n        LODWORD(v24[0]) = a2;\n        BYTE5(v24[0]) = a4;\n        v10 = HIDWORD(v24[0]);\n        v11 = v24[1];\n        m_finish->m_button = a2;\n        *(_DWORD *)&m_finish->m_isPush = v10;\n        *(_QWORD *)&m_finish->m_step = v11;\n        *(_QWORD *)&m_finish->m_timestamp = v24[2];\n      }\n      p_m_queuedButtons->m_finish = m_finish + 1;\n    }\n  }\n}", "assembly": "; \n; GJBaseGameLayer::queueButton from 0x4756fc to 0x4757f6 (250 bytes)\n; \n; 13 xrefs:\n; > UILayer::handleKeypress @ 0x30d4e6\n; > UILayer::processUINodeTouch @ 0x30d868\n; > UILayer::processUINodeTouch @ 0x30d88e\n; > UILayer::processUINodeTouch @ 0x30d90c\n; > UILayer::processUINodeTouch @ 0x30d922\n; > UILayer::processUINodeTouch @ 0x30d946\n; > UILayer::processUINodeTouch @ 0x30d980\n; > UILayer::processUINodeTouch @ 0x30d994\n; > UILayer::ccTouchBegan @ 0x30db4c\n; > UILayer::ccTouchEnded @ 0x30dbd4\n; > PlayLayer::resetLevel @ 0x31fe0c\n; > EditorUI::playerTouchBegan @ 0x381fdc\n; > EditorUI::playerTouchEnded @ 0x38204a\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\nPUSH.W          {R4-R11,LR}                                            ; +0x0, 0x4756fc\nMOV             R6, R0                                                 ; +0x4, 0x475700\nVPUSH           {D8}                                                   ; +0x6, 0x475702\nMOV             R7, R2                                                 ; +0xa, 0x475706\nMOV             R8, R3                                                 ; +0xc, 0x475708\nMOV             R9, R1                                                 ; +0xe, 0x47570a\nSUB             SP, SP, #0x24                                          ; +0x10, 0x47570c\nVLDR            D8, [SP,#0x24+arg_0]                                   ; +0x12, 0x47570e\nCMP             R1, #0                                                 ; +0x16, 0x475712\nBEQ             loc_4757EC                                             ; +0x18, 0x475714\nADD             R4, SP, #0x24+var_1C                                   ; +0x1a, 0x475716\nADD.W           R6, R6, #0x2B80                                        ; +0x1c, 0x475718\nMOVS            R1, #0; int                                            ; +0x20, 0x47571c\nMOVS            R2, #0x18; size_t                                      ; +0x22, 0x47571e\nMOV             R0, R4; void *                                         ; +0x24, 0x475720\nBLX             memset                                                 ; +0x26, 0x475722\nLDR             R5, [R6,#4]                                            ; +0x2a, 0x475726\nLDR             R3, [R6,#8]                                            ; +0x2c, 0x475728\nCMP             R5, R3                                                 ; +0x2e, 0x47572a\nBEQ             loc_475754                                             ; +0x30, 0x47572c\nCBZ             R5, loc_47574E                                         ; +0x32, 0x47572e\nVSTR            D8, [SP,#0x24+var_C]                                   ; +0x34, 0x475730\nSTRB.W          R7, [SP,#0x24+var_18]                                  ; +0x38, 0x475734\nMOV             R7, R5                                                 ; +0x3c, 0x475738\nSTR.W           R9, [SP,#0x24+var_1C]                                  ; +0x3e, 0x47573a\nSTRB.W          R8, [SP,#0x24+var_17]                                  ; +0x42, 0x47573e\nLDM             R4!, {R0-R3}                                           ; +0x46, 0x475742\nSTM             R7!, {R0-R3}                                           ; +0x48, 0x475744\nLDM.W           R4, {R0,R1}                                            ; +0x4a, 0x475746\nSTM.W           R7, {R0,R1}                                            ; +0x4e, 0x47574a\nADDS            R5, #0x18                                              ; +0x52, 0x47574e\nSTR             R5, [R6,#4]                                            ; +0x54, 0x475750\nB               loc_4757EC                                             ; +0x56, 0x475752\nLDR             R3, [R6]                                               ; +0x58, 0x475754\nSUBS            R5, R5, R3                                             ; +0x5a, 0x475756\nLDR             R3, =0xAAAAAAAB                                        ; +0x5c, 0x475758\nASRS            R5, R5, #3                                             ; +0x5e, 0x47575a\nMULS            R5, R3                                                 ; +0x60, 0x47575c\nITE NE                                                                 ; +0x62, 0x47575e\nMOVNE           R2, R5                                                 ; +0x64, 0x475760\nMOVEQ           R2, #1                                                 ; +0x66, 0x475762\nADDS            R2, R2, R5                                             ; +0x68, 0x475764\nLDR             R5, =0xAAAAAAA                                         ; +0x6a, 0x475766\nBCS             loc_47576E                                             ; +0x6c, 0x475768\nCMP             R2, R5                                                 ; +0x6e, 0x47576a\nBLS             loc_4757E2                                             ; +0x70, 0x47576c\nMOVS            R0, #0x18                                              ; +0x72, 0x47576e\nSTR             R3, [SP,#0x24+var_20]                                  ; +0x74, 0x475770\nMULS            R0, R5; unsigned int                                   ; +0x76, 0x475772\nBL              _Znwj; operator new(uint)                              ; +0x78, 0x475774\nLDR             R3, [SP,#0x24+var_20]                                  ; +0x7c, 0x475778\nMOV             R11, R0                                                ; +0x7e, 0x47577a\nLDR.W           R12, [R6]                                              ; +0x80, 0x47577c\nLDR             R2, [R6,#4]                                            ; +0x84, 0x475780\nRSB.W           R10, R12, R2                                           ; +0x86, 0x475782\nMOV.W           LR, R10,ASR#3                                          ; +0x8a, 0x475786\nMUL             LR, R3, LR                                             ; +0x8e, 0x47578a\nADDS.W          R3, R11, R10                                           ; +0x92, 0x47578e\nBEQ             loc_4757B2                                             ; +0x96, 0x475792\nVSTR            D8, [SP,#0x24+var_C]                                   ; +0x98, 0x475794\nSTRB.W          R7, [SP,#0x24+var_18]                                  ; +0x9c, 0x475798\nMOV             R7, R3                                                 ; +0xa0, 0x47579c\nSTR.W           R9, [SP,#0x24+var_1C]                                  ; +0xa2, 0x47579e\nSTRB.W          R8, [SP,#0x24+var_17]                                  ; +0xa6, 0x4757a2\nLDM             R4!, {R0-R3}                                           ; +0xaa, 0x4757a6\nSTM             R7!, {R0-R3}                                           ; +0xac, 0x4757a8\nLDM.W           R4, {R0,R1}                                            ; +0xae, 0x4757aa\nSTM.W           R7, {R0,R1}                                            ; +0xb2, 0x4757ae\nCMP.W           LR, #0                                                 ; +0xb6, 0x4757b2\nBEQ             loc_4757C2                                             ; +0xba, 0x4757b6\nMOV             R0, R11; void *                                        ; +0xbc, 0x4757b8\nMOV             R1, R12; void *                                        ; +0xbe, 0x4757ba\nMOV             R2, R10; size_t                                        ; +0xc0, 0x4757bc\nBLX             memmove                                                ; +0xc2, 0x4757be\nLDR             R0, [R6]; p                                            ; +0xc6, 0x4757c2\nADD.W           R10, R10, #0x18                                        ; +0xc8, 0x4757c4\nADD.W           R4, R11, R10                                           ; +0xcc, 0x4757c8\nCBZ             R0, loc_4757D2                                         ; +0xd0, 0x4757cc\nBL              _ZdlPv; operator delete(void *)                        ; +0xd2, 0x4757ce\nMOVS            R3, #0x18                                              ; +0xd6, 0x4757d2\nSTR.W           R11, [R6]                                              ; +0xd8, 0x4757d4\nMLA             R5, R3, R5, R11                                        ; +0xdc, 0x4757d8\nSTR             R4, [R6,#4]                                            ; +0xe0, 0x4757dc\nSTR             R5, [R6,#8]                                            ; +0xe2, 0x4757de\nB               loc_4757EC                                             ; +0xe4, 0x4757e0\nMOV             R5, R2                                                 ; +0xe6, 0x4757e2\nCMP             R2, #0                                                 ; +0xe8, 0x4757e4\nBNE             loc_47576E                                             ; +0xea, 0x4757e6\nMOV             R11, R2                                                ; +0xec, 0x4757e8\nB               loc_47577C                                             ; +0xee, 0x4757ea\nADD             SP, SP, #0x24 ; '$'                                    ; +0xf0, 0x4757ec\nVPOP            {D8}                                                   ; +0xf2, 0x4757ee\nPOP.W           {R4-R11,PC}                                            ; +0xf6, 0x4757f2", "xrefs": ["UILayer::handleKeypress @ 0x30d4e6", "UILayer::processUINodeTouch @ 0x30d868", "UILayer::processUINodeTouch @ 0x30d88e", "UILayer::processUINodeTouch @ 0x30d90c", "UILayer::processUINodeTouch @ 0x30d922", "UILayer::processUINodeTouch @ 0x30d946", "UILayer::processUINodeTouch @ 0x30d980", "UILayer::processUINodeTouch @ 0x30d994", "UILayer::ccTouchBegan @ 0x30db4c", "UILayer::ccTouchEnded @ 0x30dbd4", "PlayLayer::resetLevel @ 0x31fe0c", "EditorUI::playerTouchBegan @ 0x381fdc", "EditorUI::playerTouchEnded @ 0x38204a"], "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"}