//
// sub_180018310 from 0x180018310 to 0x18001839c (140 bytes)
//
// 2 xrefs:
// > sub_1800180DC @ 0x1800180e3
// > ??> @ 0x1801b889c
//
// 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_180018310(__int64 a1, char a2)
{
void *v2; // rsi
__int64 v5; // r8
v2 = (void *)(a1 - 176);
*(_QWORD *)(*(int *)(*(_QWORD *)(a1 - 176) + 4LL) + a1 - 176) = &std::ifstream::`vftable';
v5 = *(int *)(*(_QWORD *)(a1 - 176) + 4LL);
*(_DWORD *)(v5 + a1 - 180) = v5 - 176;
sub_180017410(a1 - 176 + 16);
std::istream::~istream>(a1 - 152);
std::ios::~ios>(a1);
if ( (a2 & 1) != 0 )
j_j_free_0(v2);
return v2;
}