//
// sub_1002CC120 from 0x1002cc120 to 0x1002cc1ac (140 bytes)
//
// 1 xrefs:
// > sub_1002CBFB8 @ 0x1002cc0b8
//
// This function is hookable on this platform (idp: arm, 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 11:02:35 +0000
//
_QWORD *__fastcall sub_1002CC120(__int64 a1, __int64 *a2)
{
_QWORD *v4; // x20
__int64 v5; // x8
_QWORD *v6; // x1
__int64 *v7; // x9
_QWORD *v8; // x2
v4 = operator new(0x28u);
v5 = *a2;
*(_QWORD *)((char *)v4 + 28) = *a2;
v6 = (_QWORD *)(a1 + 8);
v7 = *(__int64 **)(a1 + 8);
if ( v7 )
{
do
{
while ( 1 )
{
v6 = v7;
if ( *((_DWORD *)v7 + 7) <= (int)v5 )
break;
v7 = (__int64 *)*v7;
v8 = v6;
if ( !*v6 )
goto LABEL_8;
}
v7 = (__int64 *)v7[1];
}
while ( v7 );
v8 = v6 + 1;
}
else
{
v8 = (_QWORD *)(a1 + 8);
}
LABEL_8:
sub_10000A0F0((__int64 **)a1, (__int64)v6, v8, v4);
return v4;
}