{"type": "func", "start": 8848544, "end": 8848800, "name": "BN_mod_lshift_quick", "pseudocode": "// \n// BN_mod_lshift_quick from 0x8704a0 to 0x8705a0 (256 bytes)\n// \n// 4 xrefs:\n// > ec_GFp_simple_dbl @ 0x7f3acc\n// > ec_GFp_simple_dbl @ 0x7f3b54\n// > BN_mod_lshift @ 0x8705e8\n// > <???> @ 0x6212c\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 BN_mod_lshift_quick(int *a1, int a2, int a3, int *a4)\n{\n  int v7; // r4\n  int v8; // r4\n\n  if ( a1 != (int *)a2 && !BN_copy((int)a1, a2) )\n    return 0;\n  while ( 1 )\n  {\n    if ( a3 <= 0 )\n      return 1;\n    v7 = BN_num_bits(a4);\n    v8 = v7 - BN_num_bits(a1);\n    if ( v8 < 0 )\n      break;\n    if ( v8 > a3 )\n    {\n      v8 = a3;\nLABEL_13:\n      if ( !BN_lshift(a1, a1, v8) )\n        return 0;\n      a3 -= v8;\n      goto LABEL_9;\n    }\n    if ( v8 )\n      goto LABEL_13;\n    if ( !BN_lshift1((int **)a1, (int **)a1) )\n      return 0;\n    --a3;\nLABEL_9:\n    if ( BN_cmp(a1, a4) >= 0 && !BN_sub(a1, a1, a4) )\n      return 0;\n  }\n  ERR_put_error(3, 119, 110, (int)\"crypto/bn/bn_mod.c\", 174);\n  return 0;\n}", "assembly": "; \n; BN_mod_lshift_quick from 0x8704a0 to 0x8705a0 (256 bytes)\n; \n; 4 xrefs:\n; > ec_GFp_simple_dbl @ 0x7f3acc\n; > ec_GFp_simple_dbl @ 0x7f3b54\n; > BN_mod_lshift @ 0x8705e8\n; > <???> @ 0x6212c\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\nCMP             R0, R1                                                 ; +0x0, 0x8704a0\nPUSH            {R4-R7,LR}                                             ; +0x4, 0x8704a4\nMOV             R5, R0                                                 ; +0x8, 0x8704a8\nSUB             SP, SP, #0xC                                           ; +0xc, 0x8704ac\nMOV             R6, R2                                                 ; +0x10, 0x8704b0\nMOV             R7, R3                                                 ; +0x14, 0x8704b4\nBEQ             loc_8704C8                                             ; +0x18, 0x8704b8\nBL              BN_copy                                                ; +0x1c, 0x8704bc\nCMP             R0, #0                                                 ; +0x20, 0x8704c0\nBEQ             loc_870540                                             ; +0x24, 0x8704c4\nCMP             R6, #0                                                 ; +0x28, 0x8704c8\nBLE             loc_870570                                             ; +0x2c, 0x8704cc\nMOV             R0, R7                                                 ; +0x30, 0x8704d0\nBL              BN_num_bits                                            ; +0x34, 0x8704d4\nMOV             R4, R0                                                 ; +0x38, 0x8704d8\nMOV             R0, R5                                                 ; +0x3c, 0x8704dc\nBL              BN_num_bits                                            ; +0x40, 0x8704e0\nSUBS            R4, R4, R0                                             ; +0x44, 0x8704e4\nBMI             loc_87057C                                             ; +0x48, 0x8704e8\nCMP             R4, R6                                                 ; +0x4c, 0x8704ec\nBGT             loc_87054C                                             ; +0x50, 0x8704f0\nCMP             R4, #0                                                 ; +0x54, 0x8704f4\nBNE             loc_870550                                             ; +0x58, 0x8704f8\nMOV             R0, R5                                                 ; +0x5c, 0x8704fc\nMOV             R1, R5                                                 ; +0x60, 0x870500\nBL              BN_lshift1                                             ; +0x64, 0x870504\nCMP             R0, #0                                                 ; +0x68, 0x870508\nBEQ             loc_870540                                             ; +0x6c, 0x87050c\nSUB             R6, R6, #1                                             ; +0x70, 0x870510\nMOV             R0, R5                                                 ; +0x74, 0x870514\nMOV             R1, R7                                                 ; +0x78, 0x870518\nBL              BN_cmp                                                 ; +0x7c, 0x87051c\nCMP             R0, #0                                                 ; +0x80, 0x870520\nBLT             loc_8704C8                                             ; +0x84, 0x870524\nMOV             R0, R5                                                 ; +0x88, 0x870528\nMOV             R1, R5                                                 ; +0x8c, 0x87052c\nMOV             R2, R7                                                 ; +0x90, 0x870530\nBL              BN_sub                                                 ; +0x94, 0x870534\nCMP             R0, #0                                                 ; +0x98, 0x870538\nBNE             loc_8704C8                                             ; +0x9c, 0x87053c\nMOV             R0, #0                                                 ; +0xa0, 0x870540\nADD             SP, SP, #0xC                                           ; +0xa4, 0x870544\nPOP             {R4-R7,PC}                                             ; +0xa8, 0x870548\nMOV             R4, R6                                                 ; +0xac, 0x87054c\nMOV             R0, R5                                                 ; +0xb0, 0x870550\nMOV             R1, R5                                                 ; +0xb4, 0x870554\nMOV             R2, R4                                                 ; +0xb8, 0x870558\nBL              BN_lshift                                              ; +0xbc, 0x87055c\nCMP             R0, #0                                                 ; +0xc0, 0x870560\nBEQ             loc_870540                                             ; +0xc4, 0x870564\nRSB             R6, R4, R6                                             ; +0xc8, 0x870568\nB               loc_870514                                             ; +0xcc, 0x87056c\nMOV             R0, #1                                                 ; +0xd0, 0x870570\nADD             SP, SP, #0xC                                           ; +0xd4, 0x870574\nPOP             {R4-R7,PC}                                             ; +0xd8, 0x870578\nMOV             R3, #0xAE                                              ; +0xdc, 0x87057c\nSTR             R3, [SP,#0xC+var_C]                                    ; +0xe0, 0x870580\nLDR             R3, =(aCryptoBnBnModC - 0x87059C); \"crypto/bn/bn_mod.c\" ; +0xe4, 0x870584\nMOV             R0, #3                                                 ; +0xe8, 0x870588\nMOV             R1, #0x77 ; 'w'                                        ; +0xec, 0x87058c\nMOV             R2, #0x6E ; 'n'                                        ; +0xf0, 0x870590\nADD             R3, PC, R3; \"crypto/bn/bn_mod.c\"                       ; +0xf4, 0x870594\nBL              ERR_put_error                                          ; +0xf8, 0x870598\nB               loc_870540                                             ; +0xfc, 0x87059c", "xrefs": ["ec_GFp_simple_dbl @ 0x7f3acc", "ec_GFp_simple_dbl @ 0x7f3b54", "BN_mod_lshift @ 0x8705e8", "<???> @ 0x6212c"], "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"}