//
// sub_71E2D8 from 0x71e2d8 to 0x71e378 (160 bytes)
//
// 2 xrefs:
// > sub_71ED0C @ 0x71f022
// > sub_71ED0C @ 0x71f068
//
// 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_71E2D8(int result, _DWORD *a2)
{
int v2; // r11
_DWORD *v3; // r6
int v4; // r4
int v5; // r10
int v6; // r7
int v7; // r3
bool v8; // cc
int v9; // r5
_BOOL4 v10; // r2
v2 = result;
v3 = a2;
if ( a2 )
{
v4 = a2[1];
v5 = v4 + 8 * a2[2];
}
else
{
v5 = 0;
v4 = 0;
}
v6 = result - 7;
LABEL_4:
while ( v4 )
{
while ( 1 )
{
if ( *(_BYTE *)v4 == 2 )
{
result = *(_DWORD *)(v4 + 4) / v2;
v7 = *(_DWORD *)(v4 + 4) % v2;
v8 = v7 <= 8;
if ( v7 <= 8 )
v8 = result <= 7;
if ( v8 )
{
v9 = byte_A03BE0[16 * result - v7 + 8] + 1;
}
else
{
v9 = *(_DWORD *)(v4 + 4) + 120;
v10 = v7 >= v6;
if ( result > 6 )
v10 = 0;
if ( v10 )
{
result = (int)&byte_A03BE0[16 * result + 16];
v9 = *(unsigned __int8 *)(v2 - v7 + result + 8) + 1;
}
}
*(_DWORD *)(v4 + 4) = v9;
}
v4 += 8;
if ( v5 != v4 )
break;
v3 = (_DWORD *)*v3;
if ( !v3 )
{
v4 = 0;
v5 = 0;
goto LABEL_4;
}
v4 = v3[1];
v5 = v4 + 8 * v3[2];
if ( !v4 )
return result;
}
}
return result;
}