//
// PlayerObject::pushButton from 0x1404f6200 to 0x1404f64b3 (691 bytes)
//
// 8 xrefs:
// > GJBaseGameLayer::handleButton @ 0x14033c6d7
// > GJBaseGameLayer::handleButton @ 0x14033c713
// > MenuGameLayer::tryJump @ 0x1404707b5
// > PlayerObject::enablePlayerControls @ 0x1404fdace
// > ??> @ 0x1408d51c0
// > ??> @ 0x1408d51e0
// > ??> @ 0x1408d51f0
// > ??> @ 0x14092a188
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:33:20 +0000
//
char __fastcall PlayerObject::pushButton(__int64 a1, int a2)
{
const struct cocos2d::CCPoint *v4; // rax
__int64 v5; // rax
cocos2d::CCArray *v6; // rcx
signed int v8; // eax
unsigned int v9; // edi
struct cocos2d::CCArray *v10; // rbp
struct cocos2d::CCArray *v11; // rax
__int64 v12; // rsi
struct cocos2d::CCArray *v13; // r15
unsigned int *v14; // rsi
__int64 v15; // rax
struct cocos2d::CCObject **v16; // rsi
struct cocos2d::CCObject **i; // r14
struct cocos2d::CCObject *v18; // rdi
int v19; // eax
cocos2d::CCArray *v20; // rcx
unsigned int *v21; // rdi
__int64 v22; // rax
_QWORD *v23; // rdi
_QWORD *j; // rsi
unsigned int *v25; // rdi
__int64 v26; // rax
_QWORD *v27; // rdi
_QWORD *k; // rsi
int v29; // [rsp+40h] [rbp+8h] BYREF
if ( !*(_BYTE *)(a1 + 3024) )
{
v29 = a2;
*(_BYTE *)sub_14016EE40((__int64 *)(a1 + 3008), &v29) = 1;
}
if ( !*(_BYTE *)(a1 + 2610) && !*(_BYTE *)(a1 + 2611) )
{
if ( a2 != 1 )
{
if ( (unsigned int)(a2 - 2) <= 1 )
PlayerObject::switchedDirTo(a1, a2);
return 1;
}
if ( !*(_BYTE *)(a1 + 2445) )
{
v4 = (const struct cocos2d::CCPoint *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 200LL))(a1);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v29, v4);
PlayerObject::placeStreakPoint(a1, v5);
}
*(_WORD *)(a1 + 2445) = 257;
*(_BYTE *)(a1 + 2024) = 0;
sub_14003EB60((_QWORD *)(a1 + 2128));
v6 = *(cocos2d::CCArray **)(a1 + 2624);
*(_BYTE *)(a1 + 2449) = *(_BYTE *)(a1 + 2445);
*(_BYTE *)(a1 + 2450) = *(_BYTE *)(a1 + 2446);
*(_DWORD *)(a1 + 2451) = 0;
if ( cocos2d::CCArray::count(v6) )
{
v8 = cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 2624));
v9 = v8;
if ( v8 > 0 )
{
v10 = cocos2d::CCArray::createWithCapacity(v8);
v11 = cocos2d::CCArray::createWithCapacity(v9);
v12 = *(_QWORD *)(a1 + 2624);
v13 = v11;
if ( v12 )
{
v14 = *(unsigned int **)(v12 + 56);
v15 = *v14;
if ( (_DWORD)v15 )
{
v16 = *((struct cocos2d::CCObject ***)v14 + 2);
for ( i = &v16[v15 - 1]; v16 <= i; ++v16 )
{
v18 = *v16;
if ( !*v16 )
break;
if ( *((_BYTE *)v18 + 1856) )
{
PlayerObject::ringJump(a1, *v16, 0);
*(_BYTE *)(a1 + 2445) = 0;
return 1;
}
v19 = (*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v18 + 1648LL))(*v16);
v20 = v10;
if ( v19 != 36 )
v20 = v13;
cocos2d::CCArray::addObject(v20, v18);
}
}
}
if ( v10 )
{
v21 = *((unsigned int **)v10 + 7);
v22 = *v21;
if ( (_DWORD)v22 )
{
v23 = *((_QWORD **)v21 + 2);
for ( j = &v23[v22 - 1]; v23 <= j; ++v23 )
{
if ( !*v23 )
break;
PlayerObject::ringJump(a1, *v23, 0);
}
}
}
if ( v13 )
{
v25 = *((unsigned int **)v13 + 7);
v26 = *v25;
if ( (_DWORD)v26 )
{
v27 = *((_QWORD **)v25 + 2);
for ( k = &v27[v26 - 1]; v27 <= k; ++v27 )
{
if ( !*v27 )
break;
PlayerObject::ringJump(a1, *v27, 0);
}
}
}
}
return 1;
}
if ( *(_BYTE *)(a1 + 2499) )
{
if ( !*(_BYTE *)(a1 + 2505) )
return 1;
}
else if ( *(_BYTE *)(a1 + 2497)
|| *(_BYTE *)(a1 + 2498)
|| *(_BYTE *)(a1 + 2500)
|| *(_BYTE *)(a1 + 2508)
|| !*(_BYTE *)(a1 + 2445)
|| !*(_BYTE *)(a1 + 2505) )
{
return 1;
}
PlayerObject::updateJump(a1, 0.0);
return 1;
}
return 0;
}