//
// std::vector>::push_back from 0x307490 to 0x307510 (128 bytes)
//
// 4 xrefs:
// > base64_decode @ 0x3075e4
// > base64_decode @ 0x30765a
// > base64_decode @ 0x307664
// > base64_decode @ 0x30766e
//
// 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::push_back(int a1, _BYTE *a2)
{
_BYTE *v3; // r3
_BYTE *v5; // r3
int v6; // r4
bool v7; // cf
unsigned int v8; // r4
_BYTE *v9; // r7
int v10; // r3
int v11; // r3
int v12; // r5
char *v13; // r5
v3 = *(_BYTE **)(a1 + 4);
if ( v3 != *(_BYTE **)(a1 + 8) )
{
if ( v3 )
*v3 = *a2;
++*(_DWORD *)(a1 + 4);
return;
}
v5 = &v3[-*(_DWORD *)a1];
if ( v5 == (_BYTE *)-1 )
sub_7731C4("vector::_M_emplace_back_aux", a2, 0);
if ( v5 )
v6 = (int)v5;
else
v6 = 1;
v7 = __CFADD__(v6, v5);
v8 = (unsigned int)&v5[v6];
if ( v7 )
{
v8 = -1;
}
else if ( !v8 )
{
v9 = nullptr;
goto LABEL_16;
}
v9 = (_BYTE *)operator new(v8);
LABEL_16:
v10 = *(_DWORD *)(a1 + 4) - *(_DWORD *)a1;
if ( &v9[v10] )
v9[v10] = *a2;
v11 = *(_DWORD *)(a1 + 4);
v12 = v11 - *(_DWORD *)a1;
if ( v11 != *(_DWORD *)a1 )
memmove(v9, *(const void **)a1, v11 - *(_DWORD *)a1);
v13 = &v9[v12 + 1];
if ( *(_DWORD *)a1 )
operator delete(*(void **)a1);
*(_DWORD *)a1 = v9;
*(_DWORD *)(a1 + 4) = v13;
*(_DWORD *)(a1 + 8) = &v9[v8];
}