//
// tinyxml2::DynArray::PushArr from 0x18009b4b0 to 0x18009b52c (124 bytes)
//
// 5 xrefs:
// > tinyxml2::XMLPrinter::Print @ 0x18009b1a0
// > ??> @ 0x18013ef0c
// > ??> @ 0x18013ef1c
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b70b0
//
// 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
//
__int64 __fastcall tinyxml2::DynArray::PushArr(__int64 a1, int a2)
{
int v4; // ecx
int v5; // esi
void *v6; // rbp
__int64 v7; // rcx
v4 = a2 + *(_DWORD *)(a1 + 32);
if ( v4 > *(_DWORD *)(a1 + 28) )
{
v5 = 2 * v4;
v6 = operator new(2 * v4);
memcpy(v6, *(const void **)a1, *(int *)(a1 + 32));
if ( *(_QWORD *)a1 != a1 + 8 )
j_j_free_0(*(void **)a1);
*(_QWORD *)a1 = v6;
*(_DWORD *)(a1 + 28) = v5;
}
v7 = *(int *)(a1 + 32);
*(_DWORD *)(a1 + 32) = v7 + a2;
return *(_QWORD *)a1 + v7;
}