//
// std::vector>::resize from 0x36fb34 to 0x36fbd8 (164 bytes)
//
// 1 xrefs:
// > LevelEditorLayer::init @ 0x376654
//
// 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(const void **a1, unsigned int a2)
{
char *v2; // r2
unsigned int v4; // r5
unsigned int v5; // r5
unsigned int v6; // r3
unsigned int v7; // r0
unsigned int v8; // r8
char *v9; // r7
size_t v10; // r6
char *v11; // r6
unsigned int v12; // r3
char *v13; // r2
char *v14; // r6
v2 = (char *)a1[1];
v4 = (v2 - (_BYTE *)*a1) >> 2;
if ( a2 <= v4 )
{
if ( a2 < v4 )
a1[1] = (char *)*a1 + 4 * a2;
}
else
{
v5 = a2 - v4;
if ( v5 )
{
if ( v5 > ((_BYTE *)a1[2] - v2) >> 2 )
{
v7 = std::vector::_M_check_len(a1, v5, (int)"vector::_M_default_append");
v8 = v7;
if ( v7 )
{
if ( v7 >= 0x40000000 )
sub_772FB4(v7);
v9 = (char *)operator new(4 * v7);
}
else
{
v9 = nullptr;
}
v10 = (_BYTE *)a1[1] - (_BYTE *)*a1;
if ( v10 >> 2 )
memmove(v9, *a1, v10);
v11 = &v9[v10];
v12 = v5;
v13 = v11;
do
{
--v12;
*(_DWORD *)v13 = 0;
v13 += 4;
}
while ( v12 );
v14 = &v11[4 * v5];
if ( *a1 )
operator delete((void *)*a1);
*a1 = v9;
a1[1] = v14;
a1[2] = &v9[4 * v8];
}
else
{
v6 = v5;
do
{
--v6;
*(_DWORD *)v2 = 0;
v2 += 4;
}
while ( v6 );
a1[1] = (char *)a1[1] + 4 * v5;
}
}
}
}