//
// sub_1004EBDF8 from 0x1004ebdf8 to 0x1004ebf30 (312 bytes)
//
// 4 xrefs:
// > sub_100478E90 @ 0x100478ea0
// > sub_100479428 @ 0x100479438
// > sub_1004EBF30 @ 0x1004ec120
// > sub_1004EC14C @ 0x1004ec298
//
// 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_1004EBDF8(__int64 a1, int *a2)
{
__int64 v4; // x1
int v5; // w8
__int64 v6; // x21
__int64 v7; // x22
__int64 v8; // x23
__int64 v9; // x1
__int64 v10; // x1
__int64 v11; // x1
__int64 v12; // x1
void (*v13)(void); // x8
if ( a2 )
{
sub_10042CB4C(a1, (__int64)(a2 + 162));
sub_10042CBAC(a1, (__int64 *)a2 + 66);
sub_1004D9740(a1, (__int64)(a2 + 38));
v4 = *((_QWORD *)a2 + 13);
if ( v4 )
{
v5 = a2[16];
if ( v5 )
{
if ( v5 >= 1 )
{
v6 = 0;
v7 = 0;
v8 = 0;
do
{
sub_1004DA69C(a1, *((_QWORD *)a2 + 13) + v6);
sub_1004DA59C(a1, *((_QWORD *)a2 + 14) + v7);
++v8;
v7 += 32;
v6 += 40;
}
while ( v8 < a2[16] );
v4 = *((_QWORD *)a2 + 13);
}
sub_100478D80(a1, v4);
sub_100478D80(a1, *((_QWORD *)a2 + 14));
}
}
v9 = *((_QWORD *)a2 + 10);
if ( v9 )
sub_100478D80(a1, v9);
v10 = *((_QWORD *)a2 + 12);
if ( v10 )
sub_100478D80(a1, v10);
v11 = *((_QWORD *)a2 + 11);
if ( v11 )
sub_100478D80(a1, v11);
v12 = *((_QWORD *)a2 + 9);
if ( v12 )
sub_100478D80(a1, v12);
sub_1004D9970(a1, (__int64)(a2 + 8));
if ( *(_QWORD *)a2 )
{
v13 = *((void (**)(void))a2 + 100);
if ( v13 )
v13();
}
bzero(a2, 0x330u);
}
return 0;
}