{"type": "func", "start": 334610, "end": 334674, "name": "sub_51B12", "pseudocode": "// \n// sub_51B12 from 0x51b12 to 0x51b52 (64 bytes)\n// \n// 1 xrefs:\n// > sub_588D0 @ 0x588f6\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_51B12(int a1, int a2, int a3, int *a4)\n{\n  int result; // r0\n  int *v9; // r0\n\n  result = 31;\n  if ( a3 >= 0 && a4 )\n  {\n    v9 = (int *)sub_51802(a1, a2, a3, (int)a4);\n    if ( v9 )\n    {\n      if ( *v9 > a3 )\n      {\n        a2 = *(_DWORD *)(v9[1] + 4 * a3);\nLABEL_8:\n        *a4 = a2;\n        return 0;\n      }\n    }\n    else if ( !a3 )\n    {\n      goto LABEL_8;\n    }\n    return 31;\n  }\n  return result;\n}", "assembly": "; \n; sub_51B12 from 0x51b12 to 0x51b52 (64 bytes)\n; \n; 1 xrefs:\n; > sub_588D0 @ 0x588f6\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, 0x51b12\nADD             R7, SP, #0xC                                           ; +0x2, 0x51b14\nPUSH.W          {R11}                                                  ; +0x4, 0x51b16\nMOV             R6, R1                                                 ; +0x8, 0x51b1a\nMOV             R1, R0                                                 ; +0xa, 0x51b1c\nMOVS            R0, #0x1F                                              ; +0xc, 0x51b1e\nCMP             R2, #0                                                 ; +0xe, 0x51b20\nBMI             loc_51B4C                                              ; +0x10, 0x51b22\nMOV             R4, R3                                                 ; +0x12, 0x51b24\nCBZ             R3, loc_51B4C                                          ; +0x14, 0x51b26\nMOV             R0, R1                                                 ; +0x16, 0x51b28\nMOV             R1, R6                                                 ; +0x18, 0x51b2a\nMOV             R5, R2                                                 ; +0x1a, 0x51b2c\nBL              sub_51802                                              ; +0x1c, 0x51b2e\nCBZ             R0, loc_51B42                                          ; +0x20, 0x51b32\nLDR             R1, [R0]                                               ; +0x22, 0x51b34\nCMP             R1, R5                                                 ; +0x24, 0x51b36\nBLE             loc_51B44                                              ; +0x26, 0x51b38\nLDR             R0, [R0,#4]                                            ; +0x28, 0x51b3a\nLDR.W           R6, [R0,R5,LSL#2]                                      ; +0x2a, 0x51b3c\nB               loc_51B48                                              ; +0x2e, 0x51b40\nCBZ             R5, loc_51B48                                          ; +0x30, 0x51b42\nMOVS            R0, #0x1F                                              ; +0x32, 0x51b44\nB               loc_51B4C                                              ; +0x34, 0x51b46\nMOVS            R0, #0                                                 ; +0x36, 0x51b48\nSTR             R6, [R4]                                               ; +0x38, 0x51b4a\nPOP.W           {R11}                                                  ; +0x3a, 0x51b4c\nPOP             {R4-R7,PC}                                             ; +0x3e, 0x51b50", "xrefs": ["sub_588D0 @ 0x588f6"], "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"}