//
// BN_MONT_CTX_free from 0xd7bcd0 to 0xd7bd2c (92 bytes)
//
// 29 xrefs:
// > BN_MONT_CTX_set_locked @ 0xd7c02c
// > BN_MONT_CTX_set_locked @ 0xd7c050
// > sub_D877B4 @ 0xd877c0
// > sub_D89DFC @ 0xd89e08
// > EC_GROUP_free @ 0xd91610
// > EC_GROUP_clear_free @ 0xd916f4
// > EC_GROUP_copy @ 0xd91a00
// > ec_precompute_mont_data @ 0xd926ec
// > ec_precompute_mont_data @ 0xd92740
// > EC_GROUP_set_generator @ 0xd927f8
// > ec_GFp_mont_group_finish @ 0xd96334
// > ec_GFp_mont_group_clear_finish @ 0xd9636c
// > ec_GFp_mont_group_set_curve @ 0xd963c4
// > ec_GFp_mont_group_set_curve @ 0xd96434
// > ec_GFp_mont_group_set_curve @ 0xd964ec
// > ec_GFp_mont_group_copy @ 0xd96520
// > ec_GFp_mont_group_copy @ 0xd9658c
// > sub_DD4334 @ 0xdd4348
// > sub_DD4334 @ 0xdd4350
// > sub_DD4334 @ 0xdd4358
// > BN_mod_exp_mont_consttime @ 0xe16f3c
// > BN_mod_exp_mont_consttime @ 0xe16fac
// > BN_mod_exp_mont @ 0xe17344
// > BN_mod_exp_mont_word @ 0xe17920
// > BN_mod_exp2_mont @ 0xe18234
// > dsa_builtin_paramgen @ 0xe2abc4
// > dsa_builtin_paramgen2 @ 0xe2b30c
// > BN_is_prime_fasttest_ex @ 0xe76f5c
// > ??> @ 0xb47b0
//
// 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_MONT_CTX_free(__int64 result)
{
__int64 v1; // x19
if ( result )
{
v1 = result;
BN_clear_free((_BYTE *)(result + 8));
BN_clear_free((_BYTE *)(v1 + 32));
BN_clear_free((_BYTE *)(v1 + 56));
result = *(unsigned int *)(v1 + 96);
if ( (result & 1) != 0 )
return CRYPTO_free(v1, "crypto/bn/bn_mont.c", 244);
}
return result;
}