//
// SecretRewardsLayer::switchToOpenedState from 0x100632190 to 0x100632249 (185 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall SecretRewardsLayer::switchToOpenedState(SecretRewardsLayer *a1, CCMenuItemSpriteExtra *a2)
{
__int64 v2; // rax
GJChestSprite *v3; // r14
__int64 v4; // rax
unsigned int *v5; // rax
_QWORD *v6; // r12
unsigned __int64 v7; // r13
__int64 v8; // r15
int v9; // [rsp+0h] [rbp-2Ch] BYREF
v9 = HIDWORD(v2);
v3 = (GJChestSprite *)((__int64 (__fastcall *)(CCMenuItemSpriteExtra *))a2->getNormalImage)(a2);
GJChestSprite::switchToState(v3, Opened, 1);
v4 = ((__int64 (__fastcall *)(GJChestSprite *))v3->getChildren)(v3);
if ( v4 )
{
v5 = *(unsigned int **)(v4 + 56);
if ( *v5 )
{
v6 = *((_QWORD **)v5 + 2);
v7 = (unsigned __int64)&v6[*v5 - 1];
do
{
v8 = *v6;
if ( !*v6 )
break;
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)v8 + 896LL))(*v6, 100);
BYTE2(v9) = -106;
LOWORD(v9) = -26986;
(*(void (__fastcall **)(__int64, int *))(*(_QWORD *)v8 + 944LL))(v8, &v9);
++v6;
}
while ( (unsigned __int64)v6 <= v7 );
}
}
((void (__fastcall *)(CCMenuItemSpriteExtra *, _QWORD))a2->setEnabled)(a2, 0);
}