//
// sub_18004C4D0 from 0x18004c4d0 to 0x18004c578 (168 bytes)
//
// 7 xrefs:
// > sub_1800338B0 @ 0x180033b32
// > sub_180050A30 @ 0x180050ac5
// > sub_180052A90 @ 0x180052c2f
// > sub_180052E90 @ 0x180053167
// > ??> @ 0x1801816e0
// > ??> @ 0x180181714
// > ??> @ 0x1801f8634
//
// 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_18004C4D0(__int64 a1, __int64 a2)
{
__int64 v4; // rdx
int v5; // edi
__int64 v6; // rcx
__int64 v7; // rsi
__int64 result; // rax
__int64 v9; // rdx
__int64 v10; // rdx
if ( a2 )
{
v4 = *(_QWORD *)a2;
if ( v4 )
{
v5 = 0;
if ( *(int *)(a2 + 16) > 0 )
{
v6 = v4;
v7 = 0;
do
{
if ( *(_QWORD *)(v7 + v4) )
{
sub_180033C90(a1, *(_QWORD *)(v7 + v4));
v4 = *(_QWORD *)a2;
v6 = *(_QWORD *)a2;
}
++v5;
v7 += 8;
}
while ( v5 < *(_DWORD *)(a2 + 16) );
v4 = v6;
}
result = sub_180033C90(a1, v4);
}
v9 = *(_QWORD *)(a2 + 8);
if ( v9 )
result = sub_180033C90(a1, v9);
v10 = *(_QWORD *)(a2 + 24);
if ( v10 )
result = sub_180033C90(a1, v10);
*(_OWORD *)a2 = 0;
*(_OWORD *)(a2 + 16) = 0;
}
return result;
}