//
// SecretRewardsLayer::switchToOpenedState from 0x10070edc0 to 0x10070ee79 (185 bytes)
//
// 0 xrefs:
//
// 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:36:05 +0000
//
__int64 __fastcall SecretRewardsLayer::switchToOpenedState(double a1, double a2, __m128 a3, __int64 a4, __int64 a5)
{
__int64 v5; // rax
_DWORD *v6; // r14
__int64 v7; // rax
unsigned int *v8; // rax
_QWORD *v9; // r12
unsigned __int64 v10; // r13
__int64 v11; // r15
int v13; // [rsp+0h] [rbp-2Ch] BYREF
v13 = HIDWORD(v5);
v6 = (_DWORD *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a5 + 1072LL))(a5);
GJChestSprite::switchToState(v6, 4, 1, a1, a2, a3);
v7 = (*(__int64 (__fastcall **)(_DWORD *))(*(_QWORD *)v6 + 488LL))(v6);
if ( v7 )
{
v8 = *(unsigned int **)(v7 + 56);
if ( *v8 )
{
v9 = *((_QWORD **)v8 + 2);
v10 = (unsigned __int64)&v9[*v8 - 1];
do
{
v11 = *v9;
if ( !*v9 )
break;
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)v11 + 912LL))(*v9, 100);
BYTE2(v13) = -106;
LOWORD(v13) = -26986;
(*(void (__fastcall **)(__int64, int *))(*(_QWORD *)v11 + 960LL))(v11, &v13);
++v9;
}
while ( (unsigned __int64)v9 <= v10 );
}
}
return (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a5 + 1056LL))(a5, 0);
}