//
// std::vector>::reserve from 0x86c964 to 0x86ca30 (204 bytes)
//
// 4 xrefs:
// > GJBaseGameLayer::init @ 0x893ad4
// > GJBaseGameLayer::init @ 0x893ae0
// > GJBaseGameLayer::init @ 0x893f84
// > ??> @ 0x3f228
//
// 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 std::vector::reserve(__int64 a1, unsigned __int64 a2)
{
const void *v3; // x22
signed __int64 v4; // x21
__int64 v5; // x19
char *v6; // x23
if ( a2 > 0x1FFFFFFFFFFFFFFFLL )
sub_D13AF4("vector::reserve");
v3 = *(const void **)a1;
if ( a2 > (__int64)(*(_QWORD *)(a1 + 16) - *(_QWORD *)a1) >> 3 )
{
v4 = *(_QWORD *)(a1 + 8) - (_QWORD)v3;
if ( a2 )
{
v5 = 8 * a2;
v6 = (char *)operator new(8 * a2);
}
else
{
v5 = 0;
v6 = nullptr;
}
if ( v4 >> 3 )
memmove(v6, v3, v4);
if ( *(_QWORD *)a1 )
operator delete(*(void **)a1);
*(_QWORD *)a1 = v6;
*(_QWORD *)(a1 + 16) = &v6[v5];
*(_QWORD *)(a1 + 8) = &v6[v4];
}
}