//
// std::vector>::emplace_back from 0x3d6678 to 0x3d66de (102 bytes)
//
// 3 xrefs:
// > GJGameLevel::scoreStringToVector @ 0x3d6740
// > GJLevelList::parseListLevels @ 0x3d683c
// > GJLevelList::addLevelToList @ 0x3d7cf8
//
// 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::emplace_back(void **a1, _DWORD *a2)
{
_DWORD *v3; // r3
unsigned int v5; // r0
int v6; // r6
char *v7; // r4
void *v8; // r0
int v9; // r1
int v10; // r3
int v11; // r7
v3 = a1[1];
if ( v3 == a1[2] )
{
v5 = std::vector::_M_check_len(a1, 1u, (int)"vector::_M_emplace_back_aux");
v6 = 4 * v5;
if ( v5 )
{
if ( v5 >= 0x40000000 )
sub_772FB4(v5);
v5 = operator new(4 * v5);
}
v7 = (char *)v5;
v8 = *a1;
v9 = (int)a1[1];
v10 = v9 - (_DWORD)*a1;
if ( &v7[v10] )
*(_DWORD *)&v7[v10] = *a2;
v11 = std::__copy_move::__copy_m(v8, v9, v7) + 4;
if ( *a1 )
operator delete(*a1);
*a1 = v7;
a1[1] = (void *)v11;
a1[2] = &v7[v6];
}
else
{
if ( v3 )
*v3 = *a2;
a1[1] = v3 + 1;
}
}