//
// BN_MONT_CTX_copy from 0x9ea5b8 to 0x9ea630 (120 bytes)
//
// 3 xrefs:
// > EC_GROUP_copy @ 0x9ff558
// > ec_GFp_mont_group_copy @ 0xa048d4
// > ??> @ 0x7987c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:07:26 +0000
//
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;
}