//
// sub_F9158 from 0xf9158 to 0xf91d8 (128 bytes)
//
// 5 xrefs:
// > sub_9D010 @ 0x9d388
// > sub_F9158 @ 0xf91c8
// > sub_F9638 @ 0xf966c
// > sub_F9B54 @ 0xf9da0
// > sub_FAF58 @ 0xfaf60
//
// 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_F9158(__int64 a1)
{
__int64 v1; // x19
int v2; // w1
int v3; // w8
int v4; // w22
__int64 v5; // x20
unsigned int i; // w21
if ( *(int *)(a1 + 128) < 2 )
return -131;
sub_FB02C();
if ( !v3 )
return -131;
v4 = *(_DWORD *)(v1 + 64);
if ( v4 <= v2 )
return -131;
if ( (v2 & 0x80000000) == 0 )
return *(_QWORD *)(*(_QWORD *)(v1 + 96) + 8LL * ((2 * v2) | 1));
v5 = 0;
for ( i = 0; (int)i < v4; ++i )
v5 += sub_F9158(v1, i);
return v5;
}