//
// X509_STORE_add_lookup from 0x1065bcc to 0x1065c88 (188 bytes)
//
// 8 xrefs:
// > sub_E2DA90 @ 0xe2e2c0
// > SSL_CTX_set_default_verify_dir @ 0xfc06f4
// > SSL_CTX_set_default_verify_file @ 0xfc074c
// > X509_STORE_set_default_paths @ 0x10652f8
// > X509_STORE_set_default_paths @ 0x1065320
// > X509_STORE_load_locations @ 0x106538c
// > X509_STORE_load_locations @ 0x10653d4
// > ??> @ 0xe13b8
//
// 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:53 +0000
//
__int64 __fastcall X509_STORE_add_lookup(__int64 a1, __int64 a2)
{
int v2; // w19
unsigned int *v5; // x20
__int64 result; // x0
bool v7; // cc
int v8; // w1
_QWORD *v9; // x19
int *v10; // x0
int v11; // w0
_QWORD *v12; // x2
v2 = 0;
v5 = *(unsigned int **)(a1 + 16);
while ( 1 )
{
v7 = v2 < (int)OPENSSL_sk_num(v5);
v8 = v2++;
if ( !v7 )
break;
result = OPENSSL_sk_value((__int64)v5, v8);
if ( *(_QWORD *)(result + 8) == a2 )
return result;
}
v9 = X509_LOOKUP_new(a2);
if ( !v9 )
return 0;
v10 = *(int **)(a1 + 16);
v9[3] = a1;
v11 = OPENSSL_sk_push(v10, (__int64)v9);
v12 = v9;
if ( !v11 )
{
X509_LOOKUP_free(v9);
return 0;
}
return (__int64)v12;
}