//
// sub_100183920 from 0x100183920 to 0x100183a2a (266 bytes)
//
// 6 xrefs:
// > DS_Dictionary::saveRootSubDictToFile @ 0x10017b648
// > DS_Dictionary::saveRootSubDictToFile @ 0x10017b710
// > DS_Dictionary::saveRootSubDictToCompressedFile @ 0x10017c309
// > DS_Dictionary::saveRootSubDictToCompressedFile @ 0x10017c3c4
// > DS_Dictionary::copyFile @ 0x10017ca05
// > DS_Dictionary::copyFile @ 0x10017cab7
//
// 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_100183920(__int64 a1)
{
bool has_facet; // r15
std::locale v3; // [rsp+8h] [rbp-28h] BYREF
*(_QWORD *)a1 = &`vtable for'std::streambuf.~basic_streambuf;
std::locale::locale((std::locale *)(a1 + 8));
*(_OWORD *)(a1 + 48) = 0;
*(_OWORD *)(a1 + 32) = 0;
*(_OWORD *)(a1 + 16) = 0;
*(_QWORD *)a1 = &off_1008C3BF0;
*(_OWORD *)(a1 + 64) = 0;
*(_QWORD *)(a1 + 80) = 0;
__bzero(a1 + 96, 300);
*(_DWORD *)(a1 + 396) = 32;
*(_WORD *)(a1 + 400) = 0;
*(_BYTE *)(a1 + 402) = 0;
std::locale::locale(&v3, (const std::locale *)(a1 + 8));
has_facet = std::locale::has_facet(&v3, &std::codecvt::id);
std::locale::~locale(&v3);
if ( has_facet )
{
std::locale::locale(&v3, (const std::locale *)(a1 + 8));
*(_QWORD *)(a1 + 128) = std::locale::use_facet(&v3, &std::codecvt::id);
std::locale::~locale(&v3);
*(_BYTE *)(a1 + 402) = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 128) + 56LL))(*(_QWORD *)(a1 + 128));
}
return (*(__int64 (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)a1 + 24LL))(a1, 0, 4096);
}