//
// sub_1008BEA00 from 0x1008bea00 to 0x1008beb57 (343 bytes)
//
// 2 xrefs:
// > sub_1008BEB70 @ 0x1008beb75
// > sub_1008BEB80 @ 0x1008beb89
//
// 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:28 +0000
//
__int64 __fastcall sub_1008BEA00(_QWORD *a1)
{
__int64 v2; // rdi
__int64 v3; // rax
__int64 v4; // r14
unsigned __int64 v5; // r12
__int64 v6; // rdi
__int64 v7; // rdi
_DWORD *v8; // rdi
_DWORD *v9; // rdi
_QWORD *v10; // r14
void *v11; // rdi
void *v12; // rdi
_QWORD *v14; // r15
void *v15; // rdi
*a1 = off_100BAF878;
v2 = a1[52];
if ( v2 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v2 + 520LL))(v2);
cocos2d::CCObject::release((_DWORD *)a1[52]);
}
v3 = a1[40];
if ( a1[41] != v3 )
{
v4 = 0;
v5 = 0;
do
{
v6 = *(_QWORD *)(v3 + v4 + 64);
if ( v6 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v6 + 736LL))(v6);
v3 = a1[40];
}
v7 = *(_QWORD *)(v3 + v4 + 72);
if ( v7 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v7 + 736LL))(v7);
v3 = a1[40];
}
v8 = *(_DWORD **)(v3 + v4 + 64);
if ( v8 )
{
cocos2d::CCObject::release(v8);
v3 = a1[40];
}
v9 = *(_DWORD **)(v3 + v4 + 72);
if ( v9 )
{
cocos2d::CCObject::release(v9);
v3 = a1[40];
}
++v5;
v4 += 80;
}
while ( v5 < 0xCCCCCCCCCCCCCCCDLL * ((a1[41] - v3) >> 4) );
}
v10 = (_QWORD *)a1[45];
if ( v10 )
{
do
{
v14 = (_QWORD *)*v10;
v15 = (void *)v10[3];
if ( v15 )
{
v10[4] = v15;
operator delete(v15);
}
operator delete(v10);
v10 = v14;
}
while ( v14 );
}
v11 = (void *)a1[43];
a1[43] = 0;
if ( v11 )
operator delete(v11);
v12 = (void *)a1[40];
if ( v12 )
{
a1[41] = v12;
operator delete(v12);
}
return cocos2d::CCNode::dCCNode((__int64)a1);
}