//
// BN_MONT_CTX_copy from 0xffa28c to 0xffa308 (124 bytes)
//
// 3 xrefs:
// > EC_GROUP_copy @ 0x100fbe0
// > ec_GFp_mont_group_copy @ 0x10148bc
// > ??> @ 0xc97d8
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:15:50 +0000
//
__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;
}