//
// __crt_mbstring::__mbrtowc_utf8 from 0x18013da70 to 0x18013daa9 (57 bytes)
//
// 2 xrefs:
// > _mbtowc_l @ 0x18013730e
// > ??> @ 0x180203b0c
//
// 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:03 +0000
//
unsigned __int64 __fastcall __crt_mbstring::__mbrtowc_utf8(
__crt_mbstring *this,
char32_t *a2,
const char *a3,
unsigned __int64 a4)
{
unsigned __int64 result; // rax
__int16 v6; // dx
struct _Mbstatet *v7; // [rsp+20h] [rbp-18h] BYREF
result = __crt_mbstring::__mbrtoc32_utf8((__crt_mbstring *)&v7, a2, a3, a4, v7);
if ( result <= 4 )
{
v6 = (__int16)v7;
if ( (unsigned int)v7 > 0xFFFF )
v6 = -3;
if ( this )
*(_WORD *)this = v6;
}
return result;
}