{"type": "func", "start": 470184, "end": 470516, "name": "sub_72CA8", "pseudocode": "// \n// sub_72CA8 from 0x72ca8 to 0x72df4 (332 bytes)\n// \n// 1 xrefs:\n// > sub_753C4 @ 0x770bc\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 sub_72CA8(int a1, const void **a2, int a3, int a4, int a5, int a6)\n{\n  int result; // r0\n  const void **v8; // r8\n  unsigned int v10; // r8\n  unsigned int v11; // r9\n  int v12; // r0\n  unsigned int v13; // r10\n  unsigned int v14; // r4\n  int v15; // r0\n  char v16; // r0\n  unsigned int v17; // r1\n  int v18; // r1\n  char v19; // r2\n  char v20; // r0\n  int v22; // [sp+4h] [bp-34h]\n  int v23; // [sp+8h] [bp-30h]\n  int v24; // [sp+Ch] [bp-2Ch]\n  int v25; // [sp+10h] [bp-28h]\n  int v26; // [sp+14h] [bp-24h]\n  unsigned int v27; // [sp+18h] [bp-20h] BYREF\n\n  result = 31;\n  if ( a2 && a3 )\n  {\n    v8 = a2;\n    if ( *a2 )\n    {\n      v22 = a3;\nLABEL_5:\n      if ( a4 )\n      {\n        result = sub_72BF8(a1, v8);\n        if ( !result )\n        {\n          v23 = a4;\n          if ( a4 >= 0x8000 )\n            LOWORD(a4) = 0x8000;\n          v25 = 0;\n          v24 = 0;\n          v10 = (unsigned __int16)a4;\n          LOBYTE(v11) = 9;\n          v12 = 0;\nLABEL_10:\n          v13 = (unsigned __int16)v12;\n          v26 = v12;\n          while ( 1 )\n          {\n            while ( 1 )\n            {\n              while ( 1 )\n              {\n                if ( v10 <= v13 )\n                {\n                  sub_72C6C(a1);\n                  a4 = v23 - v10;\n                  v8 = a2;\n                  goto LABEL_5;\n                }\n                v14 = (unsigned __int8)v11;\n                sub_72B92(a1, (unsigned __int8)v11, (int *)&v27);\n                if ( (unsigned __int8)v11 > 6u )\n                  break;\n                v15 = v27;\n                if ( v27 != 1 << (v11 - 1) )\n                  goto LABEL_27;\n                sub_72B92(a1, 3u, (int *)&v27);\n                v16 = v27;\n                v11 = v27 + 1;\n                v27 = v11;\n                if ( v11 >= v14 )\n                  LOBYTE(v11) = v16 + 2;\n              }\n              if ( (unsigned __int8)v11 > 8u )\n                break;\n              v15 = v27;\n              v17 = (unsigned __int8)((0xFFu >> (9 - v11)) - 4);\n              if ( v27 <= v17 || v27 > (unsigned int)(unsigned __int8)((0xFFu >> (9 - v11)) - 4) + 8 )\n              {\n                if ( (unsigned __int8)v11 <= 7u )\nLABEL_27:\n                  v15 = (char)(v15 << (8 - v11)) >> (8 - v11);\nLABEL_28:\n                v18 = v25 + v15;\n                v19 = v24 + v25 + v15;\n                v20 = v25 + v15;\n                v24 += v18;\n                v25 = v18;\n                if ( a5 )\n                  v20 = v19;\n                *(_BYTE *)(v22 + a6) = v20;\n                v22 += a6;\n                v12 = v26 + 1;\n                goto LABEL_10;\n              }\n              LOBYTE(v11) = v27 - v17;\n              v27 -= v17;\n              if ( v15 - v17 >= v14 )\n                LOBYTE(v11) = v11 + 1;\n            }\n            if ( (unsigned __int8)v11 != 9 )\n              break;\n            v15 = v27;\n            if ( (v27 & 0x100) == 0 )\n              goto LABEL_28;\n            LOBYTE(v11) = v27 + 1;\n          }\n          sub_72C6C(a1);\n          return 19;\n        }\n      }\n      else\n      {\n        return 0;\n      }\n    }\n    else\n    {\n      return 31;\n    }\n  }\n  return result;\n}", "assembly": "; \n; sub_72CA8 from 0x72ca8 to 0x72df4 (332 bytes)\n; \n; 1 xrefs:\n; > sub_753C4 @ 0x770bc\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            {R4-R7,LR}                                             ; +0x0, 0x72ca8\nADD             R7, SP, #0xC                                           ; +0x2, 0x72caa\nPUSH.W          {R1-R11}                                               ; +0x4, 0x72cac\nMOV             R5, R0                                                 ; +0x8, 0x72cb0\nMOVS            R0, #0x1F                                              ; +0xa, 0x72cb2\nCMP             R1, #0                                                 ; +0xc, 0x72cb4\nBEQ.W           loc_72DE8                                              ; +0xe, 0x72cb6\nCMP             R2, #0                                                 ; +0x12, 0x72cba\nBEQ.W           loc_72DE8                                              ; +0x14, 0x72cbc\nLDR             R0, [R1]                                               ; +0x18, 0x72cc0\nMOV             R8, R1                                                 ; +0x1a, 0x72cc2\nCMP             R0, #0                                                 ; +0x1c, 0x72cc4\nBEQ.W           loc_72DE6                                              ; +0x1e, 0x72cc6\nADD             R6, SP, #0x1C+var_4                                    ; +0x22, 0x72cca\nMOV             R4, R3                                                 ; +0x24, 0x72ccc\nMOV.W           R11, #1                                                ; +0x26, 0x72cce\nSTR             R2, [SP,#0x1C+var_18]                                  ; +0x2a, 0x72cd2\nSTR.W           R8, [SP,#0x1C+var_1C]                                  ; +0x2c, 0x72cd4\nCMP             R4, #0                                                 ; +0x30, 0x72cd8\nBEQ.W           loc_72DF0                                              ; +0x32, 0x72cda\nMOV             R0, R5                                                 ; +0x36, 0x72cde\nMOV             R1, R8                                                 ; +0x38, 0x72ce0\nBL              sub_72BF8                                              ; +0x3a, 0x72ce2\nCMP             R0, #0                                                 ; +0x3e, 0x72ce6\nBNE             loc_72DE8                                              ; +0x40, 0x72ce8\nMOVS            R0, #0                                                 ; +0x42, 0x72cea\nCMP.W           R4, #0x8000                                            ; +0x44, 0x72cec\nSTR             R4, [SP,#0x1C+var_14]                                  ; +0x48, 0x72cf0\nIT GE                                                                  ; +0x4a, 0x72cf2\nMOVGE.W         R4, #0x8000                                            ; +0x4c, 0x72cf4\nSTR             R0, [SP,#0x1C+var_C]                                   ; +0x50, 0x72cf8\nMOVS            R0, #0                                                 ; +0x52, 0x72cfa\nSTR             R0, [SP,#0x1C+var_10]                                  ; +0x54, 0x72cfc\nUXTH.W          R8, R4                                                 ; +0x56, 0x72cfe\nMOV.W           R9, #9                                                 ; +0x5a, 0x72d02\nMOVS            R0, #0                                                 ; +0x5e, 0x72d06\nUXTH.W          R10, R0                                                ; +0x60, 0x72d08\nSTR             R0, [SP,#0x1C+var_8]                                   ; +0x64, 0x72d0c\nCMP             R8, R10                                                ; +0x66, 0x72d0e\nBLS             loc_72DCA                                              ; +0x68, 0x72d10\nUXTB.W          R4, R9                                                 ; +0x6a, 0x72d12\nMOV             R0, R5                                                 ; +0x6e, 0x72d16\nMOV             R1, R4                                                 ; +0x70, 0x72d18\nMOV             R2, R6                                                 ; +0x72, 0x72d1a\nBL              sub_72B92                                              ; +0x74, 0x72d1c\nCMP             R4, #6                                                 ; +0x78, 0x72d20\nBHI             loc_72D4E                                              ; +0x7a, 0x72d22\nSUBS            R0, R4, #1                                             ; +0x7c, 0x72d24\nLSL.W           R1, R11, R0                                            ; +0x7e, 0x72d26\nLDR             R0, [SP,#0x1C+var_4]                                   ; +0x82, 0x72d2a\nCMP             R0, R1                                                 ; +0x84, 0x72d2c\nBNE             loc_72D98                                              ; +0x86, 0x72d2e\nMOV             R0, R5                                                 ; +0x88, 0x72d30\nMOVS            R1, #3                                                 ; +0x8a, 0x72d32\nMOV             R2, R6                                                 ; +0x8c, 0x72d34\nBL              sub_72B92                                              ; +0x8e, 0x72d36\nLDR             R0, [SP,#0x1C+var_4]                                   ; +0x92, 0x72d3a\nADD.W           R9, R0, #1                                             ; +0x94, 0x72d3c\nSTR.W           R9, [SP,#0x1C+var_4]                                   ; +0x98, 0x72d40\nCMP             R9, R4                                                 ; +0x9c, 0x72d44\nIT CS                                                                  ; +0x9e, 0x72d46\nADDCS.W         R9, R0, #2                                             ; +0xa0, 0x72d48\nB               loc_72D0E                                              ; +0xa4, 0x72d4c\nCMP             R4, #8                                                 ; +0xa6, 0x72d4e\nBHI             loc_72D84                                              ; +0xa8, 0x72d50\nRSB.W           R0, R4, #9                                             ; +0xaa, 0x72d52\nMOVS            R1, #0xFF                                              ; +0xae, 0x72d56\nLSR.W           R0, R1, R0                                             ; +0xb0, 0x72d58\nADD.W           R2, R0, #0xFC                                          ; +0xb4, 0x72d5c\nLDR             R0, [SP,#0x1C+var_4]                                   ; +0xb8, 0x72d60\nUXTB            R1, R2                                                 ; +0xba, 0x72d62\nCMP             R0, R1                                                 ; +0xbc, 0x72d64\nBLS             loc_72D94                                              ; +0xbe, 0x72d66\nMOVS            R3, #8                                                 ; +0xc0, 0x72d68\nUXTAB.W         R2, R3, R2                                             ; +0xc2, 0x72d6a\nCMP             R0, R2                                                 ; +0xc6, 0x72d6e\nBHI             loc_72D94                                              ; +0xc8, 0x72d70\nSUB.W           R9, R0, R1                                             ; +0xca, 0x72d72\nSTR.W           R9, [SP,#0x1C+var_4]                                   ; +0xce, 0x72d76\nCMP             R9, R4                                                 ; +0xd2, 0x72d7a\nIT CS                                                                  ; +0xd4, 0x72d7c\nADDCS.W         R9, R9, #1                                             ; +0xd6, 0x72d7e\nB               loc_72D0E                                              ; +0xda, 0x72d82\nCMP             R4, #9                                                 ; +0xdc, 0x72d84\nBNE             loc_72DDC                                              ; +0xde, 0x72d86\nLDR             R0, [SP,#0x1C+var_4]                                   ; +0xe0, 0x72d88\nLSLS            R1, R0, #0x17                                          ; +0xe2, 0x72d8a\nBPL             loc_72DA4                                              ; +0xe4, 0x72d8c\nADD.W           R9, R0, #1                                             ; +0xe6, 0x72d8e\nB               loc_72D0E                                              ; +0xea, 0x72d92\nCMP             R4, #7                                                 ; +0xec, 0x72d94\nBHI             loc_72DA4                                              ; +0xee, 0x72d96\nRSB.W           R1, R9, #8                                             ; +0xf0, 0x72d98\nSXTB            R1, R1                                                 ; +0xf4, 0x72d9c\nLSLS            R0, R1                                                 ; +0xf6, 0x72d9e\nSXTB            R0, R0                                                 ; +0xf8, 0x72da0\nASRS            R0, R1                                                 ; +0xfa, 0x72da2\nLDR             R1, [SP,#0x1C+var_C]                                   ; +0xfc, 0x72da4\nLDR             R2, [SP,#0x1C+var_10]                                  ; +0xfe, 0x72da6\nADD             R1, R0                                                 ; +0x100, 0x72da8\nLDR             R0, [R7,#-0x1C+arg_0]                                  ; +0x102, 0x72daa\nADD             R2, R1                                                 ; +0x104, 0x72dac\nCMP             R0, #0                                                 ; +0x106, 0x72dae\nMOV             R0, R1                                                 ; +0x108, 0x72db0\nSTRD.W          R2, R1, [SP,#0x1C+var_10]                              ; +0x10a, 0x72db2\nIT NE                                                                  ; +0x10e, 0x72db6\nMOVNE           R0, R2                                                 ; +0x110, 0x72db8\nLDR             R1, [SP,#0x1C+var_18]                                  ; +0x112, 0x72dba\nLDR             R2, [R7,#-0x1C+arg_4]                                  ; +0x114, 0x72dbc\nSTRB            R0, [R1,R2]                                            ; +0x116, 0x72dbe\nADD             R1, R2                                                 ; +0x118, 0x72dc0\nLDR             R0, [SP,#0x1C+var_8]                                   ; +0x11a, 0x72dc2\nSTR             R1, [SP,#0x1C+var_18]                                  ; +0x11c, 0x72dc4\nADDS            R0, #1                                                 ; +0x11e, 0x72dc6\nB               loc_72D08                                              ; +0x120, 0x72dc8\nMOV             R0, R5                                                 ; +0x122, 0x72dca\nBL              sub_72C6C                                              ; +0x124, 0x72dcc\nLDR             R4, [SP,#0x1C+var_14]                                  ; +0x128, 0x72dd0\nSUB.W           R4, R4, R8                                             ; +0x12a, 0x72dd2\nLDR.W           R8, [SP,#0x1C+var_1C]                                  ; +0x12e, 0x72dd6\nB               loc_72CD8                                              ; +0x132, 0x72dda\nMOV             R0, R5                                                 ; +0x134, 0x72ddc\nBL              sub_72C6C                                              ; +0x136, 0x72dde\nMOVS            R0, #0x13                                              ; +0x13a, 0x72de2\nB               loc_72DE8                                              ; +0x13c, 0x72de4\nMOVS            R0, #0x1F                                              ; +0x13e, 0x72de6\nADD             SP, SP, #0x1C                                          ; +0x140, 0x72de8\nPOP.W           {R8-R11}                                               ; +0x142, 0x72dea\nPOP             {R4-R7,PC}                                             ; +0x146, 0x72dee\nMOVS            R0, #0                                                 ; +0x148, 0x72df0\nB               loc_72DE8                                              ; +0x14a, 0x72df2", "xrefs": ["sub_753C4 @ 0x770bc"], "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"}