//
// BN_MONT_CTX_copy from 0xd7bf2c to 0xd7bfa8 (124 bytes)
//
// 3 xrefs:
// > EC_GROUP_copy @ 0xd91880
// > ec_GFp_mont_group_copy @ 0xd9655c
// > ??> @ 0x989a0
//
// 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_copy(__int64 result, int *a2)
{
__int64 v3; // x19
int v4; // w1
if ( (int *)result != a2 )
{
v3 = result;
if ( BN_copy((unsigned __int64 *)(result + 8), (__int64)(a2 + 2))
&& BN_copy((unsigned __int64 *)(v3 + 32), (__int64)(a2 + 8))
&& BN_copy((unsigned __int64 *)(v3 + 56), (__int64)(a2 + 14)) )
{
result = v3;
v4 = *a2;
*(_QWORD *)(v3 + 80) = *((_QWORD *)a2 + 10);
*(_DWORD *)v3 = v4;
*(_QWORD *)(v3 + 88) = *((_QWORD *)a2 + 11);
}
else
{
return 0;
}
}
return result;
}