//
// PauseLayer::onSideButtonPressed from 0x1003c1590 to 0x1003c1899 (777 bytes)
//
// 2 xrefs:
// > PauseLayer::customSetup @ 0x1003c01b4
// > PauseLayer::customSetup @ 0x1003c0030
//
// 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 12:29:33 +0000
//
__int64 __fastcall PauseLayer::onSideButtonPressed(__int64 a1, __int64 a2, double a3)
{
__int64 v3; // kr08_8
__int64 v4; // rax
void *v5; // rax
__int64 v6; // rax
__int64 result; // rax
__int64 v8; // rax
__int64 v9; // rax
__int64 v10; // rax
__int64 v11; // rax
__int64 v12; // rax
unsigned __int8 v13; // r14
__int64 v14; // rax
__int64 v15; // rbx
__int64 v16; // rax
const char *v17; // rsi
__int64 v18; // rax
__int64 v19; // r15
unsigned __int8 v20; // al
__int64 v21; // r15
unsigned int *v22; // rax
__int64 v23; // rax
__int64 v24; // rax
__int64 v25; // rbx
double v26; // [rsp+0h] [rbp-30h] BYREF
float v27; // [rsp+8h] [rbp-28h] BYREF
double v28; // [rsp+10h] [rbp-20h] BYREF
v3 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
switch ( v3 )
{
case 0LL:
v4 = GameManager::sharedState();
v5 = (void *)GameSettingsLayer::create(*(_QWORD *)(v4 + 544), 0);
return (*(__int64 (__fastcall **)(void *))(*(_QWORD *)v5 + 1312LL))(v5);
case 1LL:
return sub_1003C1980(a1);
case 2LL:
result = GameManager::sharedState();
if ( !*(_QWORD *)(result + 544) )
return result;
result = *(_QWORD *)(GameManager::sharedState() + 544);
if ( !*(_QWORD *)(result + 1936) )
return result;
v8 = GameManager::sharedState();
v5 = (void *)DeathTrackerPopup::create(*(_QWORD *)(*(_QWORD *)(v8 + 544) + 1936LL));
break;
case 3LL:
result = GameManager::sharedState();
if ( !*(_QWORD *)(result + 544) )
return result;
result = *(_QWORD *)(GameManager::sharedState() + 544);
if ( !*(_QWORD *)(result + 1936) )
return result;
v9 = GameManager::sharedState();
v5 = (void *)DeathMarkerSettingsPopup::create(*(_QWORD *)(*(_QWORD *)(v9 + 544) + 1936LL));
break;
case 4LL:
v6 = GameManager::sharedState();
v5 = (void *)InfoLayer::create(*(_QWORD *)(*(_QWORD *)(v6 + 544) + 1936LL), 0, 0, 0);
return (*(__int64 (__fastcall **)(void *))(*(_QWORD *)v5 + 1312LL))(v5);
case 5LL:
v11 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 1072LL))(a2);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v11 + 560LL))(v11, 99);
v5 = ChallengesPage::create();
return (*(__int64 (__fastcall **)(void *))(*(_QWORD *)v5 + 1312LL))(v5);
case 6LL:
v12 = GameManager::sharedState();
v13 = GameManager::toggleGameVariable(v12, "0173");
if ( *(_QWORD *)(GameManager::sharedState() + 544) )
{
v14 = GameManager::sharedState();
sub_10007A340(*(_QWORD *)(v14 + 544), v13, a3);
}
v15 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 1072LL))(a2);
v16 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v17 = "sideBtn_damageOn_001.png";
if ( v13 )
v17 = "sideBtn_damageOff_001.png";
v18 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v16, v17);
return (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v15 + 1160LL))(v15, v18);
case 7LL:
result = GameManager::sharedState();
if ( !*(_QWORD *)(result + 544) )
return result;
result = *(_QWORD *)(GameManager::sharedState() + 544);
if ( !*(_QWORD *)(result + 1936) )
return result;
v10 = GameManager::sharedState();
v5 = (void *)PlatformerControlsPopup::create(*(_QWORD *)(*(_QWORD *)(v10 + 544) + 1936LL), 0);
break;
case 8LL:
v19 = *(_QWORD *)(a1 + 624);
if ( v19 )
{
v20 = (*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)v19 + 352LL))(*(_QWORD *)(a1 + 624));
return (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v19 + 344LL))(v19, v20 ^ 1u);
}
else
{
v21 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 512LL))(a2);
v22 = (unsigned int *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 192LL))(a2);
cocos2d::CCNode::convertToWorldSpace(&v26, v21, v22);
cocos2d::CCNode::convertToNodeSpace(&v28, a1, (unsigned int *)&v26);
v23 = GameManager::sharedState();
v24 = TimeSpeedControl::create(*(_QWORD *)(v23 + 544), a3);
*(_QWORD *)(a1 + 624) = v24;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 632) + 464LL))(
*(_QWORD *)(a1 + 632),
v24,
4);
v25 = *(_QWORD *)(a1 + 624);
sub_100278250(&v27, *(float *)&v28, *((float *)&v28 + 1) + -80.0);
return (*(__int64 (__fastcall **)(__int64, float *))(*(_QWORD *)v25 + 184LL))(v25, &v27);
}
case 9LL:
v5 = UIPOptionsLayer::create();
return (*(__int64 (__fastcall **)(void *))(*(_QWORD *)v5 + 1312LL))(v5);
default:
return v3;
}
return (*(__int64 (__fastcall **)(void *))(*(_QWORD *)v5 + 1312LL))(v5);
}