//
// std::vector>::reserve from 0xae4ae0 to 0xae4ba4 (196 bytes)
//
// 3 xrefs:
// > cocos2d::CCLabelBMFont::updateLabel @ 0xae7bfc
// > cocos2d::CCLabelBMFont::updateLabel @ 0xae7c18
// > ??> @ 0x520f8
//
// 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 & 0x8000000000000000LL) != 0 )
sub_D13AF4("vector::reserve");
v3 = *(const void **)a1;
if ( a2 > (__int64)(*(_QWORD *)(a1 + 16) - *(_QWORD *)a1) >> 1 )
{
v4 = *(_QWORD *)(a1 + 8) - (_QWORD)v3;
if ( a2 )
{
v5 = 2 * a2;
v6 = (char *)operator new(2 * a2);
}
else
{
v5 = 0;
v6 = nullptr;
}
if ( v4 >> 1 )
memmove(v6, v3, v4);
if ( *(_QWORD *)a1 )
operator delete(*(void **)a1);
*(_QWORD *)a1 = v6;
*(_QWORD *)(a1 + 16) = &v6[v5];
*(_QWORD *)(a1 + 8) = &v6[v4];
}
}