//
// sub_1006682E0 from 0x1006682e0 to 0x100668328 (72 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
//
unsigned __int64 __fastcall sub_1006682E0(__int64 a1, int a2)
{
unsigned int v3; // esi
unsigned __int64 result; // rax
__int64 v5; // rsi
v3 = *(_DWORD *)(a1 + 4);
result = (unsigned int)(a2 + *(_DWORD *)a1);
if ( v3 < (unsigned int)result )
{
result = *(_QWORD *)(a1 + 16);
do
{
v5 = 2 * v3;
*(_DWORD *)(a1 + 4) = v5;
result = (unsigned __int64)realloc((void *)result, 8 * v5);
*(_QWORD *)(a1 + 16) = result;
v3 = *(_DWORD *)(a1 + 4);
}
while ( v3 < a2 + *(_DWORD *)a1 );
}
return result;
}