//
// sub_1800824D0 from 0x1800824d0 to 0x1800825ce (254 bytes)
//
// 2 xrefs:
// > sub_180083740 @ 0x1800837fa
// > ??> @ 0x1801b53f4
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
unsigned __int8 *__fastcall sub_1800824D0(unsigned __int8 *a1)
{
unsigned __int8 *v1; // rdx
__int64 v2; // rdi
__int64 i; // rax
unsigned __int8 *v6; // rax
v1 = nullptr;
v2 = 0;
while ( 1 )
{
for ( i = *a1; (byte_180101290[i] & 1) == 0; ++a1 )
i = a1[1];
if ( (_BYTE)i == 60 )
break;
if ( (_BYTE)i == 13 )
{
*a1++ = 10;
if ( *a1 == 10 )
{
if ( v1 )
memmove(&v1[-v2], v1, a1 - v1);
v1 = ++a1;
++v2;
}
}
else
{
if ( !(_BYTE)i )
{
if ( v1 )
{
memmove(&v1[-v2], v1, a1 - v1);
a1[-v2] = 0;
}
else
{
*a1 = 0;
}
return a1;
}
++a1;
}
}
if ( v1 )
{
memmove(&v1[-v2], v1, a1 - v1);
v6 = &a1[-v2];
}
else
{
v6 = a1;
}
*v6 = 0;
return a1 + 1;
}