{"type": "func", "start": 5372477248, "end": 5372477891, "name": "PlayerObject::pushButton", "pseudocode": "// \n// PlayerObject::pushButton from 0x140397f40 to 0x1403981c3 (643 bytes)\n// \n// 8 xrefs:\n// > GJBaseGameLayer::handleButton @ 0x1402339e7\n// > GJBaseGameLayer::handleButton @ 0x140233a23\n// > MenuGameLayer::tryJump @ 0x1403321b5\n// > PlayerObject::enablePlayerControls @ 0x14039f688\n// > <???> @ 0x140697f3c\n// > <???> @ 0x140697f5c\n// > <???> @ 0x140697f6c\n// > <???> @ 0x1406d64ac\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\nbool PlayerObject::pushButton(PlayerObject *a1, PlayerButton a2)\n{\n  cocos2d::CCArray *m_touchingRings; // rcx\n  signed int v6; // eax\n  unsigned int v7; // edi\n  struct cocos2d::CCArray *v8; // rbp\n  struct cocos2d::CCArray *v9; // rax\n  cocos2d::CCArray *v10; // rsi\n  struct cocos2d::CCArray *v11; // r15\n  cocos2d::ccArray *data; // rsi\n  __int64 num; // rcx\n  RingObject **arr; // rsi\n  RingObject **i; // r14\n  RingObject *v16; // rdi\n  GameObjectType v17; // eax\n  cocos2d::CCArray *v18; // rcx\n  cocos2d::ccArray *v19; // rdi\n  __int64 v20; // rax\n  RingObject **v21; // rdi\n  RingObject **j; // rsi\n  cocos2d::ccArray *v23; // rdi\n  __int64 v24; // rax\n  RingObject **v25; // rdi\n  RingObject **k; // rsi\n  PlayerButton v27; // [rsp+40h] [rbp+8h] BYREF\n\n  if ( !a1->m_inputsLocked )\n  {\n    v27 = a2;\n    *(_BYTE *)sub_1400CDBF0((__int64 *)&a1->m_holdingButtons, (int *)&v27) = 1;\n  }\n  if ( a1->m_isLocked || a1->m_controlsDisabled )\n    return 0;\n  if ( a2 == Jump )\n  {\n    if ( !a1->m_jumpBuffered )\n      PlayerObject::placeStreakPoint(a1);\n    *(_WORD *)&a1->m_jumpBuffered = 257;\n    a1->m_padRingRelated = 0;\n    sub_14005E0D0(&a1->m_ringRelatedSet._Traitsobj._Mypair._Myval2._Myval2);\n    m_touchingRings = a1->m_touchingRings;\n    a1->m_stateJumpBuffered = a1->m_jumpBuffered;\n    a1->m_stateRingJump2 = a1->m_stateRingJump;\n    *(_DWORD *)&a1->m_touchedRing = 0;\n    if ( cocos2d::CCArray::count(m_touchingRings) )\n    {\n      v6 = cocos2d::CCArray::count(a1->m_touchingRings);\n      v7 = v6;\n      if ( v6 > 0 )\n      {\n        v8 = cocos2d::CCArray::createWithCapacity(v6);\n        v9 = cocos2d::CCArray::createWithCapacity(v7);\n        v10 = a1->m_touchingRings;\n        v11 = v9;\n        if ( v10 )\n        {\n          data = v10->data;\n          num = data->num;\n          if ( (_DWORD)num )\n          {\n            arr = (RingObject **)data->arr;\n            for ( i = &arr[num - 1]; arr <= i; ++arr )\n            {\n              v16 = *arr;\n              if ( !*arr )\n                break;\n              if ( v16->m_claimTouch )\n              {\n                PlayerObject::ringJump(a1, *arr, 0);\n                a1->m_jumpBuffered = 0;\n                return 1;\n              }\n              v17 = v16->getType(*arr);\n              v18 = v8;\n              if ( v17 != CustomRing )\n                v18 = v11;\n              cocos2d::CCArray::addObject(v18, v16);\n            }\n          }\n        }\n        if ( v8 )\n        {\n          v19 = v8->data;\n          v20 = v19->num;\n          if ( (_DWORD)v20 )\n          {\n            v21 = (RingObject **)v19->arr;\n            for ( j = &v21[v20 - 1]; v21 <= j; ++v21 )\n            {\n              if ( !*v21 )\n                break;\n              PlayerObject::ringJump(a1, *v21, 0);\n            }\n          }\n        }\n        if ( v11 )\n        {\n          v23 = v11->data;\n          v24 = v23->num;\n          if ( (_DWORD)v24 )\n          {\n            v25 = (RingObject **)v23->arr;\n            for ( k = &v25[v24 - 1]; v25 <= k; ++v25 )\n            {\n              if ( !*v25 )\n                break;\n              PlayerObject::ringJump(a1, *v25, 0);\n            }\n          }\n        }\n      }\n    }\n    else if ( (a1->m_isBall || !a1->m_isShip && !a1->m_isBird && !a1->m_isDart && !a1->m_isSwing && a1->m_jumpBuffered)\n           && a1->m_isOnGround )\n    {\n      PlayerObject::updateJump(a1, 0.0);\n    }\n  }\n  else if ( (unsigned int)(a2 - 2) <= 1 )\n  {\n    PlayerObject::switchedDirTo(a1, a2);\n  }\n  return 1;\n}", "assembly": "; \n; PlayerObject::pushButton from 0x140397f40 to 0x1403981c3 (643 bytes)\n; \n; 8 xrefs:\n; > GJBaseGameLayer::handleButton @ 0x1402339e7\n; > GJBaseGameLayer::handleButton @ 0x140233a23\n; > MenuGameLayer::tryJump @ 0x1403321b5\n; > PlayerObject::enablePlayerControls @ 0x14039f688\n; > <???> @ 0x140697f3c\n; > <???> @ 0x140697f5c\n; > <???> @ 0x140697f6c\n; > <???> @ 0x1406d64ac\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    rbx                                                            ; +0x0, 0x140397f40\npush    rdi                                                            ; +0x2, 0x140397f42\nsub     rsp, 28h                                                       ; +0x3, 0x140397f43\ncmp     byte ptr [rcx+0BC8h], 0                                        ; +0x7, 0x140397f47\nmov     edi, edx                                                       ; +0xe, 0x140397f4e\nmov     rbx, rcx                                                       ; +0x10, 0x140397f50\njnz     short loc_140397F6D                                            ; +0x13, 0x140397f53\nmov     [rsp+38h+arg_0], edx                                           ; +0x15, 0x140397f55\nadd     rcx, 0BB8h                                                     ; +0x19, 0x140397f59\nlea     rdx, [rsp+38h+arg_0]                                           ; +0x20, 0x140397f60\ncall    sub_1400CDBF0                                                  ; +0x25, 0x140397f65\nmov     byte ptr [rax], 1                                              ; +0x2a, 0x140397f6a\ncmp     byte ptr [rbx+0A2Ah], 0                                        ; +0x2d, 0x140397f6d\njnz     loc_1403981BA                                                  ; +0x34, 0x140397f74\ncmp     byte ptr [rbx+0A2Bh], 0                                        ; +0x3a, 0x140397f7a\njnz     loc_1403981BA                                                  ; +0x41, 0x140397f81\nmov     [rsp+38h+arg_8], rbp                                           ; +0x47, 0x140397f87\nmov     [rsp+38h+arg_10], rsi                                          ; +0x4c, 0x140397f8c\nmov     [rsp+38h+arg_18], r14                                          ; +0x51, 0x140397f91\nmov     [rsp+38h+var_18], r15                                          ; +0x56, 0x140397f96\ncmp     edi, 1                                                         ; +0x5b, 0x140397f9b\njnz     loc_14039819F                                                  ; +0x5e, 0x140397f9e\ncmp     byte ptr [rbx+985h], 0                                         ; +0x64, 0x140397fa4\njnz     short loc_140397FB5                                            ; +0x6b, 0x140397fab\nmov     rcx, rbx                                                       ; +0x6d, 0x140397fad\ncall    PlayerObject__placeStreakPoint                                 ; +0x70, 0x140397fb0\nlea     rcx, [rbx+848h]                                                ; +0x75, 0x140397fb5\nmov     word ptr [rbx+985h], 101h                                      ; +0x7c, 0x140397fbc\nmov     byte ptr [rbx+7E0h], 0                                         ; +0x85, 0x140397fc5\ncall    sub_14005E0D0                                                  ; +0x8c, 0x140397fcc\nmovzx   eax, byte ptr [rbx+985h]                                       ; +0x91, 0x140397fd1\nmov     rcx, [rbx+0A38h]                                               ; +0x98, 0x140397fd8\nmov     [rbx+989h], al                                                 ; +0x9f, 0x140397fdf\nmovzx   eax, byte ptr [rbx+986h]                                       ; +0xa5, 0x140397fe5\nmov     [rbx+98Ah], al                                                 ; +0xac, 0x140397fec\nmov     dword ptr [rbx+98Bh], 0                                        ; +0xb2, 0x140397ff2\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xbc, 0x140397ffc\ntest    eax, eax                                                       ; +0xc2, 0x140398002\njnz     short loc_140398067                                            ; +0xc4, 0x140398004\ncmp     [rbx+9BBh], al                                                 ; +0xc6, 0x140398006\njnz     short loc_140398036                                            ; +0xcc, 0x14039800c\ncmp     [rbx+9B9h], al                                                 ; +0xce, 0x14039800e\njnz     short loc_14039804A                                            ; +0xd4, 0x140398014\ncmp     [rbx+9BAh], al                                                 ; +0xd6, 0x140398016\njnz     short loc_14039804A                                            ; +0xdc, 0x14039801c\ncmp     [rbx+9BCh], al                                                 ; +0xde, 0x14039801e\njnz     short loc_14039804A                                            ; +0xe4, 0x140398024\ncmp     [rbx+9C4h], al                                                 ; +0xe6, 0x140398026\njnz     short loc_14039804A                                            ; +0xec, 0x14039802c\ncmp     [rbx+985h], al                                                 ; +0xee, 0x14039802e\njz      short loc_14039804A                                            ; +0xf4, 0x140398034\ncmp     byte ptr [rbx+9C1h], 0                                         ; +0xf6, 0x140398036\njz      short loc_14039804A                                            ; +0xfd, 0x14039803d\nxorps   xmm1, xmm1                                                     ; +0xff, 0x14039803f\nmov     rcx, rbx                                                       ; +0x102, 0x140398042\ncall    PlayerObject__updateJump                                       ; +0x105, 0x140398045\nmov     r14, [rsp+38h+arg_18]                                          ; +0x10a, 0x14039804a\nmov     al, 1                                                          ; +0x10f, 0x14039804f\nmov     rsi, [rsp+38h+arg_10]                                          ; +0x111, 0x140398051\nmov     rbp, [rsp+38h+arg_8]                                           ; +0x116, 0x140398056\nmov     r15, [rsp+38h+var_18]                                          ; +0x11b, 0x14039805b\nadd     rsp, 28h                                                       ; +0x120, 0x140398060\npop     rdi                                                            ; +0x124, 0x140398064\npop     rbx                                                            ; +0x125, 0x140398065\nretn                                                                   ; +0x126, 0x140398066\nmov     rcx, [rbx+0A38h]                                               ; +0x127, 0x140398067\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x12e, 0x14039806e\nmov     edi, eax                                                       ; +0x134, 0x140398074\ntest    eax, eax                                                       ; +0x136, 0x140398076\njle     short loc_14039804A                                            ; +0x138, 0x140398078\nmov     ecx, eax                                                       ; +0x13a, 0x14039807a\ncall    cs:?createWithCapacity@CCArray@cocos2d@@SAPEAV12@I@Z; cocos2d::CCArray::createWithCapacity(uint) ; +0x13c, 0x14039807c\nmov     ecx, edi                                                       ; +0x142, 0x140398082\nmov     rbp, rax                                                       ; +0x144, 0x140398084\ncall    cs:?createWithCapacity@CCArray@cocos2d@@SAPEAV12@I@Z; cocos2d::CCArray::createWithCapacity(uint) ; +0x147, 0x140398087\nmov     rsi, [rbx+0A38h]                                               ; +0x14d, 0x14039808d\nmov     r15, rax                                                       ; +0x154, 0x140398094\ntest    rsi, rsi                                                       ; +0x157, 0x140398097\njz      short loc_1403980F5                                            ; +0x15a, 0x14039809a\nmov     rsi, [rsi+38h]                                                 ; +0x15c, 0x14039809c\nmov     ecx, [rsi]                                                     ; +0x160, 0x1403980a0\ntest    ecx, ecx                                                       ; +0x162, 0x1403980a2\njz      short loc_1403980F5                                            ; +0x164, 0x1403980a4\nmov     rsi, [rsi+10h]                                                 ; +0x166, 0x1403980a6\nlea     r14, [rcx-1]                                                   ; +0x16a, 0x1403980aa\nlea     r14, [rsi+r14*8]                                               ; +0x16e, 0x1403980ae\ncmp     rsi, r14                                                       ; +0x172, 0x1403980b2\nja      short loc_1403980F5                                            ; +0x175, 0x1403980b5\nmov     rdi, [rsi]                                                     ; +0x177, 0x1403980b7\ntest    rdi, rdi                                                       ; +0x17a, 0x1403980ba\njz      short loc_1403980F5                                            ; +0x17d, 0x1403980bd\ncmp     byte ptr [rdi+740h], 0                                         ; +0x17f, 0x1403980bf\njnz     loc_140398185                                                  ; +0x186, 0x1403980c6\nmov     rax, [rdi]                                                     ; +0x18c, 0x1403980cc\nmov     rcx, rdi                                                       ; +0x18f, 0x1403980cf\ncall    qword ptr [rax+660h]                                           ; +0x192, 0x1403980d2\nmov     rdx, rdi                                                       ; +0x198, 0x1403980d8\nmov     rcx, rbp                                                       ; +0x19b, 0x1403980db\ncmp     eax, 24h ; '$'                                                 ; +0x19e, 0x1403980de\njz      short loc_1403980E6                                            ; +0x1a1, 0x1403980e1\nmov     rcx, r15                                                       ; +0x1a3, 0x1403980e3\ncall    cs:?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x1a6, 0x1403980e6\nadd     rsi, 8                                                         ; +0x1ac, 0x1403980ec\ncmp     rsi, r14                                                       ; +0x1b0, 0x1403980f0\njbe     short loc_1403980B7                                            ; +0x1b3, 0x1403980f3\ntest    rbp, rbp                                                       ; +0x1b5, 0x1403980f5\njz      short loc_140398131                                            ; +0x1b8, 0x1403980f8\nmov     rdi, [rbp+38h]                                                 ; +0x1ba, 0x1403980fa\nmov     eax, [rdi]                                                     ; +0x1be, 0x1403980fe\ntest    eax, eax                                                       ; +0x1c0, 0x140398100\njz      short loc_140398131                                            ; +0x1c2, 0x140398102\nmov     rdi, [rdi+10h]                                                 ; +0x1c4, 0x140398104\nlea     rsi, [rax-1]                                                   ; +0x1c8, 0x140398108\nlea     rsi, [rdi+rsi*8]                                               ; +0x1cc, 0x14039810c\ncmp     rdi, rsi                                                       ; +0x1d0, 0x140398110\nja      short loc_140398131                                            ; +0x1d3, 0x140398113\nmov     rdx, [rdi]                                                     ; +0x1d5, 0x140398115\ntest    rdx, rdx                                                       ; +0x1d8, 0x140398118\njz      short loc_140398131                                            ; +0x1db, 0x14039811b\nxor     r8d, r8d                                                       ; +0x1dd, 0x14039811d\nmov     rcx, rbx                                                       ; +0x1e0, 0x140398120\ncall    PlayerObject__ringJump                                         ; +0x1e3, 0x140398123\nadd     rdi, 8                                                         ; +0x1e8, 0x140398128\ncmp     rdi, rsi                                                       ; +0x1ec, 0x14039812c\njbe     short loc_140398115                                            ; +0x1ef, 0x14039812f\ntest    r15, r15                                                       ; +0x1f1, 0x140398131\njz      loc_14039804A                                                  ; +0x1f4, 0x140398134\nmov     rdi, [r15+38h]                                                 ; +0x1fa, 0x14039813a\nmov     eax, [rdi]                                                     ; +0x1fe, 0x14039813e\ntest    eax, eax                                                       ; +0x200, 0x140398140\njz      loc_14039804A                                                  ; +0x202, 0x140398142\nmov     rdi, [rdi+10h]                                                 ; +0x208, 0x140398148\nlea     rsi, [rax-1]                                                   ; +0x20c, 0x14039814c\nlea     rsi, [rdi+rsi*8]                                               ; +0x210, 0x140398150\ncmp     rdi, rsi                                                       ; +0x214, 0x140398154\nja      loc_14039804A                                                  ; +0x217, 0x140398157\nnop     dword ptr [rax]                                                ; +0x21d, 0x14039815d\nmov     rdx, [rdi]                                                     ; +0x220, 0x140398160\ntest    rdx, rdx                                                       ; +0x223, 0x140398163\njz      loc_14039804A                                                  ; +0x226, 0x140398166\nxor     r8d, r8d                                                       ; +0x22c, 0x14039816c\nmov     rcx, rbx                                                       ; +0x22f, 0x14039816f\ncall    PlayerObject__ringJump                                         ; +0x232, 0x140398172\nadd     rdi, 8                                                         ; +0x237, 0x140398177\ncmp     rdi, rsi                                                       ; +0x23b, 0x14039817b\njbe     short loc_140398160                                            ; +0x23e, 0x14039817e\njmp     loc_14039804A                                                  ; +0x240, 0x140398180\nxor     r8d, r8d                                                       ; +0x245, 0x140398185\nmov     rdx, rdi                                                       ; +0x248, 0x140398188\nmov     rcx, rbx                                                       ; +0x24b, 0x14039818b\ncall    PlayerObject__ringJump                                         ; +0x24e, 0x14039818e\nmov     byte ptr [rbx+985h], 0                                         ; +0x253, 0x140398193\njmp     loc_14039804A                                                  ; +0x25a, 0x14039819a\nlea     eax, [rdi-2]                                                   ; +0x25f, 0x14039819f\ncmp     eax, 1                                                         ; +0x262, 0x1403981a2\nja      loc_14039804A                                                  ; +0x265, 0x1403981a5\nmov     edx, edi                                                       ; +0x26b, 0x1403981ab\nmov     rcx, rbx                                                       ; +0x26d, 0x1403981ad\ncall    PlayerObject__switchedDirTo                                    ; +0x270, 0x1403981b0\njmp     loc_14039804A                                                  ; +0x275, 0x1403981b5\nxor     al, al                                                         ; +0x27a, 0x1403981ba\nadd     rsp, 28h                                                       ; +0x27c, 0x1403981bc\npop     rdi                                                            ; +0x280, 0x1403981c0\npop     rbx                                                            ; +0x281, 0x1403981c1\nretn                                                                   ; +0x282, 0x1403981c2", "xrefs": ["GJBaseGameLayer::handleButton @ 0x1402339e7", "GJBaseGameLayer::handleButton @ 0x140233a23", "MenuGameLayer::tryJump @ 0x1403321b5", "PlayerObject::enablePlayerControls @ 0x14039f688", "<???> @ 0x140697f3c", "<???> @ 0x140697f5c", "<???> @ 0x140697f6c", "<???> @ 0x1406d64ac"], "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"}