//
// sub_10073E410 from 0x10073e410 to 0x10073e6a0 (656 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: pc, 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 12:36:28 +0000
//
__int64 __fastcall sub_10073E410(_WORD **a1, unsigned __int64 a2, __int64 *a3, unsigned __int64 a4, int a5)
{
_WORD *v5; // r10
__int64 v6; // r9
__int64 result; // rax
unsigned __int64 v8; // r12
unsigned int v9; // r14d
_WORD *v10; // rbx
unsigned __int16 v11; // r15
unsigned __int64 v12; // r12
unsigned int v13; // ebx
unsigned __int16 *v14; // r14
int v15; // r15d
unsigned __int16 v16; // r15
int v17; // r14d
v5 = *a1;
v6 = *a3;
result = 0;
if ( (unsigned __int64)*a1 >= a2 )
goto LABEL_38;
if ( a5 )
{
while ( 2 )
{
v10 = v5 + 1;
v9 = (unsigned __int16)*v5;
if ( (*v5 & 0xFC00) != 0xD800 )
goto LABEL_11;
if ( (unsigned __int64)v10 < a2 )
{
if ( (*v10 & 0xFC00) == 0xDC00 )
{
v9 = (unsigned __int16)*v10 + (v9 << 10) - 56613888;
v10 = v5 + 2;
}
LABEL_11:
v11 = 1;
if ( v9 >= 0x80 )
{
v11 = 2;
if ( v9 >= 0x800 )
v11 = 4 - (v9 < 0x10000);
}
v8 = v6 + v11;
if ( v8 <= a4 )
{
switch ( v11 )
{
case 1u:
goto LABEL_6;
case 2u:
goto LABEL_5;
case 3u:
goto LABEL_4;
case 4u:
*(_BYTE *)--v8 = v9 & 0x3F | 0x80;
v9 >>= 6;
LABEL_4:
*(_BYTE *)--v8 = v9 & 0x3F | 0x80;
v9 >>= 6;
LABEL_5:
*(_BYTE *)--v8 = v9 & 0x3F | 0x80;
v9 >>= 6;
LABEL_6:
*(_BYTE *)(v8 - 1) = byte_100A12700[v11] | v9;
v6 = v8 + v11 - 1;
v5 = v10;
if ( (unsigned __int64)v10 < a2 )
continue;
v5 = v10;
break;
}
goto LABEL_38;
}
LABEL_33:
result = 2;
goto LABEL_38;
}
break;
}
LABEL_35:
result = 1;
goto LABEL_38;
}
while ( 2 )
{
v14 = v5 + 1;
v13 = (unsigned __int16)*v5;
v15 = *v5 & 0xFC00;
if ( v15 != 55296 )
{
if ( v15 != 56320 )
{
v16 = 1;
if ( v13 < 0x80 )
goto LABEL_30;
goto LABEL_28;
}
LABEL_36:
result = 3;
break;
}
if ( (unsigned __int64)v14 >= a2 )
goto LABEL_35;
v17 = *v14;
if ( (v17 & 0xFC00) != 0xDC00 )
goto LABEL_36;
v13 = v17 + (v13 << 10) - 56613888;
v14 = v5 + 2;
v16 = 1;
if ( v13 < 0x80 )
goto LABEL_30;
LABEL_28:
v16 = 2;
if ( v13 >= 0x800 )
v16 = 4 - (v13 < 0x10000);
LABEL_30:
v12 = v6 + v16;
if ( v12 > a4 )
goto LABEL_33;
switch ( v16 )
{
case 1u:
goto LABEL_20;
case 2u:
goto LABEL_19;
case 3u:
goto LABEL_18;
case 4u:
*(_BYTE *)--v12 = v13 & 0x3F | 0x80;
v13 >>= 6;
LABEL_18:
*(_BYTE *)--v12 = v13 & 0x3F | 0x80;
v13 >>= 6;
LABEL_19:
*(_BYTE *)--v12 = v13 & 0x3F | 0x80;
v13 >>= 6;
LABEL_20:
*(_BYTE *)(v12 - 1) = byte_100A12700[v16] | v13;
v6 = v12 + v16 - 1;
v5 = v14;
if ( (unsigned __int64)v14 < a2 )
continue;
v5 = v14;
break;
}
break;
}
LABEL_38:
*a1 = v5;
*a3 = v6;
return result;
}