//
// X509_chain_up_ref from 0xde6f50 to 0xde6f9c (76 bytes)
//
// 5 xrefs:
// > ssl_cert_dup @ 0xd3a13c
// > ssl_cert_set1_chain @ 0xd3a4c0
// > ssl_session_dup @ 0xd46204
// > X509_STORE_CTX_get1_chain @ 0xded640
// > ??> @ 0x57570
//
// 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
//
unsigned int *__fastcall X509_chain_up_ref(int *a1)
{
int v1; // w19
unsigned int *v2; // x20
__int64 v3; // x0
bool v4; // cc
int v5; // w1
unsigned int *result; // x0
v1 = 0;
v2 = (unsigned int *)OPENSSL_sk_dup(a1);
while ( 1 )
{
v4 = v1 < (int)OPENSSL_sk_num(v2);
v5 = v1;
result = v2;
++v1;
if ( !v4 )
break;
v3 = OPENSSL_sk_value((__int64)v2, v5);
X509_up_ref(v3);
}
return result;
}