//
// sub_DC0C9C from 0xdc0c9c to 0xdc0df4 (344 bytes)
//
// 2 xrefs:
// > sub_DCBC04 @ 0xdcc65c
// > sub_DCBC04 @ 0xdcc308
//
// 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 13:08:47 +0000
//
unsigned __int8 *__fastcall sub_DC0C9C(unsigned __int8 *a1, unsigned __int8 a2)
{
unsigned __int8 *v2; // x19
int v3; // w21
int v4; // w3
unsigned __int8 v5; // w0
unsigned __int8 *v6; // x1
int v7; // t1
__int64 v8; // x22
unsigned __int8 *v9; // x2
__int64 v10; // x0
int v11; // t1
unsigned __int8 *v12; // x24
unsigned __int8 *v14; // x21
__int64 v15; // x22
size_t v16; // x2
v2 = a1;
v3 = a2;
v4 = *a1;
v5 = byte_11AECC0[*a1];
if ( (v5 & 8) != 0 )
{
v6 = v2;
do
{
v7 = *++v6;
v4 = v7;
v5 = byte_11AECC0[v7];
}
while ( (v5 & 8) != 0 );
v8 = v6 - v2;
v2 = v6;
}
else
{
v8 = 0;
v6 = nullptr;
}
LABEL_5:
while ( (v5 & 0xC) == 0 )
{
LABEL_14:
v4 = *++v2;
v5 = byte_11AECC0[v4];
}
while ( 1 )
{
if ( v3 == v4 )
{
v14 = v2;
if ( v6 )
{
v15 = -v8;
v16 = v2 - v6;
v2 += v15;
memmove(&v6[v15], v6, v16);
}
do
*v2-- = 0;
while ( (byte_11AECC0[*v2] & 8) != 0 );
return v14 + 1;
}
if ( (v5 & 8) == 0 )
break;
v4 = v2[1];
*v2 = 32;
v9 = v2 + 1;
v5 = byte_11AECC0[v4];
if ( (v5 & 8) == 0 )
{
++v2;
goto LABEL_5;
}
v10 = v2[2];
v2 += 2;
if ( (byte_11AECC0[v10] & 8) != 0 )
{
do
v11 = *++v2;
while ( (byte_11AECC0[v11] & 8) != 0 );
}
v12 = (unsigned __int8 *)(v2 - v9);
if ( v6 )
memmove(&v6[-v8], v6, v9 - v6);
v4 = *v2;
v8 += (__int64)v12;
v6 = v2;
v5 = byte_11AECC0[*v2];
if ( (v5 & 0xC) == 0 )
goto LABEL_14;
}
if ( v4 )
goto LABEL_14;
return nullptr;
}