//
// sub_180018470 from 0x180018470 to 0x1800184f9 (137 bytes)
//
// 2 xrefs:
// > sub_1800180F4 @ 0x1800180fb
// > ??> @ 0x1801b88c0
//
// 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
//
void *__fastcall sub_180018470(__int64 a1, char a2)
{
void *v2; // rsi
__int64 v5; // r8
v2 = (void *)(a1 - 152);
*(_QWORD *)(*(int *)(*(_QWORD *)(a1 - 152) + 4LL) + a1 - 152) = &std::basic_stringstream,std::allocator>::`vftable';
v5 = *(int *)(*(_QWORD *)(a1 - 152) + 4LL);
*(_DWORD *)(v5 + a1 - 156) = v5 - 152;
sub_1800174E0(a1 - 152 + 24);
std::iostream::~iostream>(a1 - 120);
std::ios::~ios>(a1);
if ( (a2 & 1) != 0 )
j_j_free_0(v2);
return v2;
}