//
// EVP_PKEY_asn1_find from 0x7c20bc to 0x7c21a4 (232 bytes)
//
// 6 xrefs:
// > EVP_PKEY_set_type @ 0x8051c0
// > EVP_PKEY_set_type @ 0x805200
// > EVP_PKEY_set_type_str @ 0x805458
// > EVP_PKEY_type @ 0x8057bc
// > X509_signature_print @ 0x83d3d4
// > ??> @ 0x5e5bc
//
// 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 EVP_PKEY_asn1_find(int *a1, int a2)
{
int *v4; // r0
int v5; // r4
int v6; // r1
int pkey_asn1_meth_engine; // r0
_DWORD *v9; // [sp+Ch] [bp-78h] BYREF
_DWORD v10[29]; // [sp+10h] [bp-74h] BYREF
while ( 1 )
{
v9 = v10;
v10[0] = a2;
if ( !dword_AD2DDC )
break;
v6 = OPENSSL_sk_find(dword_AD2DDC, v10);
if ( v6 < 0 )
break;
v5 = OPENSSL_sk_value(dword_AD2DDC, v6);
if ( !v5 )
goto LABEL_9;
LABEL_4:
if ( (*(_DWORD *)(v5 + 8) & 1) == 0 )
goto LABEL_9;
a2 = *(_DWORD *)(v5 + 4);
}
v4 = (int *)OBJ_bsearch_(&v9, &off_AC0A28, 13, 4, sub_7C2034);
if ( v4 )
{
v5 = *v4;
if ( *v4 )
goto LABEL_4;
}
v5 = 0;
LABEL_9:
if ( a1 && (pkey_asn1_meth_engine = ENGINE_get_pkey_asn1_meth_engine(a2), (*a1 = pkey_asn1_meth_engine) != 0) )
return ENGINE_get_pkey_asn1_meth(pkey_asn1_meth_engine, a2);
else
return v5;
}