//
// BN_mod_lshift_quick from 0xe19a70 to 0xe19b6c (252 bytes)
//
// 4 xrefs:
// > ec_GFp_simple_dbl @ 0xd99db4
// > ec_GFp_simple_dbl @ 0xd99e28
// > BN_mod_lshift @ 0xe19bb4
// > ??> @ 0xc0870
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall BN_mod_lshift_quick(unsigned __int64 *a1, __int64 a2, int a3, __int64 *a4)
{
int v7; // w19
int v8; // w19
if ( a1 != (unsigned __int64 *)a2 && !BN_copy(a1, a2) )
return 0;
while ( 1 )
{
if ( a3 <= 0 )
return 1;
v7 = BN_num_bits((__int64)a4);
v8 = v7 - BN_num_bits((__int64)a1);
if ( v8 < 0 )
break;
if ( v8 > a3 )
{
v8 = a3;
LABEL_13:
if ( !(unsigned int)BN_lshift((__int64)a1, (__int64 *)a1, v8) )
return 0;
a3 -= v8;
goto LABEL_9;
}
if ( v8 )
goto LABEL_13;
if ( !(unsigned int)BN_lshift1((__int64)a1, (__int64 *)a1) )
return 0;
--a3;
LABEL_9:
if ( (BN_cmp((__int64 *)a1, a4) & 0x80000000) == 0 && !(unsigned int)BN_sub((__int64)a1, (__int64)a1, (__int64)a4) )
return 0;
}
ERR_put_error(3, 119, 110, (__int64)"crypto/bn/bn_mod.c", 174);
return 0;
}