//
// sub_1004125BC from 0x1004125bc to 0x100412648 (140 bytes)
//
// 1 xrefs:
// > sub_10041245C @ 0x100412554
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
_DWORD *__fastcall sub_1004125BC(__int64 a1, int *a2)
{
_DWORD *v4; // x20
int v5; // w8
_QWORD *v6; // x1
__int64 *v7; // x9
_QWORD *v8; // x2
v4 = operator new(0x20u);
v5 = *a2;
v4[7] = *a2;
v6 = (_QWORD *)(a1 + 8);
v7 = *(__int64 **)(a1 + 8);
if ( v7 )
{
do
{
while ( 1 )
{
v6 = v7;
if ( v5 >= *((_DWORD *)v7 + 7) )
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;
}