// // ConvertUTF32toUTF16 from 0xb1bff4 to 0xb1c0fc (264 bytes) // // 1 xrefs: // > @ 0x6db30 // // 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 ConvertUTF32toUTF16(unsigned int **a1, unsigned __int64 a2, _WORD **a3, unsigned __int64 a4, int a5) { unsigned int *v5; // x8 _WORD *v7; // x7 __int64 result; // x0 unsigned int v9; // w5 unsigned int *v10; // x6 unsigned int v11; // w5 v5 = *a1; v7 = *a3; if ( (unsigned __int64)*a1 >= a2 ) { v10 = *a1; result = 0; LABEL_13: *a1 = v10; *a3 = v7; } else { if ( (unsigned __int64)v7 < a4 ) { result = 0; while ( 1 ) { v10 = v5 + 1; v9 = *v5; if ( *v5 <= 0xFFFF ) break; if ( v9 <= 0x10FFFF ) { if ( a4 <= (unsigned __int64)(v7 + 1) ) goto LABEL_17; v11 = v9 - 0x10000; *v7 = (v11 >> 10) - 10240; v7[1] = (v11 & 0x3FF) - 9216; v7 += 2; goto LABEL_7; } if ( a5 ) goto LABEL_6; result = 3; if ( a2 <= (unsigned __int64)v10 ) goto LABEL_13; LABEL_8: ++v5; if ( a4 <= (unsigned __int64)v7 ) goto LABEL_18; } if ( v9 - 55296 > 0x7FF ) { *v7++ = v9; } else { if ( !a5 ) { v10 = v5; result = 3; goto LABEL_13; } LABEL_6: *v7++ = -3; } LABEL_7: if ( a2 <= (unsigned __int64)v10 ) goto LABEL_13; goto LABEL_8; } LABEL_17: v10 = v5; LABEL_18: *a1 = v10; *a3 = v7; return 2; } return result; }