//
// sub_70EE0C from 0x70ee0c to 0x70ee9c (144 bytes)
//
// 3 xrefs:
// > sub_6FE948 @ 0x6feb44
// > sub_6FE948 @ 0x6feb7c
// > sub_6FE948 @ 0x6fef26
//
// 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
//
_DWORD *__fastcall sub_70EE0C(_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_AD50D0(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;
}