{"type": "func", "start": 6200552, "end": 6200692, "name": "ConvertUTF32toUTF16", "pseudocode": "// \n// ConvertUTF32toUTF16 from 0x5e9ce8 to 0x5e9d74 (140 bytes)\n// \n// 0 xrefs:\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nint __fastcall ConvertUTF32toUTF16(unsigned int **a1, unsigned int a2, _WORD **a3, unsigned int a4, int a5)\n{\n  _WORD *v5; // r4\n  unsigned int *v7; // r9\n  int result; // r0\n  unsigned int v9; // r5\n  unsigned int v10; // r5\n\n  v5 = *a3;\n  v7 = *a1;\n  result = 0;\n  while ( (unsigned int)v7 < a2 )\n  {\n    if ( (unsigned int)v5 >= a4 )\n      goto LABEL_17;\n    v9 = *v7;\n    if ( *v7 < 0x10000 )\n    {\n      if ( v9 - 55296 >= 0x800 )\n      {\n        *v5 = v9;\n      }\n      else\n      {\n        if ( !a5 )\n        {\n          result = 3;\n          break;\n        }\nLABEL_12:\n        *v5 = -3;\n      }\n      ++v5;\n      goto LABEL_16;\n    }\n    if ( v9 <= 0x10FFFF )\n    {\n      if ( a4 <= (unsigned int)(v5 + 1) )\n      {\nLABEL_17:\n        result = 2;\n        break;\n      }\n      v10 = v9 - 0x10000;\n      *v5 = (v10 >> 10) - 10240;\n      v5[1] = (v10 & 0x3FF) - 9216;\n      v5 += 2;\n    }\n    else\n    {\n      if ( a5 )\n        goto LABEL_12;\n      result = 3;\n    }\nLABEL_16:\n    ++v7;\n  }\n  *a1 = v7;\n  *a3 = v5;\n  return result;\n}", "assembly": "; \n; ConvertUTF32toUTF16 from 0x5e9ce8 to 0x5e9d74 (140 bytes)\n; \n; 0 xrefs:\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nPUSH.W          {R4-R10,LR}                                            ; +0x0, 0x5e9ce8\nMOV             LR, R1                                                 ; +0x4, 0x5e9cec\nLDR             R4, [R2]                                               ; +0x6, 0x5e9cee\nMOV             R7, R0                                                 ; +0x8, 0x5e9cf0\nLDR             R1, [SP,#arg_0]                                        ; +0xa, 0x5e9cf2\nMOVW            R12, #0xFFFD                                           ; +0xc, 0x5e9cf4\nLDR.W           R8, =0x10FFFF                                          ; +0x10, 0x5e9cf8\nLDR.W           R9, [R0]                                               ; +0x14, 0x5e9cfc\nMOVS            R0, #0                                                 ; +0x18, 0x5e9d00\nCMP             R9, LR                                                 ; +0x1a, 0x5e9d02\nBCS             loc_5E9D6A                                             ; +0x1c, 0x5e9d04\nCMP             R4, R3                                                 ; +0x1e, 0x5e9d06\nBCS             loc_5E9D68                                             ; +0x20, 0x5e9d08\nMOV             R6, R9                                                 ; +0x22, 0x5e9d0a\nLDR.W           R5, [R6],#4                                            ; +0x24, 0x5e9d0c\nCMP.W           R5, #0x10000                                           ; +0x28, 0x5e9d10\nBCS             loc_5E9D2A                                             ; +0x2c, 0x5e9d14\nSUB.W           R10, R5, #0xD800                                       ; +0x2e, 0x5e9d16\nCMP.W           R10, #0x800                                            ; +0x32, 0x5e9d1a\nBCS             loc_5E9D24                                             ; +0x36, 0x5e9d1e\nCBNZ            R1, loc_5E9D30                                         ; +0x38, 0x5e9d20\nB               loc_5E9D64                                             ; +0x3a, 0x5e9d22\nSTRH            R5, [R4]                                               ; +0x3c, 0x5e9d24\nADDS            R4, #2                                                 ; +0x3e, 0x5e9d26\nB               loc_5E9D60                                             ; +0x40, 0x5e9d28\nCMP             R5, R8                                                 ; +0x42, 0x5e9d2a\nBLS             loc_5E9D36                                             ; +0x44, 0x5e9d2c\nCBZ             R1, loc_5E9D5E                                         ; +0x46, 0x5e9d2e\nSTRH.W          R12, [R4]                                              ; +0x48, 0x5e9d30\nB               loc_5E9D26                                             ; +0x4c, 0x5e9d34\nADD.W           R10, R4, #2                                            ; +0x4e, 0x5e9d36\nCMP             R3, R10                                                ; +0x52, 0x5e9d3a\nBLS             loc_5E9D68                                             ; +0x54, 0x5e9d3c\nSUB.W           R5, R5, #0x10000                                       ; +0x56, 0x5e9d3e\nMOV             R9, R4                                                 ; +0x5a, 0x5e9d42\nMOV.W           R10, R5,LSR#10                                         ; +0x5c, 0x5e9d44\nUBFX.W          R5, R5, #0, #0xA                                       ; +0x60, 0x5e9d48\nSUB.W           R10, R10, #0x2800                                      ; +0x64, 0x5e9d4c\nSUB.W           R5, R5, #0x2400                                        ; +0x68, 0x5e9d50\nSTRH.W          R10, [R9],#4                                           ; +0x6c, 0x5e9d54\nSTRH            R5, [R4,#2]                                            ; +0x70, 0x5e9d58\nMOV             R4, R9                                                 ; +0x72, 0x5e9d5a\nB               loc_5E9D60                                             ; +0x74, 0x5e9d5c\nMOVS            R0, #3                                                 ; +0x76, 0x5e9d5e\nMOV             R9, R6                                                 ; +0x78, 0x5e9d60\nB               loc_5E9D02                                             ; +0x7a, 0x5e9d62\nMOVS            R0, #3                                                 ; +0x7c, 0x5e9d64\nB               loc_5E9D6A                                             ; +0x7e, 0x5e9d66\nMOVS            R0, #2                                                 ; +0x80, 0x5e9d68\nSTR.W           R9, [R7]                                               ; +0x82, 0x5e9d6a\nSTR             R4, [R2]                                               ; +0x86, 0x5e9d6e\nPOP.W           {R4-R10,PC}                                            ; +0x88, 0x5e9d70", "xrefs": [], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}