//
// X509_ATTRIBUTE_create_by_OBJ from 0x10643e8 to 0x1064508 (288 bytes)
//
// 4 xrefs:
// > X509at_add1_attr_by_OBJ @ 0x106451c
// > X509_ATTRIBUTE_create_by_NID @ 0x1064594
// > X509_ATTRIBUTE_create_by_txt @ 0x1064678
// > ??> @ 0xe7f28
//
// 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:16:52 +0000
//
__int64 *__fastcall X509_ATTRIBUTE_create_by_OBJ(__int64 **a1, __int64 a2, unsigned int a3, char *a4, unsigned int a5)
{
__int64 *v10; // x19
__int64 *result; // x0
__int64 *v12; // x0
if ( !a1 || (v10 = *a1) == nullptr )
{
v12 = (__int64 *)X509_ATTRIBUTE_new();
v10 = v12;
if ( !v12 )
{
ERR_put_error(11, 137, 65, (__int64)"crypto/x509/x509_att.c", 196);
return nullptr;
}
if ( X509_ATTRIBUTE_set1_object(v12, a2) && (unsigned int)X509_ATTRIBUTE_set1_data(v10, a3, a4, a5) )
{
result = v10;
if ( !a1 )
return result;
goto LABEL_8;
}
if ( !a1 || *a1 != v10 )
{
LABEL_5:
X509_ATTRIBUTE_free(v10);
return nullptr;
}
return nullptr;
}
if ( !X509_ATTRIBUTE_set1_object(*a1, a2) || !(unsigned int)X509_ATTRIBUTE_set1_data(v10, a3, a4, a5) )
{
if ( *a1 != v10 )
goto LABEL_5;
return nullptr;
}
LABEL_8:
result = v10;
if ( !*a1 )
*a1 = v10;
return result;
}