//
// SSL_CTX_flush_sessions from 0x79e99c to 0x79ea10 (116 bytes)
//
// 3 xrefs:
// > SSL_CTX_free @ 0x79879c
// > ssl_update_cache @ 0x799214
// > ??> @ 0x5bedc
//
// 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
//
int __fastcall SSL_CTX_flush_sessions(int result, int a2)
{
int v2; // r3
int v3; // r4
int v4; // r0
int down_load; // r5
_DWORD v6[2]; // [sp+4h] [bp-10h] BYREF
int v7; // [sp+Ch] [bp-8h]
v2 = *(_DWORD *)(result + 16);
v6[0] = result;
v7 = v2;
if ( v2 )
{
v3 = result;
v4 = *(_DWORD *)(result + 528);
v6[1] = a2;
CRYPTO_THREAD_write_lock(v4);
down_load = OPENSSL_LH_get_down_load(*(_DWORD *)(v3 + 16));
OPENSSL_LH_set_down_load(*(_DWORD *)(v3 + 16), 0);
OPENSSL_LH_doall_arg(v7, sub_79DED8, v6);
OPENSSL_LH_set_down_load(*(_DWORD *)(v3 + 16), down_load);
return CRYPTO_THREAD_unlock(*(_DWORD *)(v3 + 528));
}
return result;
}