//
// sub_1008F0170 from 0x1008f0170 to 0x1008f02ef (383 bytes)
//
// 4 xrefs:
// > sub_1008F0300 @ 0x1008f0305
// > sub_1008F0310 @ 0x1008f031c
// > sub_1008F0330 @ 0x1008f0339
// > sub_1008F0350 @ 0x1008f0363
//
// 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:37:55 +0000
//
__int64 __fastcall sub_1008F0170(__int64 a1)
{
_DWORD *v2; // rdi
_DWORD *v3; // rdi
_DWORD *v4; // rdi
*(_QWORD *)a1 = off_100BB4B80;
*(_QWORD *)(a1 + 320) = off_100BB51A0;
*(_QWORD *)(a1 + 328) = &off_100BB5210;
*(_QWORD *)(a1 + 336) = off_100BB5228;
*(_QWORD *)(a1 + 344) = off_100BB5248;
*(_QWORD *)(a1 + 352) = off_100BB5270;
*(_QWORD *)(a1 + 408) = off_100BB52A0;
*(_QWORD *)(a1 + 432) = off_100BB5320;
*(_QWORD *)(a1 + 544) = off_100BB5340;
*(_QWORD *)(a1 + 664) = &off_100BB5388;
*(_QWORD *)(a1 + 672) = off_100BB53A0;
*(_QWORD *)(a1 + 1016) = off_100BB53C0;
*(_QWORD *)(a1 + 1024) = &off_100BB53E0;
*(_QWORD *)(a1 + 1032) = off_100BB53F8;
*(_QWORD *)(a1 + 1040) = &off_100BB5450;
if ( !GameLevelManager::sharedState() || *(_QWORD *)(GameLevelManager::sharedState() + 1328) != a1 + 1016 )
{
v2 = *(_DWORD **)(a1 + 1104);
if ( !v2 )
goto LABEL_5;
goto LABEL_4;
}
*(_QWORD *)(GameLevelManager::sharedState() + 1328) = 0;
v2 = *(_DWORD **)(a1 + 1104);
if ( v2 )
LABEL_4:
cocos2d::CCObject::release(v2);
LABEL_5:
v3 = *(_DWORD **)(a1 + 1168);
if ( v3 )
cocos2d::CCObject::release(v3);
v4 = *(_DWORD **)(a1 + 1176);
if ( v4 )
cocos2d::CCObject::release(v4);
if ( (*(_BYTE *)(a1 + 1144) & 1) != 0 )
operator delete(*(void **)(a1 + 1160));
if ( (*(_BYTE *)(a1 + 1120) & 1) != 0 )
operator delete(*(void **)(a1 + 1136));
return SetupTriggerPopup::dSetupTriggerPopup(a1);
}