//
// sub_86900 from 0x86900 to 0x86994 (148 bytes)
//
// 1 xrefs:
// > sub_874A4 @ 0x87818
//
// 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 11:41:20 +0000
//
int __fastcall sub_86900(int a1)
{
int v1; // r1
unsigned int v2; // r2
int v3; // r4
int *v4; // r3
unsigned int v5; // r5
unsigned int v6; // r4
int v7; // r4
char v8; // r2
v1 = *(_DWORD *)(a1 + 4);
v2 = *(char *)(a1 + 234);
switch ( (*(unsigned __int8 *)(a1 + 262) >> 4) & 3 )
{
case 0:
case 3:
v3 = byte_E8004[v2 & 0x1F];
break;
case 1:
v3 = (unsigned __int8)((8 * v2) ^ (v2 >> 7));
break;
case 2:
v3 = 255;
break;
}
*(_DWORD *)(v1 + 52) = v3;
v4 = (int *)(v1 + 52);
v5 = ((unsigned int)*(unsigned __int8 *)(a1 + 236) * v3) >> 6;
*(_DWORD *)(v1 + 52) = v5;
v6 = *(_DWORD *)(v1 + 44);
if ( (v2 & 0x80u) != 0 )
{
if ( ((v6 - v5) & 0x8000) != 0 )
{
*v4 = v6;
v5 = v6;
}
v7 = -v5;
}
else
{
if ( (int)(v5 + v6) < 65 )
goto LABEL_12;
v7 = 64 - v6;
}
*v4 = v7;
LABEL_12:
v8 = v2 + *(_BYTE *)(a1 + 235);
if ( v8 > 31 )
v8 -= 64;
*(_BYTE *)(a1 + 234) = v8;
*(_BYTE *)(v1 + 36) |= 2u;
return 0;
}