//
// sub_180086660 from 0x180086660 to 0x180086724 (196 bytes)
//
// 2 xrefs:
// > sub_180086730 @ 0x180086772
// > ??> @ 0x1801bf73c
//
// 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
//
unsigned __int8 *__fastcall sub_180086660(unsigned __int8 *a1, char a2)
{
__int64 i; // rax
unsigned __int8 *v6; // rax
void *Src; // [rsp+20h] [rbp-18h] BYREF
__int64 v8; // [rsp+28h] [rbp-10h]
Src = nullptr;
v8 = 0;
while ( 1 )
{
for ( i = *a1; (byte_1801079B0[i] & 2) == 0; ++a1 )
i = a1[1];
if ( (_BYTE)i == a2 )
break;
if ( (_BYTE)i == 38 )
{
a1 = (unsigned __int8 *)sub_180088560(a1, &Src);
}
else
{
if ( !(_BYTE)i )
return nullptr;
++a1;
}
}
if ( Src )
{
memmove((char *)Src - v8, Src, a1 - (_BYTE *)Src);
v6 = &a1[-v8];
}
else
{
v6 = a1;
}
*v6 = 0;
return a1 + 1;
}