//
// sub_70AA58 from 0x70aa58 to 0x70aa88 (48 bytes)
//
// 1 xrefs:
// > sub_70B438 @ 0x70b6f2
//
// 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
//
int __fastcall sub_70AA58(int a1, int *a2)
{
int v2; // r3
int result; // r0
int v4; // r2
int v5; // r5
int v6; // r4
int v7; // t1
int v8; // r6
v2 = 0;
result = a1 - 4;
v4 = 0;
v5 = 1;
do
{
v7 = *(_DWORD *)(result + 4);
result += 4;
v6 = v7;
v8 = v4;
if ( v4 < v7 )
v8 = v6;
if ( v6 > 0 )
v5 = v2;
++v2;
if ( v6 > 0 )
v4 = v8;
}
while ( v2 != 32 );
*a2 = v4;
a2[1] = v5;
return result;
}