//
// CMS_add0_CertificateChoices from 0xe200c8 to 0xe20198 (208 bytes)
//
// 2 xrefs:
// > CMS_add0_cert @ 0xe20288
// > ??> @ 0x5cb38
//
// 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 CMS_add0_CertificateChoices(__int64 *a1)
{
int v2; // w0
int **v3; // x20
__int64 v4; // x19
__int64 v5; // x0
int *v7; // x0
v2 = OBJ_obj2nid(*a1);
if ( v2 != 22 )
{
if ( v2 == 23 )
{
v3 = *(int ***)(a1[1] + 8);
if ( v3 )
goto LABEL_4;
}
else
{
ERR_put_error(46, 128, 152, (__int64)"crypto/cms/cms_lib.c", 354);
}
return 0;
}
v3 = (int **)(a1[1] + 24);
if ( a1[1] == -24 )
return 0;
LABEL_4:
if ( !*v3 )
{
v7 = (int *)OPENSSL_sk_new_null();
*v3 = v7;
if ( !v7 )
return 0;
}
v4 = ASN1_item_new((__int64)CMS_CertificateChoices_it);
if ( !v4 )
return 0;
if ( !(unsigned int)OPENSSL_sk_push(*v3, v4) )
{
v5 = v4;
v4 = 0;
ASN1_item_free(v5, CMS_CertificateChoices_it);
}
return v4;
}