//
// sub_180017410 from 0x180017410 to 0x1800174df (207 bytes)
//
// 14 xrefs:
// > sub_180017FC0 @ 0x180017ffd
// > sub_180018020 @ 0x18001805d
// > sub_1800182D0 @ 0x1800182df
// > sub_180018310 @ 0x18001835b
// > sub_1800183A0 @ 0x1800183eb
// > DS_Dictionary::copyFile @ 0x18001939d
// > DS_Dictionary::copyFile @ 0x1800193e2
// > DS_Dictionary::saveRootSubDictToCompressedFile @ 0x18001d96d
// > DS_Dictionary::saveRootSubDictToCompressedFile @ 0x18001d9b5
// > DS_Dictionary::saveRootSubDictToFile @ 0x18001e07c
// > DS_Dictionary::saveRootSubDictToFile @ 0x18001e0c1
// > sub_1800E63F0 @ 0x1800e63fb
// > int `Concurrency::agent::agent @ 0x1800e645b
// > ??> @ 0x1801b8740
//
// 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
//
__int64 __fastcall sub_180017410(__int64 a1)
{
*(_QWORD *)a1 = &std::filebuf::`vftable';
if ( *(_QWORD *)(a1 + 128) && ((__int64 (*)(void))std::streambuf::eback)() == a1 + 112 )
std::streambuf::setg(a1, *(_QWORD *)(a1 + 136), *(_QWORD *)(a1 + 136), *(_QWORD *)(a1 + 144));
if ( *(_BYTE *)(a1 + 124) )
{
if ( *(_QWORD *)(a1 + 128) )
{
if ( std::streambuf::eback(a1) == a1 + 112 )
std::streambuf::setg(a1, *(_QWORD *)(a1 + 136), *(_QWORD *)(a1 + 136), *(_QWORD *)(a1 + 144));
sub_180018740(a1);
fclose(*(FILE **)(a1 + 128));
}
*(_BYTE *)(a1 + 124) = 0;
*(_BYTE *)(a1 + 113) = 0;
std::streambuf::_Init(a1);
*(_QWORD *)(a1 + 128) = 0;
*(_QWORD *)(a1 + 116) = qword_1801B2388;
*(_QWORD *)(a1 + 104) = 0;
}
return std::streambuf::~streambuf>(a1);
}