//
// sub_86C1C8 from 0x86c1c8 to 0x86c25c (148 bytes)
//
// 0 xrefs:
//
// 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:02:54 +0000
//
signed int __fastcall sub_86C1C8(signed int result, _BYTE *a2, char *a3)
{
int v3; // r7
_BYTE *v4; // lr
char *v5; // r5
_BYTE *v6; // r3
char v7; // t1
_BYTE *v8; // r12
int v9; // r7
unsigned __int8 *v10; // lr
unsigned __int8 *v11; // r7
int v12; // r3
int v13; // t1
int v14; // r5
int v15; // t1
char v16; // r10
int v17; // t1
signed int v18; // r6
int v19; // r9
signed int v20; // r4
v3 = (*(unsigned __int8 *)(result + 11) + 7) >> 3;
v4 = &a2[v3];
if ( a2 < &a2[v3] )
{
v5 = a3;
v6 = a2;
do
{
v7 = *v5++;
*v6++ += v7;
}
while ( v6 != v4 );
a3 += v3;
a2 += v3;
}
v8 = &v4[*(_DWORD *)(result + 4) - v3];
if ( v8 > a2 )
{
v9 = -v3;
v10 = (unsigned __int8 *)&a3[v9];
v11 = &a2[v9];
do
{
v13 = *v10++;
v12 = v13;
v15 = (unsigned __int8)*a3++;
v14 = v15;
v17 = *v11++;
v16 = v17;
v18 = abs32(v14 - v12);
v19 = v14 - v12 + v17 - v12;
result = abs32(v17 - v12);
if ( v18 <= result )
LOBYTE(v14) = v16;
v20 = abs32(v19);
if ( result >= v18 )
result = v18;
if ( result <= v20 )
LOBYTE(v12) = v14;
*a2++ += v12;
}
while ( a2 != v8 );
}
return result;
}