//
// sub_1005ED5E8 from 0x1005ed5e8 to 0x1005ed660 (120 bytes)
//
// 1 xrefs:
// > sub_100565B84 @ 0x1005671dc
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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:09:46 +0000
//
_BYTE *__fastcall sub_1005ED5E8(_BYTE *result, int a2, _BYTE *a3)
{
unsigned int v3; // w11
bool v4; // cc
__int64 v5; // x8
unsigned __int8 *v6; // x10
int v7; // w12
int v8; // w13
unsigned int v9; // t1
bool v10; // cc
v3 = (unsigned __int8)*a3;
if ( *a3 )
v4 = a2 < 3;
else
v4 = 1;
if ( v4 )
{
*result = 0;
}
else
{
LODWORD(v5) = 0;
v6 = a3 + 1;
do
{
if ( (v3 & 0x80) != 0 )
{
v7 = v5 + 1;
result[(unsigned int)v5] = (v3 >> 6) | 0xC0;
v8 = 2;
LOBYTE(v3) = v3 & 0x3F | 0x80;
}
else
{
v8 = 1;
v7 = v5;
}
v5 = (unsigned int)(v5 + v8);
result[v7] = v3;
v9 = *v6++;
v3 = v9;
if ( v9 )
v10 = (int)v5 < a2 - 2;
else
v10 = 0;
}
while ( v10 );
result[v5] = 0;
}
return result;
}