//
// sub_100161420 from 0x100161420 to 0x1001614bb (155 bytes)
//
// 22 xrefs:
// > DS_Dictionary::saveRootSubDictToFile @ 0x10015ab6b
// > DS_Dictionary::saveRootSubDictToFile @ 0x10015abaf
// > ??> @ 0x10015adff
// > ??> @ 0x10015ae3b
// > sub_10015B2B0 @ 0x10015b2de
// > sub_10015B310 @ 0x10015b33e
// > DS_Dictionary::saveRootSubDictToCompressedFile @ 0x10015b83a
// > DS_Dictionary::saveRootSubDictToCompressedFile @ 0x10015b87e
// > ??> @ 0x10015ba60
// > ??> @ 0x10015ba9c
// > DS_Dictionary::copyFile @ 0x10015bf24
// > DS_Dictionary::copyFile @ 0x10015bf68
// > ??> @ 0x10015c136
// > ??> @ 0x10015c172
// > sub_1001612D0 @ 0x10016130f
// > sub_100161340 @ 0x10016136e
// > sub_1001613A0 @ 0x1001613df
// > sub_100161410 @ 0x100161415
// > sub_1001614F0 @ 0x1001614f9
// > sub_100162240 @ 0x10016227f
// > sub_1001622B0 @ 0x1001622de
// > sub_100162310 @ 0x10016234f
//
// 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 12:25:07 +0000
//
void __fastcall sub_100161420(__int64 a1)
{
FILE *v2; // r14
void *v3; // rdi
void *v4; // rdi
*(_QWORD *)a1 = &off_100AC74C0;
v2 = *(FILE **)(a1 + 120);
if ( v2 )
{
sub_1001619A0(a1);
fclose(v2);
*(_QWORD *)(a1 + 120) = 0;
(*(void (__fastcall **)(__int64, _QWORD, _QWORD))(*(_QWORD *)a1 + 24LL))(a1, 0, 0);
}
if ( *(_BYTE *)(a1 + 400) == 1 )
{
v3 = *(void **)(a1 + 64);
if ( v3 )
operator delete[](v3);
}
if ( *(_BYTE *)(a1 + 401) == 1 )
{
v4 = *(void **)(a1 + 104);
if ( v4 )
operator delete[](v4);
}
*(_QWORD *)a1 = &`vtable for'std::streambuf.~basic_streambuf;
std::locale::~locale((std::locale *)(a1 + 8));
}