//
// sub_10051116C from 0x10051116c to 0x100511234 (200 bytes)
//
// 1 xrefs:
// > ??> @ 0x1008588a8
//
// 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_10051116C(__int64 *a1)
{
__int64 v1; // x19
unsigned int *v2; // x8
unsigned int v3; // w9
__int64 v4; // x8
__int64 i; // x20
__int64 result; // x0
__int64 v7; // x8
v1 = *a1;
*(_DWORD *)(v1 + 536) = 1065353216;
*(_DWORD *)(v1 + 544) = 1065353216;
*(_DWORD *)(v1 + 600) = -1;
*(_BYTE *)(v1 + 604) = 0;
*(_QWORD *)(v1 + 552) = 0x3F800000FFFFFFFFLL;
v2 = (unsigned int *)(v1 + 100);
do
v3 = __ldaxr(v2);
while ( __stlxr(v3 | 0x10, v2) );
v4 = *(_QWORD *)(v1 + 232);
if ( *(int *)(v4 + 96) >= 1 )
{
for ( i = 0; i < *(int *)(v4 + 96); ++i )
{
v7 = *(_QWORD *)(*(_QWORD *)(v4 + 104) + 8 * i);
if ( *(_DWORD *)v7 )
{
if ( *(_DWORD *)v7 == 1 )
{
result = sub_1004A7A60(v1, i);
if ( (_DWORD)result )
return result;
}
}
else
{
result = sub_1004A79E0(v1, i, *(float *)(v7 + 56));
if ( (_DWORD)result )
return result;
}
v4 = *(_QWORD *)(v1 + 232);
}
}
return 0;
}