//
// ec_GFp_simple_get_Jprojective_coordinates_GFp from 0xd99360 to 0xd994c4 (356 bytes)
//
// 4 xrefs:
// > ??> @ 0x70b18
// > ??> @ 0x1222178
// > ??> @ 0x12222f8
// > ??> @ 0x1222478
//
// 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 ec_GFp_simple_get_Jprojective_coordinates_GFp(
__int64 a1,
__int64 *a2,
unsigned __int64 *a3,
unsigned __int64 *a4,
unsigned __int64 *a5,
__int64 a6)
{
__int64 v7; // x2
__int64 v12; // x23
unsigned __int64 *v13; // x1
_BOOL4 v14; // w19
int v15; // w0
__int64 result; // x0
int v17; // w0
__int64 v18; // [xsp+48h] [xbp+48h]
__int64 v19; // [xsp+48h] [xbp+48h]
v7 = *(_QWORD *)(*(_QWORD *)a1 + 296LL);
if ( !v7 )
{
if ( a3 && !BN_copy(a3, a2[1]) || a4 && !BN_copy(a4, a2[2]) )
{
v14 = 0;
v12 = 0;
}
else if ( a5 )
{
v12 = 0;
v14 = BN_copy(a5, a2[3]) != nullptr;
}
else
{
v14 = 1;
v12 = 0;
}
goto LABEL_5;
}
v12 = 0;
if ( a6 )
{
LABEL_3:
if ( !a3
|| (v13 = a3,
v18 = a6,
v14 = 0,
v15 = (*(__int64 (__fastcall **)(__int64, unsigned __int64 *, __int64, __int64))(*(_QWORD *)a1 + 296LL))(
a1,
v13,
a2[1],
a6),
a6 = v18,
v15) )
{
if ( !a4
|| (v19 = a6,
v14 = 0,
v17 = (*(__int64 (__fastcall **)(__int64, unsigned __int64 *, __int64, __int64))(*(_QWORD *)a1 + 296LL))(
a1,
a4,
a2[2],
a6),
a6 = v19,
v17) )
{
v14 = 1;
if ( a5 )
v14 = (*(__int64 (__fastcall **)(__int64, unsigned __int64 *, __int64, __int64))(*(_QWORD *)a1 + 296LL))(
a1,
a5,
a2[3],
a6) != 0;
}
}
LABEL_5:
BN_CTX_free(v12);
return v14;
}
result = BN_CTX_new(a1, a2, v7);
a6 = result;
if ( result )
{
v12 = result;
goto LABEL_3;
}
return result;
}