//
// replace_current_thread_locale_nolock from 0x18013520c to 0x180135273 (103 bytes)
//
// 3 xrefs:
// > __crt_seh_guarded_call::operator @ 0x180134f61
// > __crt_seh_guarded_call::operator @ 0x180134fa9
// > ??> @ 0x180203344
//
// 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 10:55:00 +0000
//
void __fastcall replace_current_thread_locale_nolock(struct __acrt_ptd *const a1, struct __crt_locale_data *const a2)
{
wchar_t **v4; // rcx
if ( *((_QWORD *)a1 + 18) )
{
_acrt_release_locale_ref();
v4 = *((wchar_t ***)a1 + 18);
if ( v4 != (wchar_t **)qword_1801F5158 && v4 != &off_1801B1880 && !*((_DWORD *)v4 + 4) )
_acrt_free_locale(v4);
}
*((_QWORD *)a1 + 18) = a2;
if ( a2 )
_acrt_add_locale_ref(a2);
}