{"type": "func", "start": 378730, "end": 378858, "name": "sub_5C76A", "pseudocode": "// \n// sub_5C76A from 0x5c76a to 0x5c7ea (128 bytes)\n// \n// 2 xrefs:\n// > sub_5C686 @ 0x5c700\n// > sub_5C7EA @ 0x5c82c\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:40:49 +0000\n// \n\nint __fastcall sub_5C76A(int a1, unsigned int a2, unsigned int a3, int ***a4, unsigned int *a5)\n{\n  int **v5; // r5\n  unsigned int v7; // r3\n  int **v8; // r6\n  unsigned int v9; // r0\n  unsigned int v10; // r0\n  unsigned int v12; // r0\n\n  v5 = *(int ***)(a1 + 4);\n  v7 = -*(_DWORD *)(a1 + 20) & (*(_DWORD *)(a1 + 20) + 103);\n  v8 = v5;\n  while ( 1 )\n  {\n    if ( a2 )\n    {\n      v9 = *v8[7];\n      if ( v9 <= a2 && v9 + (_DWORD)v8[4] * v7 > a2 )\n      {\n        v12 = (a2 - v9) / v7;\n        goto LABEL_12;\n      }\n    }\n    if ( a3 )\n    {\n      v10 = (unsigned int)v8[6];\n      if ( v10 <= a3 && v10 + 12 * (_DWORD)v8[4] > a3 )\n        break;\n    }\n    v8 = (int **)*v8;\n    if ( v5 == v8 )\n      return 30;\n  }\n  v12 = (int)(a3 - v10) / 12;\nLABEL_12:\n  if ( v12 == -1 )\n    return 30;\n  if ( a4 )\n    *a4 = v8;\n  if ( a5 )\n    *a5 = v12;\n  return 0;\n}", "assembly": "; \n; sub_5C76A from 0x5c76a to 0x5c7ea (128 bytes)\n; \n; 2 xrefs:\n; > sub_5C686 @ 0x5c700\n; > sub_5C7EA @ 0x5c82c\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:40:49 +0000\n; \nPUSH            {R4-R7,LR}                                             ; +0x0, 0x5c76a\nADD             R7, SP, #0xC                                           ; +0x2, 0x5c76c\nPUSH.W          {R8,R9,R11}                                            ; +0x4, 0x5c76e\nLDR             R5, [R0,#4]                                            ; +0x8, 0x5c772\nMOV             R9, R3                                                 ; +0xa, 0x5c774\nLDR             R0, [R0,#0x14]                                         ; +0xc, 0x5c776\nLDR.W           R8, [R7,#-0x18+arg_0]                                  ; +0xe, 0x5c778\nNEGS            R3, R0                                                 ; +0x12, 0x5c77c\nADDS            R0, #0x67 ; 'g'                                        ; +0x14, 0x5c77e\nANDS            R3, R0                                                 ; +0x16, 0x5c780\nMOV             R6, R5                                                 ; +0x18, 0x5c782\nCBZ             R1, loc_5C798                                          ; +0x1a, 0x5c784\nLDR             R0, [R6,#0x1C]                                         ; +0x1c, 0x5c786\nLDR             R0, [R0]                                               ; +0x1e, 0x5c788\nCMP             R0, R1                                                 ; +0x20, 0x5c78a\nBHI             loc_5C798                                              ; +0x22, 0x5c78c\nLDR             R4, [R6,#0x10]                                         ; +0x24, 0x5c78e\nMLA             R4, R4, R3, R0                                         ; +0x26, 0x5c790\nCMP             R4, R1                                                 ; +0x2a, 0x5c794\nBHI             loc_5C7B8                                              ; +0x2c, 0x5c796\nCBZ             R2, loc_5C7AE                                          ; +0x2e, 0x5c798\nLDR             R0, [R6,#0x18]                                         ; +0x30, 0x5c79a\nCMP             R0, R2                                                 ; +0x32, 0x5c79c\nBHI             loc_5C7AE                                              ; +0x34, 0x5c79e\nLDR             R4, [R6,#0x10]                                         ; +0x36, 0x5c7a0\nADD.W           R4, R4, R4,LSL#1                                       ; +0x38, 0x5c7a2\nADD.W           R4, R0, R4,LSL#2                                       ; +0x3c, 0x5c7a6\nCMP             R4, R2                                                 ; +0x40, 0x5c7aa\nBHI             loc_5C7C2                                              ; +0x42, 0x5c7ac\nLDR             R6, [R6]                                               ; +0x44, 0x5c7ae\nCMP             R5, R6                                                 ; +0x46, 0x5c7b0\nBNE             loc_5C784                                              ; +0x48, 0x5c7b2\nMOVS            R0, #0x1E                                              ; +0x4a, 0x5c7b4\nB               loc_5C7E4                                              ; +0x4c, 0x5c7b6\nSUBS            R0, R1, R0                                             ; +0x4e, 0x5c7b8\nMOV             R1, R3                                                 ; +0x50, 0x5c7ba\nBLX             j___aeabi_uidiv                                        ; +0x52, 0x5c7bc\nB               loc_5C7CA                                              ; +0x56, 0x5c7c0\nSUBS            R0, R2, R0                                             ; +0x58, 0x5c7c2\nMOVS            R1, #0xC                                               ; +0x5a, 0x5c7c4\nBLX             j___divsi3                                             ; +0x5c, 0x5c7c6\nADDS            R1, R0, #1                                             ; +0x60, 0x5c7ca\nBEQ             loc_5C7B4                                              ; +0x62, 0x5c7cc\nCMP.W           R9, #0                                                 ; +0x64, 0x5c7ce\nIT NE                                                                  ; +0x68, 0x5c7d2\nSTRNE.W         R6, [R9]                                               ; +0x6a, 0x5c7d4\nCMP.W           R8, #0                                                 ; +0x6e, 0x5c7d8\nIT NE                                                                  ; +0x72, 0x5c7dc\nSTRNE.W         R0, [R8]                                               ; +0x74, 0x5c7de\nMOVS            R0, #0                                                 ; +0x78, 0x5c7e2\nPOP.W           {R8,R9,R11}                                            ; +0x7a, 0x5c7e4\nPOP             {R4-R7,PC}                                             ; +0x7e, 0x5c7e8", "xrefs": ["sub_5C686 @ 0x5c700", "sub_5C7EA @ 0x5c82c"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "idp_name": "arm", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}