//
// std::__ndk1::vector>::reserve from 0x470180 to 0x47023c (188 bytes)
//
// 4 xrefs:
// > std::__ndk1::vector>::resize @ 0x4702b6
// > GJBaseGameLayer::addToSection @ 0x5bf384
// > GJBigSprite::init @ 0x6407c0
// > DeathMarkerLayer::resolveBadgeCollisions @ 0x76bb28
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:49:04 +0000
//
void **__fastcall std::vector::reserve(void **result, unsigned int a2, unsigned int a3, int a4)
{
void **v4; // r5
unsigned int v5; // r4
_DWORD *v6; // r0
_DWORD *v7; // r9
unsigned int v8; // r4
void *v9; // r10
unsigned int v10; // r8
size_t v11; // r2
int v12; // r4
void **v13; // r3
void *v14; // r3
void *v15; // r3
void **v16; // [sp+0h] [bp-10h] BYREF
unsigned int v17; // [sp+4h] [bp-Ch]
unsigned int v18; // [sp+8h] [bp-8h]
int v19; // [sp+Ch] [bp-4h]
v16 = result;
v17 = a2;
v18 = a3;
v19 = a4;
v4 = result;
if ( a2 > 32 * (int)result[2] )
{
v16 = nullptr;
v17 = 0;
v18 = 0;
if ( a2 >= 0x80000000 )
sub_387C60();
v5 = ((a2 - 1) >> 5) + 1;
v6 = (_DWORD *)operator new(4 * v5);
v18 = v5;
v7 = v6;
v8 = (unsigned int)v4[1];
v16 = (void **)v6;
v9 = *v4;
v17 = v8;
if ( (int)v8 > 0 )
{
v10 = v8 >> 5;
v11 = 4 * (v8 >> 5);
v12 = v8 - 32 * (v8 >> 5);
memmove(v6, v9, v11);
if ( v12 > 0 )
v7[v10] = (0xFFFFFFFF >> (32 - v12)) & *((_DWORD *)v9 + v10) | v7[v10] & ~(0xFFFFFFFF >> (32 - v12));
}
v13 = (void **)*v4;
*v4 = v16;
v16 = v13;
v14 = v4[1];
v4[1] = (void *)v17;
v17 = (unsigned int)v14;
v15 = v4[2];
v4[2] = (void *)v18;
v18 = (unsigned int)v15;
return std::vector::~vector((void **)&v16);
}
return result;
}