//
// OPENSSL_LH_retrieve from 0x1031dd8 to 0x1031ed8 (256 bytes)
//
// 24 xrefs:
// > SSL_load_client_CA_file @ 0xfb925c
// > SSL_has_matching_session_id @ 0xfbcd80
// > SSL_CTX_remove_session @ 0xfc49fc
// > SSL_CTX_add_session @ 0xfc4dc4
// > ssl_get_prev_session @ 0xfc527c
// > ERR_lib_error_string @ 0x101de88
// > ERR_func_error_string @ 0x101df2c
// > ERR_reason_error_string @ 0x101dfd4
// > ERR_reason_error_string @ 0x101e028
// > OBJ_NAME_get @ 0x103f664
// > OBJ_nid2obj @ 0x104046c
// > OBJ_nid2sn @ 0x1040548
// > OBJ_nid2ln @ 0x104062c
// > OBJ_obj2nid @ 0x1040814
// > OBJ_ln2nid @ 0x1040c20
// > OBJ_sn2nid @ 0x1040cb0
// > TXT_DB_get_by_index @ 0x105f51c
// > TXT_DB_insert @ 0x105f8cc
// > _CONF_get_section @ 0x10a1304
// > _CONF_get_string @ 0x10a1428
// > _CONF_get_string @ 0x10a1470
// > engine_table_register @ 0x10dc2ac
// > engine_table_select @ 0x10dc500
// > ??> @ 0x50968
//
// 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:20 +0000
//
__int64 __fastcall OPENSSL_LH_retrieve(__int64 a1, __int64 a2)
{
__int64 (__fastcall *v5)(__int64); // x1
unsigned __int64 v6; // x21
unsigned __int64 v7; // x1
unsigned __int64 v8; // x3
unsigned __int64 v9; // x2
unsigned int (__fastcall *v10)(__int64, __int64); // x24
__int64 **v11; // x22
__int64 *v12; // x19
__int64 v13; // x3
__int64 v14; // x0
__int64 result; // x0
v5 = *(__int64 (__fastcall **)(__int64))(a1 + 16);
*(_DWORD *)(a1 + 168) = 0;
v6 = v5(a2);
v7 = *(unsigned int *)(a1 + 36);
v8 = *(unsigned int *)(a1 + 32);
++*(_QWORD *)(a1 + 96);
v9 = v6 % v7;
if ( v6 % v7 < v8 )
v9 = v6 % *(unsigned int *)(a1 + 28);
v10 = *(unsigned int (__fastcall **)(__int64, __int64))(a1 + 8);
v11 = (__int64 **)(*(_QWORD *)a1 + 8LL * (int)v9);
v12 = *v11;
if ( !*v11 )
goto LABEL_10;
while ( 1 )
{
v13 = v12[2];
++*(_QWORD *)(a1 + 160);
if ( v6 == v13 )
{
v14 = *v12;
++*(_QWORD *)(a1 + 104);
if ( !v10(v14, a2) )
break;
}
v11 = (__int64 **)(v12 + 1);
v12 = (__int64 *)v12[1];
if ( !v12 )
goto LABEL_10;
}
if ( *v11 )
{
result = **v11;
++*(_QWORD *)(a1 + 144);
}
else
{
LABEL_10:
++*(_QWORD *)(a1 + 152);
return 0;
}
return result;
}