//
// sub_100727000 from 0x100727000 to 0x100727178 (376 bytes)
//
// 1 xrefs:
// > ??> @ 0x100b99d28
//
// 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:17 +0000
//
unsigned __int64 __fastcall sub_100727000(char *a1, __int64 a2, __int64 a3)
{
unsigned __int64 v3; // rbx
__int64 v4; // r15
char *v5; // rsi
char *v6; // rax
__int64 v7; // r8
char *v8; // r12
__int64 v9; // r13
__int64 v10; // rcx
unsigned __int64 v11; // rax
unsigned __int64 v12; // r12
_BYTE *v13; // rcx
unsigned __int64 result; // rax
char *v15; // rdx
__int64 v16; // [rsp+0h] [rbp-30h]
v3 = (unsigned __int64)a1;
v4 = -1;
v5 = nullptr;
v6 = a1;
v7 = 0;
while ( 1 )
{
while ( 1 )
{
v8 = v6;
v9 = 0;
do
v10 = (unsigned __int8)v6[v9++];
while ( (a7_0[v10] & 1) == 0 );
v6 += v9;
if ( (_DWORD)v10 != 13 )
break;
*(v6 - 1) = 10;
if ( *v6 == 10 )
{
if ( v5 )
{
if ( &v8[v9] < v5 )
sub_1009A8CF0(a1, v5, a3, v10, v7);
a1 = &v5[-v7];
v16 = v7;
memmove(&v5[-v7], v5, v9 + v8 - v5);
v7 = v16;
}
v6 = &v8[v9 + 1];
++v7;
--v4;
v5 = v6;
}
}
if ( !(_DWORD)v10 )
break;
if ( (_DWORD)v10 == 60 )
{
v11 = (unsigned __int64)&v8[v9 - 1];
if ( v5 )
{
if ( (unsigned __int64)v5 > v11 )
sub_1009A8D20(a1, v5, a3, v10, v7);
memmove(&v5[-v7], v5, v8 - v5 + v9 - 1);
v11 = (unsigned __int64)&v8[v4 + v9];
}
v12 = (unsigned __int64)&v8[v9];
do
{
v13 = (_BYTE *)v11;
if ( v11 <= v3 )
break;
--v11;
}
while ( (a7_0[(unsigned __int8)*(v13 - 1)] & 8) != 0 );
result = v12;
goto LABEL_25;
}
}
result = (unsigned __int64)&v8[v9 - 1];
v15 = (char *)result;
if ( v5 )
{
if ( (unsigned __int64)v5 > result )
sub_1009A8CC0(a1, v5, result, v10, v7);
memmove(&v5[-v7], v5, v8 - v5 + v9 - 1);
result = (unsigned __int64)&v8[v9 - 1];
v15 = &v8[v4 + v9];
}
do
{
v13 = v15;
if ( (unsigned __int64)v15 <= v3 )
break;
--v15;
}
while ( (a7_0[(unsigned __int8)*(v13 - 1)] & 8) != 0 );
LABEL_25:
*v13 = 0;
return result;
}