//
// sub_6F9ABC from 0x6f9abc to 0x6f9b80 (196 bytes)
//
// 0 xrefs:
//
// 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_6F9ABC(int *a1, int **a2)
{
int v2; // lr
int *v3; // r5
int v4; // r6
int v5; // r4
int v6; // r3
bool v7; // zf
int v8; // r9
_BOOL4 v9; // r7
int v10; // r1
int v11; // r8
int v12; // r12
int v13; // r2
int v14; // r3
int v15; // r10
int v16; // r11
v2 = a1[26];
if ( !v2 )
return 0;
v3 = *a2;
v4 = a1[3];
v5 = **a2;
v6 = a1[2];
v7 = v5 == 4;
if ( v5 != 4 )
v7 = v5 == 9;
v8 = a1[4];
v9 = v7;
if ( a1[14] )
{
v10 = *a1;
if ( v6 )
{
v12 = v6 - 1;
v11 = a1[4];
v2 -= *a1;
}
else
{
v11 = v8 - 1;
v12 = 0;
}
v13 = a1[21];
v14 = v6 + v13 + v8;
if ( v14 == a1[22] )
v11 = v14 - v13 - v12;
}
else
{
v10 = *a1;
v11 = a1[4];
v12 = a1[2];
}
v15 = v9 ? 0 : 3;
v16 = v3[4] + v12 * v3[5];
if ( !off_AD5158(v2, v10, v4, v11, v15 + v16, v3[5]) || (unsigned int)(v5 - 7) > 3 )
return 0;
off_AD513C(v16, v9, v4, v11, v3[5]);
return 0;
}