//
// std::__ndk1::__codecvt_utf8::do_in from 0x9718fc to 0x9719ec (240 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:53 +0000
//
int __fastcall std::__codecvt_utf8::do_in(
int a1,
int a2,
char *a3,
unsigned int a4,
char **a5,
unsigned __int16 *a6,
unsigned int a7,
unsigned __int16 **a8)
{
unsigned int v8; // r4
int v10; // r0
bool v11; // zf
int v12; // r5
int v13; // r6
unsigned __int8 v14; // r5
unsigned int v15; // r5
unsigned __int8 v16; // r7
unsigned __int8 v17; // r5
int v18; // r0
unsigned __int16 v19; // r5
int result; // r0
v8 = *(_DWORD *)(a1 + 8);
if ( (*(_BYTE *)(a1 + 12) & 4) != 0 && (int)(a4 - (_DWORD)a3) >= 3 )
{
v10 = (unsigned __int8)*a3;
v11 = v10 == 239;
if ( v10 == 239 )
v11 = (unsigned __int8)a3[1] == 187;
if ( v11 && (unsigned __int8)a3[2] == 191 )
a3 += 3;
}
if ( (unsigned int)a3 < a4 )
{
while ( 1 )
{
if ( (unsigned int)a6 >= a7 )
goto LABEL_33;
v12 = *a3;
v13 = (unsigned __int8)v12;
if ( v12 >= 0 )
{
if ( (unsigned __int8)v12 > v8 )
goto LABEL_34;
*a6 = (unsigned __int8)v12;
++a3;
goto LABEL_32;
}
if ( (unsigned __int8)v12 < 0xC2u )
goto LABEL_34;
if ( (unsigned __int8)v12 > 0xDFu )
break;
if ( (int)(a4 - (_DWORD)a3) < 2 )
goto LABEL_36;
v14 = a3[1];
if ( (v14 & 0xC0) != 0x80 || (v15 = v14 & 0x3F | (v13 << 6) & 0x7C0, v15 > v8) )
{
LABEL_34:
result = 2;
goto LABEL_35;
}
*a6 = v15;
a3 += 2;
LABEL_32:
++a6;
if ( (unsigned int)a3 >= a4 )
goto LABEL_33;
}
if ( (unsigned __int8)v12 > 0xEFu )
goto LABEL_34;
if ( (int)(a4 - (_DWORD)a3) < 3 )
{
LABEL_36:
result = 1;
goto LABEL_35;
}
v16 = a3[1];
v17 = a3[2];
if ( v13 == 237 )
{
v18 = v16 & 0xE0;
}
else
{
if ( v13 == 224 )
{
if ( (v16 & 0xE0) != 0xA0 )
goto LABEL_34;
LABEL_29:
if ( (v17 & 0xC0) != 0x80 )
goto LABEL_34;
v19 = v17 & 0x3F | ((_WORD)v13 << 12) | ((v16 & 0x3F) << 6);
if ( v19 > v8 )
goto LABEL_34;
a3 += 3;
*a6 = v19;
goto LABEL_32;
}
v18 = v16 & 0xC0;
}
if ( v18 != 128 )
goto LABEL_34;
goto LABEL_29;
}
LABEL_33:
result = (unsigned int)a3 < a4;
LABEL_35:
*a5 = a3;
*a8 = a6;
return result;
}