//
// fmt::internal::UTF8ToUTF16::UTF8ToUTF16 from 0x180040a90 to 0x180040b37 (167 bytes)
//
// 2 xrefs:
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b13bc
//
// 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
//
// Hidden C++ exception states: #wind=1
__int64 __fastcall fmt::internal::UTF8ToUTF16::UTF8ToUTF16(__int64 a1, LPCCH *a2)
{
const CHAR *v3; // rsi
unsigned __int64 cchWideChar; // rbp
*(_QWORD *)a1 = 0;
*(_QWORD *)(a1 + 8) = 500;
*(_QWORD *)(a1 + 16) = a1 + 24;
v3 = *a2;
cchWideChar = MultiByteToWideChar(0xFDE9u, 8u, *a2, -1, nullptr, 0);
if ( cchWideChar > *(_QWORD *)(a1 + 8) )
sub_1800441F0(a1);
*(_QWORD *)a1 = cchWideChar;
MultiByteToWideChar(0xFDE9u, 8u, v3, -1, *(LPWSTR *)(a1 + 16), cchWideChar);
return a1;
}