//
// sub_100747A90 from 0x100747a90 to 0x100747b4f (191 bytes)
//
// 0 xrefs:
//
// 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:31 +0000
//
void *__fastcall sub_100747A90(unsigned int *a1, unsigned int *a2)
{
int v3; // r15d
unsigned int v4; // esi
void *result; // rax
__int64 v6; // rsi
unsigned __int64 v7; // r15
__int64 v8; // rdx
unsigned int v9; // esi
__int64 v10; // rsi
v3 = *a2;
v4 = a1[1];
result = (void *)(v3 + *a1);
if ( v4 < (unsigned int)result )
{
result = *((void **)a1 + 2);
do
{
v6 = 2 * v4;
a1[1] = v6;
result = realloc(result, 8 * v6);
*((_QWORD *)a1 + 2) = result;
v4 = a1[1];
}
while ( v4 < v3 + *a1 );
v3 = *a2;
}
if ( v3 )
{
v7 = 0;
do
{
v8 = *a1;
*(_QWORD *)(*((_QWORD *)a1 + 2) + 8 * v8) = *(_QWORD *)(*((_QWORD *)a2 + 2) + 8 * v7);
*a1 = v8 + 1;
v9 = a1[1];
if ( (int)v8 + 1 >= v9 )
{
v10 = 2 * v9;
a1[1] = v10;
*((_QWORD *)a1 + 2) = realloc(*((void **)a1 + 2), 8 * v10);
}
++v7;
result = (void *)*a2;
}
while ( v7 < (unsigned __int64)result );
}
return result;
}