//
// fmt::BasicWriter::c_str from 0x180018e00 to 0x180018e89 (137 bytes)
//
// 4 xrefs:
// > ??> @ 0x18013c8c4
// > ??> @ 0x18013c8d4
// > ??> @ 0x18014cf68
// > ??> @ 0x1801b8998
//
// 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:21:25 +0000
//
__int64 __fastcall fmt::BasicWriter::c_str(__int64 a1)
{
size_t v1; // rsi
size_t v3; // rdx
size_t v4; // rcx
size_t v5; // rdx
void *v6; // rbp
void *v7; // rcx
v1 = *(_QWORD *)a1;
v3 = *(_QWORD *)(a1 + 8);
v4 = *(_QWORD *)a1 + 1LL;
if ( v4 > v3 )
{
v5 = (v3 >> 1) + v3;
if ( v4 < v5 )
v4 = v5;
*(_QWORD *)(a1 + 8) = v4;
v6 = (void *)sub_1800E4C6C(v4);
memmove(v6, *(const void **)(a1 + 16), *(_QWORD *)a1);
v7 = *(void **)(a1 + 16);
if ( v7 != (void *)(a1 + 24) )
j_j_free_0(v7);
*(_QWORD *)(a1 + 16) = v6;
}
*(_BYTE *)(v1 + *(_QWORD *)(a1 + 16)) = 0;
return *(_QWORD *)(a1 + 16);
}