//
// BN_mod_lshift_quick from 0x8704a0 to 0x8705a0 (256 bytes)
//
// 4 xrefs:
// > ec_GFp_simple_dbl @ 0x7f3acc
// > ec_GFp_simple_dbl @ 0x7f3b54
// > BN_mod_lshift @ 0x8705e8
// > ??> @ 0x6212c
//
// 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
//
int __fastcall BN_mod_lshift_quick(int *a1, int a2, int a3, int *a4)
{
int v7; // r4
int v8; // r4
if ( a1 != (int *)a2 && !BN_copy((int)a1, a2) )
return 0;
while ( 1 )
{
if ( a3 <= 0 )
return 1;
v7 = BN_num_bits(a4);
v8 = v7 - BN_num_bits(a1);
if ( v8 < 0 )
break;
if ( v8 > a3 )
{
v8 = a3;
LABEL_13:
if ( !BN_lshift(a1, a1, v8) )
return 0;
a3 -= v8;
goto LABEL_9;
}
if ( v8 )
goto LABEL_13;
if ( !BN_lshift1((int **)a1, (int **)a1) )
return 0;
--a3;
LABEL_9:
if ( BN_cmp(a1, a4) >= 0 && !BN_sub(a1, a1, a4) )
return 0;
}
ERR_put_error(3, 119, 110, (int)"crypto/bn/bn_mod.c", 174);
return 0;
}