//
// ConvertUTF16toUTF32 from 0xd8cacc to 0xd8cbd4 (264 bytes)
//
// 1 xrefs:
// > ??> @ 0x102100
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:08:16 +0000
//
__int64 __fastcall ConvertUTF16toUTF32(
unsigned __int64 *a1,
unsigned __int64 a2,
int **a3,
unsigned __int64 a4,
int a5)
{
unsigned __int16 *v5; // x6
int *v6; // x13
int *v7; // x12
int *i; // x5
int v9; // w9
unsigned __int16 *v10; // x7
int v11; // w8
unsigned int v13; // w1
v5 = (unsigned __int16 *)*a1;
v6 = *a3;
if ( *a1 < a2 )
{
v7 = v6 + 1;
for ( i = *a3; ; ++i )
{
v11 = *v5;
v6 = i;
v10 = v5 + 1;
if ( (unsigned int)(v11 - 55296) <= 0x3FF )
{
if ( a2 <= (unsigned __int64)v10 )
{
*a1 = (unsigned __int64)v5;
*a3 = i;
return 1;
}
v9 = v5[1];
if ( (unsigned int)(v9 - 56320) > 0x3FF )
{
if ( !a5 )
goto LABEL_12;
if ( a4 <= (unsigned __int64)i )
{
LABEL_16:
v13 = 2;
goto LABEL_17;
}
*i = v11;
goto LABEL_8;
}
v10 = v5 + 2;
v11 = v9 + 9216 + ((v11 - 55296) << 10);
}
else if ( !a5 && (unsigned int)(v11 - 56320) <= 0x3FF )
{
LABEL_12:
*a1 = (unsigned __int64)v5;
*a3 = i;
return 3;
}
if ( a4 <= (unsigned __int64)i )
goto LABEL_16;
*i = v11;
if ( (unsigned __int64)v10 >= a2 )
{
*a1 = (unsigned __int64)v10;
*a3 = v7;
return 0;
}
LABEL_8:
++v7;
v5 = v10;
}
}
v13 = 0;
LABEL_17:
*a1 = (unsigned __int64)v5;
*a3 = v6;
return v13;
}