//
// fmt::internal::UTF16ToUTF8::UTF16ToUTF8 from 0x180041200 to 0x1800412bb (187 bytes)
//
// 2 xrefs:
// > ??> @ 0x18014cf68
// > ??> @ 0x1801bb4c4
//
// 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:39 +0000
//
// Hidden C++ exception states: #wind=1
__int64 __fastcall fmt::internal::UTF16ToUTF8::UTF16ToUTF8(__int64 a1, LPCWCH *a2)
{
const WCHAR *v3; // rsi
int v4; // eax
int cbMultiByte; // edi
*(_QWORD *)a1 = 0;
*(_QWORD *)(a1 + 8) = 500;
*(_QWORD *)(a1 + 16) = a1 + 24;
v3 = *a2;
v4 = WideCharToMultiByte(0xFDE9u, 0, *a2, -1, nullptr, 0, nullptr, nullptr);
cbMultiByte = v4;
if ( !v4
|| (sub_180044BB0(a1, v4),
!WideCharToMultiByte(0xFDE9u, 0, v3, -1, *(LPSTR *)(a1 + 16), cbMultiByte, nullptr, nullptr)) )
{
GetLastError();
}
return a1;
}