//
// BN_MONT_CTX_free from 0x7d570c to 0x7d5758 (76 bytes)
//
// 29 xrefs:
// > BN_MONT_CTX_set_locked @ 0x7d5aa4
// > BN_MONT_CTX_set_locked @ 0x7d5ac0
// > sub_7DFFD4 @ 0x7dffdc
// > sub_7E2548 @ 0x7e2550
// > EC_GROUP_free @ 0x7ea6f0
// > EC_GROUP_clear_free @ 0x7ea7bc
// > EC_GROUP_copy @ 0x7eaaf8
// > ec_precompute_mont_data @ 0x7eb8f4
// > ec_precompute_mont_data @ 0x7eb944
// > EC_GROUP_set_generator @ 0x7eb9e4
// > ec_GFp_mont_group_finish @ 0x7efac0
// > ec_GFp_mont_group_clear_finish @ 0x7efaf0
// > ec_GFp_mont_group_set_curve @ 0x7efb34
// > ec_GFp_mont_group_set_curve @ 0x7efbac
// > ec_GFp_mont_group_set_curve @ 0x7efc30
// > ec_GFp_mont_group_copy @ 0x7efc8c
// > ec_GFp_mont_group_copy @ 0x7efd10
// > sub_82DD88 @ 0x82dd94
// > sub_82DD88 @ 0x82dd9c
// > sub_82DD88 @ 0x82dda4
// > BN_mod_exp_mont_consttime @ 0x86d7bc
// > BN_mod_exp_mont_consttime @ 0x86d81c
// > BN_mod_exp_mont @ 0x86dcac
// > BN_mod_exp_mont_word @ 0x86e208
// > BN_mod_exp2_mont @ 0x86eb20
// > dsa_builtin_paramgen @ 0x88093c
// > dsa_builtin_paramgen2 @ 0x880e00
// > BN_is_prime_fasttest_ex @ 0x8caa58
// > ??> @ 0x5fd9c
//
// 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
//
_BYTE *__fastcall BN_MONT_CTX_free(_BYTE *result)
{
_BYTE *v1; // r4
if ( result )
{
v1 = result;
BN_clear_free(result + 4);
BN_clear_free(v1 + 24);
result = BN_clear_free(v1 + 44);
if ( (*((_DWORD *)v1 + 18) & 1) != 0 )
return (_BYTE *)CRYPTO_free(v1, "crypto/bn/bn_mont.c", 244);
}
return result;
}