//
// std::__ndk1::__codecvt_utf16::do_length from 0x9723c8 to 0x972430 (104 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:05:54 +0000
//
int __fastcall std::__codecvt_utf16::do_length(
int a1,
int a2,
unsigned __int8 *a3,
int a4,
unsigned int a5)
{
unsigned int v5; // lr
bool v6; // zf
unsigned __int8 *v7; // r0
unsigned int v8; // r3
unsigned int v9; // r1
int v10; // r5
v5 = *(_DWORD *)(a1 + 8);
v6 = (*(_BYTE *)(a1 + 12) & 4) == 0;
v7 = a3;
if ( !v6 )
{
v7 = a3;
if ( a4 - (int)a3 >= 2 )
{
v7 = a3;
if ( *a3 == 254 )
{
v7 = a3;
if ( a3[1] == 255 )
v7 = a3 + 2;
}
}
}
if ( a5 )
{
v8 = a4 - 1;
if ( (unsigned int)v7 < v8 )
{
v9 = 1;
do
{
v10 = *v7;
if ( ((v10 << 8) & 0xF800) == 0xD800 )
break;
if ( ((v10 << 8) | (unsigned int)v7[1]) > v5 )
break;
v7 += 2;
if ( (unsigned int)v7 >= v8 )
break;
}
while ( v9++ < a5 );
}
}
return v7 - a3;
}