//
// BN_from_montgomery from 0xd7bbb8 to 0xd7bc4c (148 bytes)
//
// 6 xrefs:
// > ec_GFp_mont_field_decode @ 0xd966dc
// > BN_mod_exp_mont_consttime @ 0xe16f98
// > BN_mod_exp_mont @ 0xe173e8
// > BN_mod_exp_mont_word @ 0xe17788
// > BN_mod_exp2_mont @ 0xe1855c
// > ??> @ 0x5b530
//
// 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_from_montgomery(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
unsigned __int64 *v7; // x0
__int64 v8; // x20
unsigned int v9; // w20
BN_CTX_start(a4);
v7 = (unsigned __int64 *)BN_CTX_get(a4);
v8 = (__int64)v7;
if ( v7 && BN_copy(v7, a2) )
{
v9 = sub_D7B5F4(a1, v8, a3);
BN_CTX_end(a4);
return v9;
}
else
{
BN_CTX_end(a4);
return 0;
}
}