//
// ec_GFp_simple_make_affine from 0xa097d4 to 0xa098ec (280 bytes)
//
// 4 xrefs:
// > ??> @ 0x7b9cc
// > ??> @ 0xd16df0
// > ??> @ 0xd16eb4
// > ??> @ 0xd16f78
//
// 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:42 +0000
//
int __fastcall ec_GFp_simple_make_affine(int a1, _DWORD *a2, int a3)
{
int v4; // r4
int v8; // r8
int v9; // r4
int v10; // r0
if ( a2[4] )
return 1;
v4 = EC_POINT_is_at_infinity(a1, a2);
if ( v4 )
return 1;
if ( a3 )
{
v8 = 0;
goto LABEL_8;
}
v10 = BN_CTX_new(0);
a3 = v10;
if ( !v10 )
return v4;
v8 = v10;
LABEL_8:
BN_CTX_start(a3);
BN_CTX_get(a3);
if ( BN_CTX_get(a3) && EC_POINT_get_affine_coordinates_GFp(a1, a2) && EC_POINT_set_affine_coordinates_GFp(a1, a2) )
{
if ( a2[4] )
{
v9 = 1;
}
else
{
v9 = 0;
ERR_put_error(16, 102, 68, "crypto/ec/ecp_smpl.c", 1188);
}
}
else
{
v9 = 0;
}
BN_CTX_end(a3);
BN_CTX_free(v8);
return v9;
}