//
// sub_100668480 from 0x100668480 to 0x1006684e8 (104 bytes)
//
// 0 xrefs:
//
// 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
//
void *__fastcall sub_100668480(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;
}