//
// std::__ndk1::__codecvt_utf16::do_length from 0x97251c to 0x97258c (112 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
bool v11; // cf
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 == 255 )
{
v7 = a3;
if ( a3[1] == 254 )
v7 = a3 + 2;
}
}
}
if ( a5 )
{
v8 = a4 - 1;
if ( (unsigned int)v7 < v8 )
{
v9 = 1;
do
{
v10 = v7[1];
if ( ((v10 << 8) & 0xF800) == 0xD800 || ((v10 << 8) | (unsigned int)*v7) > v5 )
break;
if ( (unsigned int)(v7 + 2) >= v8 )
{
v7 += 2;
return v7 - a3;
}
v11 = v9++ >= a5;
v7 += 2;
}
while ( !v11 );
}
}
return v7 - a3;
}