//
// sub_DF58B4 from 0xdf58b4 to 0xdf5a10 (348 bytes)
//
// 3 xrefs:
// > X509v3_addr_add_inherit @ 0xdf5de4
// > X509v3_addr_add_prefix @ 0xdf5e88
// > X509v3_addr_add_range @ 0xdf6050
//
// 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_DF58B4(unsigned int *a1, __int16 a2, _DWORD *a3)
{
size_t v4; // x23
unsigned int v5; // w22
int v6; // w19
__int64 v7; // x0
__int64 *v8; // x20
const void *v9; // x4
__int64 v10; // x0
__int64 v11; // x0
__int64 v13; // x0
_BYTE v14[8]; // [xsp+48h] [xbp+48h] BYREF
v14[0] = HIBYTE(a2);
v14[1] = a2;
if ( a3 )
{
v4 = 3;
v14[2] = *a3;
v5 = 3;
}
else
{
v4 = 2;
v5 = 2;
}
v6 = 0;
while ( v6 < (int)OPENSSL_sk_num(a1) )
{
v7 = OPENSSL_sk_value((__int64)a1, v6);
v8 = (__int64 *)v7;
v9 = *(const void **)(*(_QWORD *)v7 + 8LL);
if ( !v9 )
OPENSSL_die("assertion failed: f->addressFamily->data != NULL", "crypto/x509v3/v3_addr.c", 499);
if ( **(_DWORD **)v7 == v5 )
{
if ( !memcmp(v9, v14, v4) )
return v8;
++v6;
}
else
{
++v6;
}
}
v10 = IPAddressFamily_new();
v8 = (__int64 *)v10;
if ( v10 )
{
if ( *(_QWORD *)(v10 + 8) || (v13 = IPAddressChoice_new(), (v8[1] = v13) != 0) )
{
v11 = *v8;
if ( *v8 || (v11 = ASN1_OCTET_STRING_new(), (*v8 = v11) != 0) )
{
if ( (unsigned int)ASN1_OCTET_STRING_set(v11, v14, v5) && (unsigned int)OPENSSL_sk_push((int *)a1, (__int64)v8) )
return v8;
}
}
}
IPAddressFamily_free((__int64)v8);
return nullptr;
}