//
// sub_180086EF0 from 0x180086ef0 to 0x180086ffa (266 bytes)
//
// 2 xrefs:
// > sub_180086730 @ 0x180086796
// > ??> @ 0x1801bf784
//
// This function is hookable on this platform (idp: pc, 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 11:22:04 +0000
//
char *__fastcall sub_180086EF0(char *a1, char a2)
{
char *v3; // rdx
__int64 v5; // rdi
__int64 v6; // rcx
__int64 v7; // rax
__int64 v8; // rax
char *v10; // rax
char *v11; // [rsp+20h] [rbp-18h] BYREF
__int64 v12; // [rsp+28h] [rbp-10h]
v3 = nullptr;
v11 = nullptr;
v5 = 0;
v12 = 0;
while ( 1 )
{
v6 = (unsigned __int8)*a1;
if ( (byte_1801079B0[v6] & 4) == 0 )
{
do
v7 = (unsigned __int8)*++a1;
while ( (byte_1801079B0[v7] & 4) == 0 );
LOBYTE(v6) = v7;
}
if ( (_BYTE)v6 == a2 )
break;
if ( (byte_1801079B0[(unsigned __int8)*a1] & 8) != 0 )
{
*a1++ = 32;
if ( (_BYTE)v6 == 13 && *a1 == 10 )
{
if ( v3 )
memmove(&v3[-v5], v3, a1 - v3);
++a1;
++v5;
v11 = a1;
v12 = v5;
v3 = a1;
}
}
else if ( (_BYTE)v6 == 38 )
{
v8 = sub_180088560(a1, &v11);
v3 = v11;
a1 = (char *)v8;
v5 = v12;
}
else
{
if ( !(_BYTE)v6 )
return nullptr;
++a1;
}
}
if ( v3 )
{
memmove(&v3[-v5], v3, a1 - v3);
v10 = &a1[-v5];
}
else
{
v10 = a1;
}
*v10 = 0;
return a1 + 1;
}