//
// sub_1001643A0 from 0x1001643a0 to 0x1001644c4 (292 bytes)
//
// 2 xrefs:
// > DS_Dictionary::copyFile @ 0x1001612fc
// > DS_Dictionary::copyFile @ 0x100161384
//
// 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_1001643A0(__int64 a1)
{
_BOOL4 has_facet; // w20
std::locale v4; // [xsp+8h] [xbp-28h] BYREF
*(_QWORD *)a1 = &`vtable for'std::streambuf.~basic_streambuf;
std::locale::locale((std::locale *)(a1 + 8));
*(_OWORD *)(a1 + 48) = 0u;
*(_OWORD *)(a1 + 16) = 0u;
*(_OWORD *)(a1 + 32) = 0u;
*(_QWORD *)a1 = off_10079BC00;
*(_QWORD *)(a1 + 72) = 0;
*(_QWORD *)(a1 + 80) = 0;
*(_QWORD *)(a1 + 64) = 0;
*(_OWORD *)(a1 + 96) = 0u;
*(_OWORD *)(a1 + 112) = 0u;
*(_OWORD *)(a1 + 128) = 0u;
*(_OWORD *)(a1 + 144) = 0u;
*(_OWORD *)(a1 + 160) = 0u;
*(_OWORD *)(a1 + 176) = 0u;
*(_OWORD *)(a1 + 192) = 0u;
*(_OWORD *)(a1 + 208) = 0u;
*(_OWORD *)(a1 + 224) = 0u;
*(_OWORD *)(a1 + 240) = 0u;
*(_OWORD *)(a1 + 256) = 0u;
*(_OWORD *)(a1 + 272) = 0u;
*(_OWORD *)(a1 + 288) = 0u;
*(_OWORD *)(a1 + 304) = 0u;
*(_OWORD *)(a1 + 320) = 0u;
*(_OWORD *)(a1 + 336) = 0u;
*(_OWORD *)(a1 + 352) = 0u;
*(_OWORD *)(a1 + 368) = 0u;
*(_OWORD *)(a1 + 380) = 0u;
*(_DWORD *)(a1 + 396) = 32;
*(_WORD *)(a1 + 400) = 0;
*(_BYTE *)(a1 + 402) = 0;
std::locale::locale(&v4, (const std::locale *)(a1 + 8));
has_facet = std::locale::has_facet(&v4, &std::codecvt::id);
std::locale::~locale(&v4);
if ( has_facet )
{
std::locale::locale(&v4, (const std::locale *)(a1 + 8));
*(_QWORD *)(a1 + 128) = std::locale::use_facet(&v4, &std::codecvt::id);
std::locale::~locale(&v4);
*(_BYTE *)(a1 + 402) = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 128) + 56LL))(*(_QWORD *)(a1 + 128));
}
(*(void (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)a1 + 24LL))(a1, 0, 4096);
return a1;
}