//
// BN_lshift1 from 0xd7e8b0 to 0xd7e984 (212 bytes)
//
// 9 xrefs:
// > int_bn_mod_inverse @ 0xe18b3c
// > int_bn_mod_inverse @ 0xe18c80
// > BN_mod_lshift1 @ 0xe199e0
// > BN_mod_lshift1_quick @ 0xe19a24
// > BN_mod_lshift_quick @ 0xe19ad4
// > dsa_builtin_paramgen @ 0xe2ad38
// > dsa_builtin_paramgen2 @ 0xe2b6e8
// > BN_generate_prime_ex @ 0xe77978
// > ??> @ 0xc3918
//
// 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_lshift1(__int64 a1, __int64 *a2)
{
int v4; // w1
int v5; // w4
__int64 v6; // x2
__int64 v7; // x6
unsigned __int64 v8; // x1
unsigned __int64 v9; // x5
__int64 v10; // x3
__int64 v11; // x4
int v12; // w1
if ( (__int64 *)a1 == a2 )
{
if ( bn_wexpand((unsigned __int64 *)a1, *(_DWORD *)(a1 + 8) + 1) )
goto LABEL_4;
return 0;
}
v4 = *((_DWORD *)a2 + 2);
*(_DWORD *)(a1 + 16) = *((_DWORD *)a2 + 4);
if ( !bn_wexpand((unsigned __int64 *)a1, v4 + 1) )
return 0;
*(_DWORD *)(a1 + 8) = *((_DWORD *)a2 + 2);
LABEL_4:
v5 = *((_DWORD *)a2 + 2);
v6 = 0;
v7 = *a2;
v8 = 0;
v9 = *(_QWORD *)a1;
if ( v5 <= 0 )
return 1;
do
{
v10 = *(_QWORD *)(v7 + 8 * v6);
*(_QWORD *)(v9 + 8 * v6++) = v8 | (2 * v10);
v8 = (unsigned __int64)v10 >> 63;
}
while ( v5 > (int)v6 );
v11 = 8 * ((unsigned int)(v5 - 1) + 1LL);
if ( v10 >= 0 )
return 1;
v12 = *(_DWORD *)(a1 + 8);
*(_QWORD *)(v9 + v11) = 1;
*(_DWORD *)(a1 + 8) = v12 + 1;
return 1;
}