//
// sub_10040A4 from 0x10040a4 to 0x1004138 (148 bytes)
//
// 2 xrefs:
// > ??> @ 0x13ffc48
// > ??> @ 0x13ffd20
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:15:55 +0000
//
__int64 __fastcall sub_10040A4(__int64 a1, __int64 a2, int a3)
{
__int64 v4; // x19
if ( *(_UNKNOWN **)(a1 + 16) == &dhx_asn1_meth )
{
v4 = d2i_DHxparams(0, a2, a3);
if ( v4 )
goto LABEL_3;
}
else
{
v4 = d2i_DHparams(0, a2, a3);
if ( v4 )
{
LABEL_3:
EVP_PKEY_assign(a1, **(unsigned int **)(a1 + 16), v4);
return 1;
}
}
ERR_put_error(5, 107, 5, "crypto/dh/dh_ameth.c", 255);
return (unsigned int)v4;
}