//
// sub_DC090C from 0xdc090c to 0xdc0a7c (368 bytes)
//
// 2 xrefs:
// > sub_DCBC04 @ 0xdcbf78
// > sub_DCBC04 @ 0xdccbb0
//
// 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
//
_BYTE *__fastcall sub_DC090C(unsigned __int8 *a1)
{
char *v1; // x1
_BYTE *v2; // x22
_BYTE *v3; // x19
__int64 v4; // x21
int v5; // w0
_BYTE *v6; // x23
__int64 v7; // x21
size_t v8; // x2
__int64 v10; // x21
_BYTE *v11; // x1
v1 = nullptr;
v2 = a1;
v3 = a1;
v4 = 0;
v5 = *a1;
while ( 1 )
{
if ( (byte_11AECC0[v5] & 1) == 0 )
goto LABEL_3;
if ( v5 == 60 )
break;
if ( v5 == 13 )
{
v5 = (unsigned __int8)v3[1];
*v3 = 10;
if ( v5 == 10 )
{
if ( v1 )
memmove(&v1[-v4], v1, v3 + 1 - v1);
v1 = v3 + 2;
v5 = (unsigned __int8)v3[2];
++v4;
v3 += 2;
}
else
{
++v3;
}
}
else
{
if ( !v5 )
{
if ( v1 )
{
v10 = -v4;
memmove(&v1[v10], v1, v3 - v1);
v11 = &v3[v10];
}
else
{
v11 = v3;
}
if ( v2 < v11 )
{
while ( (byte_11AECC0[(unsigned __int8)*(v11 - 1)] & 8) != 0 )
{
if ( --v11 == v2 )
goto LABEL_27;
}
}
v2 = v11;
LABEL_27:
*v2 = 0;
return v3;
}
LABEL_3:
v5 = (unsigned __int8)*++v3;
}
}
v6 = v3;
if ( v1 )
{
v7 = -v4;
v8 = v3 - v1;
v3 += v7;
memmove(&v1[v7], v1, v8);
}
if ( v2 < v3 )
{
while ( (byte_11AECC0[(unsigned __int8)*(v3 - 1)] & 8) != 0 )
{
if ( --v3 == v2 )
goto LABEL_16;
}
}
v2 = v3;
LABEL_16:
*v2 = 0;
return v6 + 1;
}