//
// sub_1004A8CD4 from 0x1004a8cd4 to 0x1004a8df4 (288 bytes)
//
// 1 xrefs:
// > sub_1004CFA1C @ 0x1004cfebc
//
// 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_1004A8CD4(__int64 *a1, int *a2, __int64 a3)
{
__int64 result; // x0
__int64 v5; // x8
int v6; // w10
__int64 v7; // x9
__int64 v8; // x10
__int64 v9; // x11
__int64 *v10; // x12
__int64 v11; // x13
__int64 v12; // x13
__int64 v13; // x13
__int64 v14; // x13
result = 31;
if ( a1 && a2 && a3 )
{
v5 = *a1;
if ( v5 && (v6 = *a2, *a2 >= 1) )
{
v7 = *(_QWORD *)(v5 + 168);
if ( v7 )
{
if ( v6 >= *(_DWORD *)(v7 + 69104) )
v6 = *(_DWORD *)(v7 + 69104);
*a2 = v6;
if ( v6 >= 1 )
{
v8 = 0;
v9 = a3 + 24;
v10 = (__int64 *)(v7 + 68256);
do
{
v11 = *(v10 - 6);
*(_DWORD *)(v9 - 16) = *((_DWORD *)v10 - 10);
*(_QWORD *)(v9 - 24) = v11;
v12 = *(v10 - 3);
*(_DWORD *)(v9 - 4) = *((_DWORD *)v10 - 4);
*(_QWORD *)(v9 - 12) = v12;
v13 = v10[3];
*(_DWORD *)(v9 + 8) = *((_DWORD *)v10 + 8);
*(_QWORD *)v9 = v13;
v14 = *v10;
*(_DWORD *)(v9 + 20) = *((_DWORD *)v10 + 2);
*(_QWORD *)(v9 + 12) = v14;
if ( (*(_BYTE *)(v7 + 120) & 4) != 0 && **(_DWORD **)(v5 + 232) >= 0x6Du )
{
*(float *)(v9 - 16) = -*(float *)(v9 - 16);
*(float *)(v9 - 4) = -*(float *)(v9 - 4);
*(float *)(v9 + 8) = -*(float *)(v9 + 8);
*(float *)(v9 + 20) = -*(float *)(v9 + 20);
}
++v8;
v9 += 48;
v10 += 14;
}
while ( v8 < *a2 );
}
return 0;
}
else
{
return 28;
}
}
else
{
return 31;
}
}
return result;
}