//
// fmt::internal::Array::grow from 0x81c258 to 0x81c29c (68 bytes)
//
// 3 xrefs:
// > fmt::BasicWriter::GrowBuffer @ 0x81c2ac
// > fmt::internal::Array::append @ 0x81c368
// > fmt::internal::Array::reserve @ 0x81c526
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:01:46 +0000
//
void __fastcall fmt::internal::Array::grow(int a1, unsigned int a2)
{
unsigned int v3; // r0
void *v4; // r0
void *v5; // r5
void *v6; // r0
if ( a2 < *(_DWORD *)(a1 + 4) + (*(_DWORD *)(a1 + 4) >> 1) )
a2 = *(_DWORD *)(a1 + 4) + (*(_DWORD *)(a1 + 4) >> 1);
*(_DWORD *)(a1 + 4) = a2;
if ( a2 > 0x1FC00000 )
v3 = -1;
else
v3 = 4 * a2;
v4 = (void *)operator new[](v3);
v5 = v4;
if ( 4 * *(_DWORD *)a1 )
memmove(v4, *(const void **)(a1 + 8), 4 * *(_DWORD *)a1);
v6 = *(void **)(a1 + 8);
if ( v6 != (void *)(a1 + 12) && v6 )
operator delete[](v6);
*(_DWORD *)(a1 + 8) = v5;
}