//
// std::vector>::reserve from 0x47df6c to 0x47dfd0 (100 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::init @ 0x490afe
// > GJBaseGameLayer::init @ 0x490b0a
// > GJBaseGameLayer::init @ 0x490ec0
//
// 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(int a1, unsigned int a2, int a3)
{
const void *v4; // r8
int v5; // r7
signed int v6; // r6
char *v7; // r4
if ( a2 >= 0x40000000 )
sub_7731C4("vector::reserve", a2, a3);
v4 = *(const void **)a1;
if ( a2 > (*(_DWORD *)(a1 + 8) - *(_DWORD *)a1) >> 2 )
{
v5 = 4 * a2;
v6 = *(_DWORD *)(a1 + 4) - (_DWORD)v4;
if ( a2 )
v7 = (char *)operator new(4 * a2);
else
v7 = nullptr;
if ( v6 >> 2 )
memmove(v7, v4, v6);
if ( *(_DWORD *)a1 )
operator delete(*(void **)a1);
*(_DWORD *)a1 = v7;
*(_DWORD *)(a1 + 4) = &v7[v6];
*(_DWORD *)(a1 + 8) = &v7[v5];
}
}