//
// std::__ndk1::__codecvt_utf16::do_in from 0xf73380 to 0xf73418 (152 bytes)
//
// 2 xrefs:
// > ??> @ 0xea838
// > ??> @ 0x1534d18
//
// This function is hookable on this platform (idp: arm, 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 13:13:40 +0000
//
__int64 __fastcall std::__codecvt_utf16::do_in(
__int64 a1,
__int64 a2,
unsigned __int8 *a3,
unsigned __int64 a4,
_QWORD *a5,
_WORD *a6,
unsigned __int64 a7,
_QWORD *a8)
{
unsigned __int64 v8; // x8
__int64 result; // x0
v8 = *(_QWORD *)(a1 + 16);
if ( (*(_BYTE *)(a1 + 24) & 4) != 0 && (__int64)(a4 - (_QWORD)a3) >= 2 && *a3 == 255 && a3[1] == 254 )
a3 += 2;
if ( (unsigned __int64)a3 < a4 - 1 )
{
result = 2;
while ( (unsigned __int64)a6 < a7 )
{
if ( ((a3[1] << 8) & 0xF800) == 0xD800 || (*a3 | (a3[1] << 8)) > v8 )
goto LABEL_13;
*a6++ = *a3 | (a3[1] << 8);
a3 += 2;
if ( (unsigned __int64)a3 >= a4 - 1 )
break;
}
}
result = (unsigned __int64)a3 < a4;
LABEL_13:
*a5 = a3;
*a8 = a6;
return result;
}