//
// sub_1800823D0 from 0x1800823d0 to 0x1800824c3 (243 bytes)
//
// 2 xrefs:
// > sub_180083740 @ 0x1800837f1
// > ??> @ 0x1801b53e8
//
// 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_1800823D0(unsigned __int8 *a1)
{
__int64 i; // rax
void *Src; // [rsp+20h] [rbp-18h] BYREF
__int64 v5; // [rsp+28h] [rbp-10h]
Src = nullptr;
v5 = 0;
while ( 1 )
{
for ( i = *a1; (byte_180101290[i] & 1) == 0; ++a1 )
i = a1[1];
if ( (_BYTE)i == 60 )
break;
if ( (_BYTE)i == 38 )
{
a1 = (unsigned __int8 *)sub_180085450(a1, &Src);
}
else
{
if ( !(_BYTE)i )
{
if ( Src )
{
memmove((char *)Src - v5, Src, a1 - (_BYTE *)Src);
a1[-v5] = 0;
}
else
{
*a1 = 0;
}
return a1;
}
++a1;
}
}
if ( Src )
{
memmove((char *)Src - v5, Src, a1 - (_BYTE *)Src);
a1[-v5] = 0;
}
else
{
*a1 = 0;
}
return a1 + 1;
}