//
// std::__ndk1::__codecvt_utf16::do_out from 0xf730f0 to 0xf73184 (148 bytes)
//
// 2 xrefs:
// > ??> @ 0x5f200
// > ??> @ 0x1534c90
//
// 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_out(
__int64 a1,
__int64 a2,
unsigned __int16 *a3,
unsigned __int64 a4,
_QWORD *a5,
__int64 a6,
__int64 a7,
_QWORD *a8)
{
unsigned __int64 v8; // x8
__int64 result; // x0
unsigned __int64 v10; // x9
__int64 v11; // x10
v8 = *(_QWORD *)(a1 + 16);
if ( (*(_BYTE *)(a1 + 24) & 2) != 0 )
{
if ( a7 - a6 < 2 )
{
LABEL_12:
result = 1;
goto LABEL_13;
}
*(_WORD *)a6 = -2;
a6 += 2;
}
if ( (unsigned __int64)a3 >= a4 )
{
result = 0;
}
else
{
result = 2;
while ( 1 )
{
v10 = *a3;
if ( (unsigned int)v10 >> 11 == 27 || v10 > v8 )
break;
if ( a7 - a6 < 2 )
goto LABEL_12;
++a3;
v11 = a6 + 2;
*(_BYTE *)(a6 + 1) = v10;
*(_BYTE *)a6 = BYTE1(v10);
a6 += 2;
if ( (unsigned __int64)a3 >= a4 )
{
result = 0;
a6 = v11;
break;
}
}
}
LABEL_13:
*a5 = a3;
*a8 = a6;
return result;
}