//
// tinyxml2::DynArray::EnsureCapacity from 0x18009cbe0 to 0x18009cc56 (118 bytes)
//
// 10 xrefs:
// > tinyxml2::MemPoolT<72>::Alloc @ 0x18009bd5c
// > tinyxml2::MemPoolT<88>::Alloc @ 0x18009c09c
// > tinyxml2::MemPoolT<96>::Alloc @ 0x18009c36e
// > tinyxml2::MemPoolT<104>::Alloc @ 0x18009c47c
// > tinyxml2::XMLPrinter::OpenElement @ 0x18009de4a
// > tinyxml2::DynArray::Push @ 0x18009f145
// > ??> @ 0x180147e98
// > ??> @ 0x180147ea8
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c0ff0
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:22:12 +0000
//
// Alternative name is '?EnsureCapacity@?$DynArray@PEAUBlock@?$MemPoolT@$0EI@@tinyxml2@@$09@tinyxml2@@AEAAXH@Z'
// Alternative name is '?EnsureCapacity@?$DynArray@PEAUBlock@?$MemPoolT@$0FI@@tinyxml2@@$09@tinyxml2@@AEAAXH@Z'
// Alternative name is '?EnsureCapacity@?$DynArray@PEAUBlock@?$MemPoolT@$0GA@@tinyxml2@@$09@tinyxml2@@AEAAXH@Z'
// Alternative name is '?EnsureCapacity@?$DynArray@PEAUBlock@?$MemPoolT@$0GI@@tinyxml2@@$09@tinyxml2@@AEAAXH@Z'
void __fastcall tinyxml2::DynArray::EnsureCapacity(__int64 a1, int a2)
{
int v3; // edi
void *v4; // rsi
if ( a2 > *(_DWORD *)(a1 + 88) )
{
v3 = 2 * a2;
v4 = (void *)sub_1800E4C6C(saturated_mul(2 * a2, 8u));
memcpy(v4, *(const void **)a1, 8LL * *(int *)(a1 + 92));
if ( *(_QWORD *)a1 != a1 + 8 )
j_j_free_0(*(void **)a1);
*(_QWORD *)a1 = v4;
*(_DWORD *)(a1 + 88) = v3;
}
}