{"type": "func", "start": 14785136, "end": 14785388, "name": "BN_mod_lshift_quick", "pseudocode": "// \n// BN_mod_lshift_quick from 0xe19a70 to 0xe19b6c (252 bytes)\n// \n// 4 xrefs:\n// > ec_GFp_simple_dbl @ 0xd99db4\n// > ec_GFp_simple_dbl @ 0xd99e28\n// > BN_mod_lshift @ 0xe19bb4\n// > <???> @ 0xc0870\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\n__int64 __fastcall BN_mod_lshift_quick(unsigned __int64 *a1, __int64 a2, int a3, __int64 *a4)\n{\n  int v7; // w19\n  int v8; // w19\n\n  if ( a1 != (unsigned __int64 *)a2 && !BN_copy(a1, a2) )\n    return 0;\n  while ( 1 )\n  {\n    if ( a3 <= 0 )\n      return 1;\n    v7 = BN_num_bits((__int64)a4);\n    v8 = v7 - BN_num_bits((__int64)a1);\n    if ( v8 < 0 )\n      break;\n    if ( v8 > a3 )\n    {\n      v8 = a3;\nLABEL_13:\n      if ( !(unsigned int)BN_lshift((__int64)a1, (__int64 *)a1, v8) )\n        return 0;\n      a3 -= v8;\n      goto LABEL_9;\n    }\n    if ( v8 )\n      goto LABEL_13;\n    if ( !(unsigned int)BN_lshift1((__int64)a1, (__int64 *)a1) )\n      return 0;\n    --a3;\nLABEL_9:\n    if ( (BN_cmp((__int64 *)a1, a4) & 0x80000000) == 0 && !(unsigned int)BN_sub((__int64)a1, (__int64)a1, (__int64)a4) )\n      return 0;\n  }\n  ERR_put_error(3, 119, 110, (__int64)\"crypto/bn/bn_mod.c\", 174);\n  return 0;\n}", "assembly": "; \n; BN_mod_lshift_quick from 0xe19a70 to 0xe19b6c (252 bytes)\n; \n; 4 xrefs:\n; > ec_GFp_simple_dbl @ 0xd99db4\n; > ec_GFp_simple_dbl @ 0xd99e28\n; > BN_mod_lshift @ 0xe19bb4\n; > <???> @ 0xc0870\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\nSTP             X29, X30, [SP,#-0x30+var_s0]!                          ; +0x0, 0xe19a70\nCMP             X0, X1                                                 ; +0x4, 0xe19a74\nMOV             X29, SP                                                ; +0x8, 0xe19a78\nSTP             X21, X22, [SP,#var_s20]                                ; +0xc, 0xe19a7c\nSTP             X19, X20, [SP,#var_s10]                                ; +0x10, 0xe19a80\nMOV             W21, W2                                                ; +0x14, 0xe19a84\nMOV             X20, X0                                                ; +0x18, 0xe19a88\nMOV             X22, X3                                                ; +0x1c, 0xe19a8c\nB.EQ            loc_E19A9C                                             ; +0x20, 0xe19a90\nBL              BN_copy                                                ; +0x24, 0xe19a94\nCBZ             X0, loc_E19B04                                         ; +0x28, 0xe19a98\nCMP             W21, WZR                                               ; +0x2c, 0xe19a9c\nB.LE            loc_E19B38                                             ; +0x30, 0xe19aa0\nMOV             X0, X22                                                ; +0x34, 0xe19aa4\nBL              BN_num_bits                                            ; +0x38, 0xe19aa8\nMOV             W19, W0                                                ; +0x3c, 0xe19aac\nMOV             X0, X20                                                ; +0x40, 0xe19ab0\nBL              BN_num_bits                                            ; +0x44, 0xe19ab4\nSUBS            W19, W19, W0                                           ; +0x48, 0xe19ab8\nB.MI            loc_E19B4C                                             ; +0x4c, 0xe19abc\nCMP             W19, W21                                               ; +0x50, 0xe19ac0\nB.GT            loc_E19B18                                             ; +0x54, 0xe19ac4\nCBNZ            W19, loc_E19B1C                                        ; +0x58, 0xe19ac8\nMOV             X0, X20                                                ; +0x5c, 0xe19acc\nMOV             X1, X20                                                ; +0x60, 0xe19ad0\nBL              BN_lshift1                                             ; +0x64, 0xe19ad4\nCBZ             W0, loc_E19B04                                         ; +0x68, 0xe19ad8\nSUB             W21, W21, #1                                           ; +0x6c, 0xe19adc\nMOV             X0, X20                                                ; +0x70, 0xe19ae0\nMOV             X1, X22                                                ; +0x74, 0xe19ae4\nBL              BN_cmp                                                 ; +0x78, 0xe19ae8\nTBNZ            W0, #0x1F, loc_E19A9C                                  ; +0x7c, 0xe19aec\nMOV             X0, X20                                                ; +0x80, 0xe19af0\nMOV             X1, X20                                                ; +0x84, 0xe19af4\nMOV             X2, X22                                                ; +0x88, 0xe19af8\nBL              BN_sub                                                 ; +0x8c, 0xe19afc\nCBNZ            W0, loc_E19A9C                                         ; +0x90, 0xe19b00\nMOV             W0, #0                                                 ; +0x94, 0xe19b04\nLDP             X19, X20, [SP,#var_s10]                                ; +0x98, 0xe19b08\nLDP             X21, X22, [SP,#var_s20]                                ; +0x9c, 0xe19b0c\nLDP             X29, X30, [SP+var_s0],#0x30                            ; +0xa0, 0xe19b10\nRET                                                                    ; +0xa4, 0xe19b14\nMOV             W19, W21                                               ; +0xa8, 0xe19b18\nMOV             X0, X20                                                ; +0xac, 0xe19b1c\nMOV             X1, X20                                                ; +0xb0, 0xe19b20\nMOV             W2, W19                                                ; +0xb4, 0xe19b24\nBL              BN_lshift                                              ; +0xb8, 0xe19b28\nCBZ             W0, loc_E19B04                                         ; +0xbc, 0xe19b2c\nSUB             W21, W21, W19                                          ; +0xc0, 0xe19b30\nB               loc_E19AE0                                             ; +0xc4, 0xe19b34\nMOV             W0, #1                                                 ; +0xc8, 0xe19b38\nLDP             X19, X20, [SP,#var_s10]                                ; +0xcc, 0xe19b3c\nLDP             X21, X22, [SP,#var_s20]                                ; +0xd0, 0xe19b40\nLDP             X29, X30, [SP+var_s0],#0x30                            ; +0xd4, 0xe19b44\nRET                                                                    ; +0xd8, 0xe19b48\nADRP            X3, #aCryptoBnBnModC@PAGE; \"crypto/bn/bn_mod.c\"        ; +0xdc, 0xe19b4c\nMOV             W0, #3                                                 ; +0xe0, 0xe19b50\nMOV             W1, #0x77 ; 'w'                                        ; +0xe4, 0xe19b54\nMOV             W2, #0x6E ; 'n'                                        ; +0xe8, 0xe19b58\nADD             X3, X3, #aCryptoBnBnModC@PAGEOFF; \"crypto/bn/bn_mod.c\" ; +0xec, 0xe19b5c\nMOV             W4, #0xAE                                              ; +0xf0, 0xe19b60\nBL              ERR_put_error                                          ; +0xf4, 0xe19b64\nB               loc_E19B04                                             ; +0xf8, 0xe19b68", "xrefs": ["ec_GFp_simple_dbl @ 0xd99db4", "ec_GFp_simple_dbl @ 0xd99e28", "BN_mod_lshift @ 0xe19bb4", "<???> @ 0xc0870"], "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"}