//
// ec_GF2m_simple_cmp from 0x889f78 to 0x88a108 (400 bytes)
//
// 2 xrefs:
// > ??> @ 0x6a9ec
// > ??> @ 0xab4fdc
//
// 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
//
int __fastcall ec_GF2m_simple_cmp(int a1, int a2, int a3, int ***a4)
{
void **v8; // r8
int *v9; // r9
int *v10; // r10
int *v11; // r11
int v12; // r5
void **v14; // r0
int *v15; // [sp+Ch] [bp-8h]
if ( EC_POINT_is_at_infinity(a1, (_DWORD *)a2) )
return EC_POINT_is_at_infinity(a1, (_DWORD *)a3) == 0;
if ( EC_POINT_is_at_infinity(a1, (_DWORD *)a3) )
return 1;
if ( *(_DWORD *)(a2 + 16) && *(_DWORD *)(a3 + 16) )
{
if ( BN_cmp(*(int **)(a2 + 4), *(int **)(a3 + 4)) )
return 1;
return BN_cmp(*(int **)(a2 + 8), *(int **)(a3 + 8)) != 0;
}
else
{
if ( a4 )
{
v8 = nullptr;
}
else
{
v14 = (void **)BN_CTX_new();
v8 = v14;
if ( !v14 )
return -1;
a4 = (int ***)v14;
}
BN_CTX_start((int)a4);
v9 = (int *)BN_CTX_get(a4);
v10 = (int *)BN_CTX_get(a4);
v11 = (int *)BN_CTX_get(a4);
v15 = (int *)BN_CTX_get(a4);
if ( v15
&& EC_POINT_get_affine_coordinates_GF2m(a1, (_DWORD *)a2)
&& EC_POINT_get_affine_coordinates_GF2m(a1, (_DWORD *)a3) )
{
if ( BN_cmp(v9, v11) )
v12 = 1;
else
v12 = BN_cmp(v10, v15) != 0;
}
else
{
v12 = -1;
}
BN_CTX_end(a4);
BN_CTX_free(v8);
return v12;
}
}