//
// sub_80FE5C from 0x80fe5c to 0x80ff18 (188 bytes)
//
// 1 xrefs:
// > sub_81406C @ 0x81480a
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:01:36 +0000
//
int __fastcall sub_80FE5C(unsigned __int8 *a1, int a2)
{
unsigned __int8 *v3; // r2
int v4; // t1
_BYTE *v5; // r1
int result; // r0
unsigned __int8 *v7; // r0
int v8; // r1
unsigned __int8 *v9; // r2
int v10[2]; // [sp+4h] [bp-18h] BYREF
_DWORD v11[2]; // [sp+Ch] [bp-10h] BYREF
v10[0] = (int)a1;
v11[0] = 0;
v11[1] = 0;
if ( (a7[*a1] & 8) != 0 )
{
v3 = a1;
do
v4 = *++v3;
while ( (a7[v4] & 8) != 0 );
sub_80FE34(v11, v10, v3 - a1);
}
while ( 1 )
{
v5 = (_BYTE *)v10[0];
result = *(unsigned __int8 *)v10[0];
if ( (a7[result] & 0xC) == 0 )
goto LABEL_6;
if ( result == a2 )
break;
if ( (a7[result] & 8) != 0 )
{
++v10[0];
*v5 = 32;
if ( (a7[*(unsigned __int8 *)v10[0]] & 8) != 0 )
{
v8 = v10[0] + 1;
do
v9 = (unsigned __int8 *)v8++;
while ( (a7[*v9] & 8) != 0 );
sub_80FE34(v11, v10, (int)&v9[-v10[0]]);
}
}
else
{
if ( !*(_BYTE *)v10[0] )
return result;
LABEL_6:
++v10[0];
}
}
v7 = (unsigned __int8 *)sub_80FCC2((int)v11, v10[0]);
do
*v7-- = 0;
while ( (a7[*v7] & 8) != 0 );
return v10[0] + 1;
}