//
// sub_180018780 from 0x180018780 to 0x180018812 (146 bytes)
//
// 2 xrefs:
// > sub_1800184A4 @ 0x1800184ab
// > ??> @ 0x1801ae854
//
// 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
//
__int64 __fastcall sub_180018780(__int64 a1, char a2)
{
__int64 v4; // r8
*(_QWORD *)(*(int *)(*(_QWORD *)(a1 - 152) + 4LL) + a1 - 152) = &std::basic_stringstream,std::allocator>::`vftable';
v4 = *(int *)(*(_QWORD *)(a1 - 152) + 4LL);
*(_DWORD *)(v4 + a1 - 156) = v4 - 152;
sub_1800179A0(a1 - 128);
std::iostream::~iostream>(a1 - 120);
std::ios::~ios>(a1);
if ( (a2 & 1) != 0 )
j_j_free_0((void *)(a1 - 152));
return a1 - 152;
}