//
// sub_1800441F0 from 0x1800441f0 to 0x180044264 (116 bytes)
//
// 41 xrefs:
// > sub_18003DA20 @ 0x18003dbd4
// > sub_18003DA20 @ 0x18003dc88
// > sub_18003DA20 @ 0x18003dd39
// > sub_18003DA20 @ 0x18003dd7b
// > sub_18003DA20 @ 0x18003ddfd
// > sub_18003E390 @ 0x18003e544
// > sub_18003E390 @ 0x18003e5f8
// > sub_18003E390 @ 0x18003e6a9
// > sub_18003E390 @ 0x18003e6eb
// > sub_18003E390 @ 0x18003e76d
// > sub_18003FE60 @ 0x18003fef8
// > sub_18003FE60 @ 0x18003ff1b
// > sub_18003FE60 @ 0x18003ff88
// > sub_18003FE60 @ 0x18003ffd9
// > sub_18003FE60 @ 0x18004001a
// > sub_180040360 @ 0x1800403ff
// > sub_180040360 @ 0x180040422
// > sub_180040360 @ 0x18004048f
// > sub_180040360 @ 0x1800404e0
// > sub_180040360 @ 0x180040521
// > sub_180040870 @ 0x1800408b7
// > sub_180040870 @ 0x18004095b
// > fmt::internal::UTF8ToUTF16::UTF8ToUTF16 @ 0x180040af1
// > fmt::BasicFormatter::Format @ 0x18004136a
// > fmt::BasicFormatter::Format @ 0x1800413b4
// > fmt::BasicFormatter::Format @ 0x1800414b1
// > fmt::internal::PrintfParser::Format @ 0x180041d5a
// > fmt::internal::PrintfParser::Format @ 0x180041d9c
// > fmt::internal::PrintfParser::Format @ 0x18004225a
// > fmt::internal::PrintfParser::Format @ 0x180042358
// > fmt::internal::PrintfParser::Format @ 0x1800423c2
// > fmt::internal::PrintfParser::Format @ 0x18004246f
// > fmt::internal::PrintfParser::Format @ 0x1800424ef
// > fmt::internal::PrintfParser::Format @ 0x180042599
// > fmt::internal::PrintfParser::Format @ 0x18004262f
// > fmt::BasicWriter::GrowBuffer @ 0x180042c52
// > fmt::BasicFormatter::format @ 0x180043def
// > fmt::BasicFormatter::format @ 0x180043e93
// > fmt::BasicFormatter::format @ 0x180043f0c
// > fmt::BasicFormatter::format @ 0x180043fb0
// > ??> @ 0x1801b15b4
//
// 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_1800441F0(__int64 a1, unsigned __int64 a2)
{
void *v3; // rdi
void *v4; // rcx
if ( a2 < *(_QWORD *)(a1 + 8) + (*(_QWORD *)(a1 + 8) >> 1) )
a2 = *(_QWORD *)(a1 + 8) + (*(_QWORD *)(a1 + 8) >> 1);
*(_QWORD *)(a1 + 8) = a2;
v3 = operator new(saturated_mul(a2, 2u));
memmove(v3, *(const void **)(a1 + 16), 2LL * *(_QWORD *)a1);
v4 = *(void **)(a1 + 16);
if ( v4 != (void *)(a1 + 24) )
j_j_free_0(v4);
*(_QWORD *)(a1 + 16) = v3;
}