//
// ERR_reason_error_string from 0x7f9e74 to 0x7f9f60 (236 bytes)
//
// 2 xrefs:
// > ERR_error_string_n @ 0x7f9fa0
// > ??> @ 0x6290c
//
// 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 ERR_reason_error_string(int a1)
{
int v2; // r6
int v3; // r4
_DWORD v5[2]; // [sp+0h] [bp-8h] BYREF
if ( !CRYPTO_THREAD_run_once(&unk_AD2EC0, sub_7F9708) || !dword_AD2EB4 )
return 0;
v2 = a1 & 0xFFF;
v5[0] = a1 & 0xFF000FFF;
CRYPTO_THREAD_read_lock(dword_AD2EB0);
if ( dword_AD2EC4 )
{
v3 = OPENSSL_LH_retrieve(dword_AD2EC4, v5);
CRYPTO_THREAD_unlock(dword_AD2EB0);
if ( v3 )
return *(_DWORD *)(v3 + 4);
}
else
{
CRYPTO_THREAD_unlock(dword_AD2EB0);
}
v5[0] = v2;
CRYPTO_THREAD_read_lock(dword_AD2EB0);
if ( dword_AD2EC4 )
{
v3 = OPENSSL_LH_retrieve(dword_AD2EC4, v5);
CRYPTO_THREAD_unlock(dword_AD2EB0);
if ( v3 )
return *(_DWORD *)(v3 + 4);
return 0;
}
CRYPTO_THREAD_unlock(dword_AD2EB0);
return 0;
}