//
// isLegalUTF8String from 0xb1c688 to 0xb1c73c (180 bytes)
//
// 2 xrefs:
// > llvm::ConvertUTF8toWide @ 0xb1cc74
// > ??> @ 0x2be60
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall isLegalUTF8String(const unsigned __int8 **a1, const unsigned __int8 *a2)
{
const unsigned __int8 *v2; // x19
const unsigned __int8 *v5; // x0
int v6; // w1
__int64 v7; // x2
_BYTE *v8; // x0
v2 = *a1;
if ( *a1 == a2 )
return 1;
v5 = (const unsigned __int8 *)(a2 - v2);
v6 = byte_F1C6F0[*v2] + 1;
v7 = v6;
if ( v6 <= (__int64)v5 )
{
do
{
v8 = v2;
v2 += v7;
if ( !(unsigned __int8)sub_B1BED4(v8, v6) )
break;
*a1 = v2;
if ( a2 == v2 )
return 1;
v6 = byte_F1C6F0[*v2] + 1;
v7 = v6;
}
while ( v6 <= a2 - v2 );
}
return 0;
}