//
// sub_100726130 from 0x100726130 to 0x10072623c (268 bytes)
//
// 1 xrefs:
// > ??> @ 0x100b99c90
//
// 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 12:36:16 +0000
//
unsigned __int8 *__fastcall sub_100726130(unsigned __int8 *a1, char a2)
{
unsigned __int8 *result; // rax
_BYTE *v3; // rdi
__int64 v4; // rcx
bool v5; // cf
size_t v6; // rax
char *v7; // r12
unsigned __int64 v8; // r15
unsigned __int8 *v9; // r14
void *__src[2]; // [rsp+0h] [rbp-40h] BYREF
result = a1;
*(_OWORD *)__src = 0;
while ( 1 )
{
do
{
v3 = result;
v4 = *result++;
}
while ( (a7_0[v4] & 2) == 0 );
if ( (_BYTE)v4 == a2 )
break;
switch ( (_DWORD)v4 )
{
case 0xD:
*v3 = 10;
if ( v3[1] == 10 )
{
if ( __src[0] )
{
v5 = result < __src[0];
v6 = (char *)result - (char *)__src[0];
if ( v5 )
sub_1009A8840();
v7 = (char *)__src[1];
memmove((void *)((char *)__src[0] - (char *)__src[1]), __src[0], v6);
}
else
{
v7 = (char *)__src[1];
}
__src[0] = v3 + 2;
__src[1] = v7 + 1;
result = v3 + 2;
}
break;
case 0x26:
result = (unsigned __int8 *)sub_100726730(v3, __src);
break;
case 0:
return nullptr;
}
}
if ( __src[0] )
{
if ( __src[0] > v3 )
sub_1009A8870();
v8 = (unsigned __int64)__src[1];
v9 = result;
memmove((void *)((char *)__src[0] - (char *)__src[1]), __src[0], v3 - (char *)__src[0]);
result = v9;
v3 -= v8;
}
*v3 = 0;
return result;
}