//
// std::vector>::resize from 0x36d7f8 to 0x36d8b8 (192 bytes)
//
// 1 xrefs:
// > LevelEditorLayer::init @ 0x3766c6
//
// 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::resize(int a1, unsigned int a2, int a3)
{
int v4; // r7
unsigned int v5; // r6
unsigned int v6; // r8
unsigned int v7; // r3
_DWORD *v8; // r2
unsigned int v9; // r4
char *v10; // r7
size_t v11; // r6
char *v12; // r6
unsigned int v13; // r3
char *v14; // r2
char *v15; // r6
v4 = *(_DWORD *)(a1 + 4);
v5 = (v4 - *(_DWORD *)a1) >> 2;
if ( a2 > v5 )
{
v6 = a2 - v5;
if ( a2 == v5 )
return;
if ( v6 <= (*(_DWORD *)(a1 + 8) - v4) >> 2 )
{
v7 = a2 - v5;
v8 = *(_DWORD **)(a1 + 4);
do
{
--v7;
*v8++ = 0;
}
while ( v7 );
*(_DWORD *)(a1 + 4) = v4 + 4 * v6;
return;
}
if ( 0x3FFFFFFF - v5 < v6 )
sub_7731C4("vector::_M_default_append", a2, a3);
if ( v6 < v5 )
v9 = 2 * v5;
else
v9 = a2;
if ( v9 >= v5 && v9 < 0x40000000 )
{
if ( !v9 )
{
v10 = nullptr;
goto LABEL_16;
}
}
else
{
v9 = 0x3FFFFFFF;
}
v10 = (char *)operator new(4 * v9);
LABEL_16:
v11 = *(_DWORD *)(a1 + 4) - *(_DWORD *)a1;
if ( v11 >> 2 )
memmove(v10, *(const void **)a1, v11);
v12 = &v10[v11];
v13 = v6;
v14 = v12;
do
{
--v13;
*(_DWORD *)v14 = 0;
v14 += 4;
}
while ( v13 );
v15 = &v12[4 * v6];
if ( *(_DWORD *)a1 )
operator delete(*(void **)a1);
*(_DWORD *)a1 = v10;
*(_DWORD *)(a1 + 4) = v15;
*(_DWORD *)(a1 + 8) = &v10[4 * v9];
return;
}
if ( a2 < v5 )
*(_DWORD *)(a1 + 4) = *(_DWORD *)a1 + 4 * a2;
}