//
// BN_mask_bits from 0xd7b57c to 0xd7b5f4 (120 bytes)
//
// 3 xrefs:
// > dsa_builtin_paramgen @ 0xe2acfc
// > dsa_builtin_paramgen2 @ 0xe2b6ac
// > ??> @ 0x69528
//
// 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_mask_bits(__int64 a1, int a2)
{
int v2; // w2
unsigned int v3; // w3
int v4; // w1
__int64 v6; // x5
if ( a2 < 0 )
return 0;
v2 = a2 >> 6;
v3 = 0;
if ( a2 >> 6 < *(_DWORD *)(a1 + 8) )
{
v4 = a2 & 0x3F;
if ( v4 )
{
v6 = *(_QWORD *)a1;
*(_DWORD *)(a1 + 8) = v2 + 1;
*(_QWORD *)(v6 + 8LL * v2) &= ~(-1LL << v4);
}
else
{
*(_DWORD *)(a1 + 8) = v2;
}
bn_correct_top(a1);
return 1;
}
return v3;
}