//
// sub_9F8864 from 0x9f8864 to 0x9f8974 (272 bytes)
//
// 3 xrefs:
// > sub_9F8980 @ 0x9f9168
// > sub_9F9454 @ 0x9f94b4
// > sub_9F95DC @ 0x9f963c
//
// 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:33 +0000
//
int __fastcall sub_9F8864(int a1, int *a2)
{
int v3; // r4
int v4; // r0
int v5; // r0
int v6; // r5
int v8; // r2
int v9; // [sp+Ch] [bp-4h] BYREF
if ( a1 == 16 )
{
v8 = *a2;
v9 = a2[2];
v3 = d2i_ECParameters(0, &v9, v8);
if ( v3 )
return v3;
ERR_put_error(16, 220, 142, "crypto/ec/ec_ameth.c", 102);
}
else if ( a1 == 6 )
{
v3 = EC_KEY_new();
if ( v3 )
{
v4 = OBJ_obj2nid(a2);
v5 = EC_GROUP_new_by_curve_name(v4);
v6 = v5;
if ( v5 )
{
EC_GROUP_set_asn1_flag(v5, 1);
if ( EC_KEY_set_group(v3, v6) )
{
EC_GROUP_free(v6);
return v3;
}
}
}
else
{
ERR_put_error(16, 220, 65, "crypto/ec/ec_ameth.c", 113);
}
}
else
{
ERR_put_error(16, 220, 142, "crypto/ec/ec_ameth.c", 124);
v3 = 0;
}
EC_KEY_free(v3);
return 0;
}