//
// BN_MONT_CTX_copy from 0x7d59b8 to 0x7d5a30 (120 bytes)
//
// 3 xrefs:
// > EC_GROUP_copy @ 0x7ea958
// > ec_GFp_mont_group_copy @ 0x7efcd4
// > ??> @ 0x5fdfc
//
// 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
//
int *__fastcall BN_MONT_CTX_copy(int *result, int *a2)
{
int *v3; // r4
int v4; // r3
if ( result != a2 )
{
v3 = result;
if ( BN_copy((int)(result + 1), (int)(a2 + 1))
&& BN_copy((int)(v3 + 6), (int)(a2 + 6))
&& BN_copy((int)(v3 + 11), (int)(a2 + 11)) )
{
v4 = *a2;
v3[16] = a2[16];
v3[17] = a2[17];
*v3 = v4;
return v3;
}
else
{
return nullptr;
}
}
return result;
}