//
// sub_DC46AC from 0xdc46ac to 0xdc4838 (396 bytes)
//
// 2 xrefs:
// > sub_DCBC04 @ 0xdcbf78
// > sub_DCBC04 @ 0xdccb80
//
// 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:49 +0000
//
_BYTE *__fastcall sub_DC46AC(unsigned __int8 *a1)
{
_BYTE *v1; // x19
int v2; // w1
_BYTE *v3; // x0
_BYTE *v5; // x0
void *v6; // [xsp+48h] [xbp+48h] BYREF
__int64 v7; // [xsp+50h] [xbp+50h]
v1 = a1;
v6 = nullptr;
v7 = 0;
v2 = *a1;
LABEL_2:
if ( (byte_11AECC0[v2] & 1) != 0 )
{
if ( v2 != 60 )
goto LABEL_4;
}
else
{
while ( 1 )
{
do
v2 = (unsigned __int8)*++v1;
while ( (byte_11AECC0[v2] & 1) == 0 );
if ( v2 == 60 )
break;
LABEL_4:
switch ( v2 )
{
case 13:
v2 = (unsigned __int8)v1[1];
*v1 = 10;
if ( v2 == 10 )
{
if ( v6 )
memmove((char *)v6 - v7, v6, v1 + 1 - (_BYTE *)v6);
v6 = v1 + 2;
++v7;
v2 = (unsigned __int8)v1[2];
v1 += 2;
}
else
{
++v1;
}
goto LABEL_2;
case 38:
v1 = sub_DC38F4(v1, (const void **)&v6);
v2 = (unsigned __int8)*v1;
goto LABEL_2;
case 0:
if ( v6 )
{
memmove((char *)v6 - v7, v6, v1 - (_BYTE *)v6);
v5 = &v1[-v7];
}
else
{
v5 = v1;
}
*v5 = 0;
return v1;
}
}
}
if ( v6 )
{
memmove((char *)v6 - v7, v6, v1 - (_BYTE *)v6);
v3 = &v1[-v7];
}
else
{
v3 = v1;
}
*v3 = 0;
return v1 + 1;
}