//
// sub_140178C70 from 0x140178c70 to 0x140178d02 (146 bytes)
//
// 2 xrefs:
// > sub_14017A9E4 @ 0x14017a9eb
// > ??> @ 0x1406cb10c
//
// 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_140178C70(__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_140178A10(a1 - 128);
std::iostream::~iostream>(a1 - 120);
std::ios::~ios>(a1);
if ( (a2 & 1) != 0 )
j_j_free((void *)(a1 - 152));
return a1 - 152;
}