//
// sub_91E9CC from 0x91e9cc to 0x91ea5c (144 bytes)
//
// 3 xrefs:
// > sub_90E508 @ 0x90e704
// > sub_90E508 @ 0x90e73c
// > sub_90E508 @ 0x90eae6
//
// 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:04:39 +0000
//
_DWORD *__fastcall sub_91E9CC(_DWORD *result, int a2, int a3, unsigned __int8 *a4, _BYTE *a5)
{
int v5; // r5
int v7; // r9
int v8; // lr
int v9; // r1
_BYTE *v10; // r7
int v11; // r10
_BYTE *v12; // r4
unsigned int v13; // r6
int v14; // r5
v5 = result[1];
v7 = result[2];
v8 = 8 >> v5;
v9 = result[4];
v10 = a5;
if ( 8 >> v5 > 7 )
return (_DWORD *)off_D36358(a4, v9, a5, a2, a3, v7);
v11 = (1 << v5) - 1;
if ( a2 < a3 )
{
do
{
if ( v7 > 0 )
{
result = &v10[v7];
v12 = v10;
v13 = 0;
do
{
if ( (v11 & (v12 - v10)) == 0 )
v13 = *a4++;
v14 = v13 & ((1 << v8) - 1);
v13 >>= v8;
*v12++ = BYTE1(*(_DWORD *)(v9 + 4 * v14));
}
while ( v12 != (_BYTE *)result );
v10 = v12;
}
++a2;
}
while ( a2 != a3 );
}
return result;
}