//
// ERR_reason_error_string from 0x101df78 to 0x101e060 (232 bytes)
//
// 2 xrefs:
// > ERR_error_string_n @ 0x101e0b0
// > ??> @ 0xd94c8
//
// 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:09 +0000
//
__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_1566C78, sub_101D8A8) || !dword_1566468 )
return 0;
v2 = a1 & 0xFFF;
v5[0] = a1 & 0xFF000FFF;
CRYPTO_THREAD_read_lock(qword_1566460);
if ( qword_1566C80 )
{
v3 = OPENSSL_LH_retrieve(qword_1566C80, v5);
CRYPTO_THREAD_unlock(qword_1566460);
if ( v3 )
return *(_QWORD *)(v3 + 8);
}
else
{
CRYPTO_THREAD_unlock(qword_1566460);
}
v5[0] = v2;
CRYPTO_THREAD_read_lock(qword_1566460);
if ( !qword_1566C80 )
{
CRYPTO_THREAD_unlock(qword_1566460);
return 0;
}
v3 = OPENSSL_LH_retrieve(qword_1566C80, v5);
CRYPTO_THREAD_unlock(qword_1566460);
if ( !v3 )
return 0;
return *(_QWORD *)(v3 + 8);
}