//
// sub_1004C62C4 from 0x1004c62c4 to 0x1004c6350 (140 bytes)
//
// 5 xrefs:
// > sub_10046F2E0 @ 0x10046f360
// > sub_1004705CC @ 0x10047064c
// > sub_10047F0F0 @ 0x10047f178
// > sub_10047FEDC @ 0x10047ff64
// > sub_1004FBA38 @ 0x1004fbac4
//
// 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
//
__int64 __fastcall sub_1004C62C4(__int64 a1)
{
bool v2; // cc
__int64 v4; // x20
__int64 v5; // [xsp+0h] [xbp-20h] BYREF
int v6; // [xsp+Ch] [xbp-14h] BYREF
v6 = 0;
if ( (*(unsigned int (__fastcall **)(__int64, int *))(*(_QWORD *)a1 + 232LL))(a1, &v6) )
v2 = 1;
else
v2 = v6 < 1;
if ( !v2 )
{
v4 = 0;
do
{
if ( !(*(unsigned int (__fastcall **)(__int64, __int64, __int64 *))(*(_QWORD *)a1 + 240LL))(a1, v4, &v5) )
*(_WORD *)(v5 + 50) = v4;
v4 = (unsigned int)(v4 + 1);
}
while ( (int)v4 < v6 );
}
return 0;
}