//
// sub_1007479B0 from 0x1007479b0 to 0x100747a18 (104 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_1007479B0(unsigned int *a1, __int64 a2)
{
unsigned int v3; // ecx
unsigned int v4; // esi
unsigned int v5; // edx
void *result; // rax
__int64 v7; // rsi
__int64 v8; // rsi
v3 = *a1;
v4 = a1[1];
v5 = *a1 + 1;
for ( result = *((void **)a1 + 2); v4 < v5; v5 = *a1 + 1 )
{
v7 = 2 * v4;
a1[1] = v7;
result = realloc(result, 8 * v7);
*((_QWORD *)a1 + 2) = result;
v3 = *a1;
v4 = a1[1];
}
*((_QWORD *)result + v3) = a2;
*a1 = v5;
if ( v5 >= v4 )
{
v8 = 2 * v4;
a1[1] = v8;
result = realloc(*((void **)a1 + 2), 8 * v8);
*((_QWORD *)a1 + 2) = result;
}
return result;
}