//
// sub_1004DA59C from 0x1004da59c to 0x1004da640 (164 bytes)
//
// 5 xrefs:
// > sub_100479448 @ 0x100479638
// > sub_1004DA970 @ 0x1004dada4
// > sub_1004EBDF8 @ 0x1004ebe78
// > sub_1004ED8FC @ 0x1004eda50
// > sub_1004EF568 @ 0x1004ef8a0
//
// 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
//
double __fastcall sub_1004DA59C(__int64 a1, __int64 a2)
{
__int64 v4; // x1
int v5; // w8
__int64 i; // x21
__int64 v7; // x1
__int64 v8; // x1
__int64 v9; // x1
double result; // d0
if ( a2 )
{
v4 = *(_QWORD *)a2;
if ( v4 )
{
v5 = *(_DWORD *)(a2 + 16);
if ( v5 >= 1 )
{
for ( i = 0; i < v5; ++i )
{
v7 = *(_QWORD *)(*(_QWORD *)a2 + 8 * i);
if ( v7 )
{
sub_100478D80(a1, v7);
v5 = *(_DWORD *)(a2 + 16);
}
}
v4 = *(_QWORD *)a2;
}
sub_100478D80(a1, v4);
}
v8 = *(_QWORD *)(a2 + 8);
if ( v8 )
sub_100478D80(a1, v8);
v9 = *(_QWORD *)(a2 + 24);
if ( v9 )
sub_100478D80(a1, v9);
*(_OWORD *)a2 = 0u;
*(_OWORD *)(a2 + 16) = 0u;
return 0.0;
}
return result;
}