//
// sub_10040EAF0 from 0x10040eaf0 to 0x10040ebaa (186 bytes)
//
// 2 xrefs:
// > sub_10040EBC0 @ 0x10040ebc5
// > sub_10040EBD0 @ 0x10040ebd9
//
// 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:30:08 +0000
//
__int64 __fastcall sub_10040EAF0(__int64 a1)
{
__int64 v2; // rdi
__int64 v3; // rdi
__int64 v4; // rdi
__int64 v5; // rdi
__int64 v6; // rdi
__int64 v7; // rdi
__int64 v8; // rdi
*(_QWORD *)a1 = off_100B3E8C0;
v2 = *(_QWORD *)(a1 + 56);
if ( v2 )
cocos2d::CCObject::release(v2);
v3 = *(_QWORD *)(a1 + 64);
if ( v3 )
cocos2d::CCObject::release(v3);
v4 = *(_QWORD *)(a1 + 72);
if ( v4 )
cocos2d::CCObject::release(v4);
v5 = *(_QWORD *)(a1 + 80);
if ( v5 )
cocos2d::CCObject::release(v5);
v6 = *(_QWORD *)(a1 + 88);
if ( v6 )
cocos2d::CCObject::release(v6);
v7 = *(_QWORD *)(a1 + 96);
if ( v7 )
cocos2d::CCObject::release(v7);
v8 = *(_QWORD *)(a1 + 104);
if ( v8 )
cocos2d::CCObject::release(v8);
if ( (*(_BYTE *)(a1 + 168) & 1) != 0 )
operator delete(*(void **)(a1 + 184));
if ( (*(_BYTE *)(a1 + 144) & 1) != 0 )
operator delete(*(void **)(a1 + 160));
sub_100416590(a1 + 112, *(_QWORD *)(a1 + 120));
return sub_10047FF60(a1);
}