//
// sub_100099810 from 0x100099810 to 0x10009996e (350 bytes)
//
// 1 xrefs:
// > sub_10009A240 @ 0x10009a263
//
// 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
//
__int64 __fastcall sub_100099810(__int64 a1, const char *a2)
{
const char *v2; // r12
int v4; // r14d
void *v5; // r15
size_t v6; // rdi
void *v7; // r12
int v8; // r14d
__int64 result; // rax
int v10; // [rsp+14h] [rbp-2Ch]
v2 = a2;
if ( *(_BYTE *)(a1 + 8) == 1 )
{
*(_BYTE *)(a1 + 8) = 0;
sub_1000992C0(a1, ">");
}
v4 = *(_DWORD *)(a1 + 260);
if ( *(_DWORD *)(a1 + 256) <= v4 )
{
v10 = 2 * v4 + 2;
v6 = -1;
if ( v4 >= -1 )
v6 = 8LL * v10;
v5 = operator new[](v6);
v7 = *(void **)(a1 + 168);
memcpy(v5, v7, 8LL * v4);
if ( v7 != (void *)(a1 + 176) && v7 != nullptr )
{
operator delete[](v7);
v4 = *(_DWORD *)(a1 + 260);
}
*(_QWORD *)(a1 + 168) = v5;
*(_DWORD *)(a1 + 256) = v10;
v2 = a2;
}
else
{
v5 = *(void **)(a1 + 168);
}
*(_DWORD *)(a1 + 260) = v4 + 1;
*((_QWORD *)v5 + v4) = v2;
if ( *(int *)(a1 + 28) < 0 && !*(_BYTE *)(a1 + 9) && !*(_BYTE *)(a1 + 33) )
{
sub_1000992C0(a1, "\n");
v8 = *(_DWORD *)(a1 + 24);
if ( v8 > 0 )
{
do
{
sub_1000992C0(a1, " ");
--v8;
}
while ( v8 );
}
}
result = sub_1000992C0(a1, "<%s", v2);
*(_WORD *)(a1 + 8) = 1;
++*(_DWORD *)(a1 + 24);
return result;
}