//
// ERR_reason_error_string from 0xd9fc18 to 0xd9fd00 (232 bytes)
//
// 2 xrefs:
// > ERR_error_string_n @ 0xd9fd50
// > ??> @ 0xa5660
//
// 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
//
__int64 __fastcall ERR_reason_error_string(int a1)
{
__int64 v2; // x22
__int64 v3; // x19
_QWORD v5[2]; // [xsp+30h] [xbp+30h] BYREF
if ( !(unsigned int)CRYPTO_THREAD_run_once(&unk_125DE78, sub_D9F548) || !dword_125D668 )
return 0;
v2 = a1 & 0xFFF;
v5[0] = a1 & 0xFF000FFF;
CRYPTO_THREAD_read_lock(qword_125D660);
if ( qword_125DE80 )
{
v3 = OPENSSL_LH_retrieve(qword_125DE80, v5);
CRYPTO_THREAD_unlock(qword_125D660);
if ( v3 )
return *(_QWORD *)(v3 + 8);
}
else
{
CRYPTO_THREAD_unlock(qword_125D660);
}
v5[0] = v2;
CRYPTO_THREAD_read_lock(qword_125D660);
if ( !qword_125DE80 )
{
CRYPTO_THREAD_unlock(qword_125D660);
return 0;
}
v3 = OPENSSL_LH_retrieve(qword_125DE80, v5);
CRYPTO_THREAD_unlock(qword_125D660);
if ( !v3 )
return 0;
return *(_QWORD *)(v3 + 8);
}