//
// sub_1005B8E0C from 0x1005b8e0c to 0x1005b8f38 (300 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:09:15 +0000
//
__int64 __fastcall sub_1005B8E0C(__int64 a1)
{
__int64 v2; // x8
__int64 v3; // x20
__int64 result; // x0
float v5; // s0
float v6; // s1
float v7; // s3
v2 = *(_QWORD *)(a1 + 232);
if ( *(int *)(v2 + 96) < 1 )
{
LABEL_5:
*(_OWORD *)(a1 + 764) = 0u;
*(_OWORD *)(a1 + 780) = 0u;
*(_OWORD *)(a1 + 732) = 0u;
*(_OWORD *)(a1 + 748) = 0u;
*(_OWORD *)(a1 + 700) = 0u;
*(_OWORD *)(a1 + 716) = 0u;
*(_OWORD *)(a1 + 668) = 0u;
*(_OWORD *)(a1 + 684) = 0u;
*(_OWORD *)(a1 + 636) = 0u;
*(_OWORD *)(a1 + 652) = 0u;
*(_OWORD *)(a1 + 604) = 0u;
*(_OWORD *)(a1 + 620) = 0u;
*(_OWORD *)(a1 + 572) = 0u;
*(_OWORD *)(a1 + 588) = 0u;
v5 = 1.0;
*(_OWORD *)(a1 + 540) = 0u;
*(_OWORD *)(a1 + 556) = 0u;
v6 = *(float *)(a1 + 800);
*(float *)(a1 + 536) = v6;
if ( v6 < 22000.0 )
{
v7 = (float)*(int *)(*(_QWORD *)(a1 + 168) + 1744LL);
if ( (float)(v7 / 3.1416) >= v6 )
v5 = (float)(1.0 / v7) / (float)((float)(1.0 / (float)(v6 * 6.2832)) + (float)(1.0 / v7));
else
v5 = (float)((float)(v6 - (float)(v7 / 3.1416)) / (float)((float)(22000.0 - (float)(v7 / 3.1416)) * 3.0))
+ 0.66667;
}
*(float *)(a1 + 796) = v5;
return 0;
}
else
{
v3 = 0;
while ( 1 )
{
result = sub_1005CDB48(a1, v3, *(float *)(*(_QWORD *)(*(_QWORD *)(v2 + 104) + 8 * v3) + 56LL));
if ( (_DWORD)result )
break;
++v3;
v2 = *(_QWORD *)(a1 + 232);
if ( v3 >= *(int *)(v2 + 96) )
goto LABEL_5;
}
}
return result;
}