//
// sub_E349A4 from 0xe349a4 to 0xe34a58 (180 bytes)
//
// 1 xrefs:
// > ??> @ 0x1132f10
//
// 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 sub_E349A4(__int64 a1, __int64 a2)
{
__int64 *v4; // x22
_QWORD *v5; // x21
__int64 v6; // x1
v4 = *(__int64 **)(a1 + 40);
if ( !*(_QWORD *)(a1 + 16) && !*v4 )
{
ERR_put_error(16, 199, 139, (__int64)"crypto/ec/ec_pmeth.c", 410);
return 0;
}
v5 = (_QWORD *)EC_KEY_new();
if ( v5 )
{
EVP_PKEY_assign(a2, 0x198u, (__int64)v5);
v6 = *(_QWORD *)(a1 + 16);
if ( !v6 )
{
if ( !(unsigned int)EC_KEY_set_group(v5, *v4) )
return 0;
return EC_KEY_generate_key(*(_QWORD **)(a2 + 32));
}
if ( (unsigned int)EVP_PKEY_copy_parameters((_DWORD *)a2, v6) )
return EC_KEY_generate_key(*(_QWORD **)(a2 + 32));
}
return 0;
}