//
// ec_GFp_simple_make_affine from 0x1019134 to 0x1019258 (292 bytes)
//
// 4 xrefs:
// > ??> @ 0x9f910
// > ??> @ 0x1539f60
// > ??> @ 0x153a0e0
// > ??> @ 0x153a260
//
// 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:16:06 +0000
//
__int64 __fastcall ec_GFp_simple_make_affine(__int64 a1, __int64 a2, __int64 a3)
{
unsigned int v6; // w19
__int64 v8; // x0
__int64 v9; // x1
__int64 v10; // x2
__int64 v11; // x23
unsigned int v12; // w19
__int64 v13; // x0
if ( *(_DWORD *)(a2 + 32) )
return 1;
v8 = EC_POINT_is_at_infinity(a1, (_QWORD *)a2);
v6 = v8;
if ( (_DWORD)v8 )
return 1;
v11 = 0;
if ( a3 )
goto LABEL_6;
v13 = BN_CTX_new(v8, v9, v10);
a3 = v13;
if ( !v13 )
return v6;
v11 = v13;
LABEL_6:
BN_CTX_start(a3);
BN_CTX_get(a3);
if ( BN_CTX_get(a3)
&& (unsigned int)EC_POINT_get_affine_coordinates_GFp(a1, (_QWORD *)a2)
&& (unsigned int)EC_POINT_set_affine_coordinates_GFp(a1, (_QWORD *)a2) )
{
v12 = 1;
if ( !*(_DWORD *)(a2 + 32) )
{
v12 = 0;
ERR_put_error(16, 102, 68, "crypto/ec/ecp_smpl.c", 1188);
}
}
else
{
v12 = 0;
}
BN_CTX_end(a3);
BN_CTX_free(v11);
return v12;
}