//
// sub_1800183A0 from 0x1800183a0 to 0x18001842c (140 bytes)
//
// 2 xrefs:
// > sub_1800180E8 @ 0x1800180ef
// > ??> @ 0x1801b88a8
//
// 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_1800183A0(__int64 a1, char a2)
{
void *v2; // rsi
__int64 v5; // r8
v2 = (void *)(a1 - 168);
*(_QWORD *)(*(int *)(*(_QWORD *)(a1 - 168) + 4LL) + a1 - 168) = &std::ofstream::`vftable';
v5 = *(int *)(*(_QWORD *)(a1 - 168) + 4LL);
*(_DWORD *)(v5 + a1 - 172) = v5 - 168;
sub_180017410(a1 - 168 + 8);
std::ostream::~ostream>(a1 - 152);
std::ios::~ios>(a1);
if ( (a2 & 1) != 0 )
j_j_free_0(v2);
return v2;
}