//
// sub_7F492C from 0x7f492c to 0x7f49a2 (118 bytes)
//
// 5 xrefs:
// > isLegalUTF8Sequence @ 0x7f4c7a
// > getUTF8StringLength @ 0x7f4cc4
// > isLegalUTF8String @ 0x7f4d06
// > ConvertUTF8toUTF16 @ 0x7f4d68
// > ConvertUTF8toUTF32 @ 0x7f4e90
//
// 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:01:07 +0000
//
bool __fastcall sub_7F492C(unsigned __int8 *a1, int a2)
{
unsigned __int8 *v2; // r3
unsigned int v3; // r3
bool v4; // cc
unsigned int v5; // r0
unsigned int v7; // r2
bool v8; // cc
v2 = &a1[a2];
switch ( a2 )
{
case 1:
goto LABEL_13;
case 2:
goto LABEL_6;
case 3:
goto LABEL_4;
case 4:
if ( (*(v2 - 1) ^ 0x80u) > 0x3F )
return 0;
--v2;
LABEL_4:
if ( (*(v2 - 1) ^ 0x80u) > 0x3F )
return 0;
--v2;
LABEL_6:
v3 = *(v2 - 1);
if ( (v3 ^ 0x80) > 0x3F )
return 0;
v7 = *a1;
if ( v7 != 237 )
{
if ( v7 > 0xED )
{
if ( v7 != 240 )
{
if ( v7 != 244 )
goto LABEL_13;
v8 = v3 > 0x8F;
goto LABEL_17;
}
v4 = v3 > 0x8F;
}
else
{
if ( v7 != 224 )
goto LABEL_13;
v4 = v3 > 0x9F;
}
if ( !v4 )
return 0;
goto LABEL_13;
}
v8 = v3 > 0x9F;
LABEL_17:
if ( v8 )
return 0;
LABEL_13:
v5 = *a1;
if ( (v5 ^ 0x80) > 0x41 )
return v5 <= 0xF4;
return 0;
default:
return 0;
}
}