//
// sub_180083E60 from 0x180083e60 to 0x180083f29 (201 bytes)
//
// 2 xrefs:
// > sub_180083740 @ 0x18008379d
// > ??> @ 0x1801b54d8
//
// 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
//
_BYTE *__fastcall sub_180083E60(_BYTE *a1, char a2)
{
char *v3; // rdx
__int64 v5; // rdi
__int64 v6; // rcx
__int64 v7; // rax
_BYTE *v9; // rax
v3 = nullptr;
v5 = 0;
while ( 1 )
{
v6 = (unsigned __int8)*a1;
if ( (byte_180101290[v6] & 4) == 0 )
{
do
v7 = (unsigned __int8)*++a1;
while ( (byte_180101290[v7] & 4) == 0 );
LOBYTE(v6) = v7;
}
if ( (_BYTE)v6 == a2 )
break;
if ( (byte_180101290[(unsigned __int8)v6] & 8) != 0 )
{
*a1++ = 32;
if ( (_BYTE)v6 == 13 && *a1 == 10 )
{
if ( v3 )
memmove(&v3[-v5], v3, a1 - v3);
v3 = ++a1;
++v5;
}
}
else
{
if ( !(_BYTE)v6 )
return nullptr;
++a1;
}
}
if ( v3 )
{
memmove(&v3[-v5], v3, a1 - v3);
v9 = &a1[-v5];
}
else
{
v9 = a1;
}
*v9 = 0;
return a1 + 1;
}