//
// sub_DC0718 from 0xdc0718 to 0xdc0808 (240 bytes)
//
// 2 xrefs:
// > sub_DCBC04 @ 0xdcc65c
// > sub_DCBC04 @ 0xdccc78
//
// 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_DC0718(unsigned __int8 *a1, unsigned __int8 a2)
{
int v2; // w21
_BYTE *v3; // x19
__int64 v4; // x22
char *v5; // x1
int v6; // w3
__int64 v7; // x22
char *v8; // x0
_BYTE *v9; // x22
v2 = a2;
v3 = a1;
v4 = 0;
v5 = nullptr;
v6 = *a1;
while ( 1 )
{
if ( (byte_11AECC0[v6] & 2) == 0 )
goto LABEL_3;
if ( v2 == v6 )
break;
if ( v6 == 13 )
{
v6 = (unsigned __int8)v3[1];
*v3 = 10;
if ( v6 == 10 )
{
if ( v5 )
memmove(&v5[-v4], v5, v3 + 1 - v5);
v5 = v3 + 2;
v6 = (unsigned __int8)v3[2];
++v4;
v3 += 2;
}
else
{
++v3;
}
}
else
{
if ( !v6 )
return nullptr;
LABEL_3:
v6 = (unsigned __int8)*++v3;
}
}
if ( v5 )
{
v7 = -v4;
v8 = &v5[v7];
v9 = &v3[v7];
memmove(v8, v5, v3 - v5);
}
else
{
v9 = v3;
}
*v9 = 0;
return v3 + 1;
}