//
// fmt::internal::UTF16ToUTF8::Convert from 0x180040f20 to 0x180040fc1 (161 bytes)
//
// 2 xrefs:
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b13ec
//
// 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
//
DWORD __fastcall fmt::internal::UTF16ToUTF8::Convert(__int64 a1, LPCWCH *a2)
{
const WCHAR *v2; // rdi
int v4; // eax
int cbMultiByte; // ebx
v2 = *a2;
v4 = WideCharToMultiByte(0xFDE9u, 0, *a2, -1, nullptr, 0, nullptr, nullptr);
cbMultiByte = v4;
if ( v4
&& (sub_1800447F0(a1, v4),
WideCharToMultiByte(0xFDE9u, 0, v2, -1, *(LPSTR *)(a1 + 16), cbMultiByte, nullptr, nullptr)) )
{
return 0;
}
else
{
return GetLastError();
}
}