//
// sub_1800432E0 from 0x1800432e0 to 0x180043384 (164 bytes)
//
// 9 xrefs:
// > fmt::BasicFormatter::Format @ 0x180041204
// > fmt::BasicFormatter::Format @ 0x18004121f
// > fmt::BasicFormatter::Format @ 0x1800412db
// > fmt::internal::PrintfParser::Format @ 0x18004154b
// > fmt::internal::PrintfParser::Format @ 0x18004155b
// > fmt::internal::PrintfParser::Format @ 0x180041bf8
// > ??> @ 0x180136b84
// > ??> @ 0x180136b94
// > ??> @ 0x1801b156c
//
// 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 sub_1800432E0(__int64 a1, const void *a2, __int64 a3)
{
size_t v4; // rsi
size_t v6; // rcx
size_t v7; // rdx
size_t v8; // rdx
void *v9; // r14
void *v10; // rcx
void *result; // rax
v4 = a3 - (_QWORD)a2;
v6 = a3 - (_QWORD)a2 + *(_QWORD *)a1;
v7 = *(_QWORD *)(a1 + 8);
if ( v6 > v7 )
{
v8 = (v7 >> 1) + v7;
if ( v6 < v8 )
v6 = v8;
*(_QWORD *)(a1 + 8) = v6;
v9 = operator new(v6);
memmove(v9, *(const void **)(a1 + 16), *(_QWORD *)a1);
v10 = *(void **)(a1 + 16);
if ( v10 != (void *)(a1 + 24) )
j_j_free_0(v10);
*(_QWORD *)(a1 + 16) = v9;
}
result = memmove((void *)(*(_QWORD *)a1 + *(_QWORD *)(a1 + 16)), a2, v4);
*(_QWORD *)a1 += v4;
return result;
}