//
// ERR_unload_strings from 0xd9f9a8 to 0xd9fa70 (200 bytes)
//
// 1 xrefs:
// > ??> @ 0x5cb08
//
// 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_unload_strings(int a1, unsigned __int64 *a2)
{
__int64 result; // x0
__int64 v5; // x0
unsigned __int64 v6; // x1
unsigned __int64 v7; // t1
unsigned __int64 v8; // t1
result = CRYPTO_THREAD_run_once(&unk_125DE78, sub_D9F548);
if ( (_DWORD)result )
{
result = (unsigned int)dword_125D668;
if ( dword_125D668 )
{
CRYPTO_THREAD_write_lock(qword_125D660);
v5 = qword_125DE80;
if ( qword_125DE80 )
{
v6 = *a2;
if ( *a2 )
{
if ( a1 )
{
while ( 1 )
{
*a2 = v6 | ((unsigned __int64)(unsigned __int8)a1 << 24);
OPENSSL_LH_delete(v5, a2);
v8 = a2[2];
a2 += 2;
v6 = v8;
if ( !v8 )
break;
v5 = qword_125DE80;
}
}
else
{
while ( 1 )
{
OPENSSL_LH_delete(v5, a2);
v7 = a2[2];
a2 += 2;
if ( !v7 )
break;
v5 = qword_125DE80;
}
}
}
}
CRYPTO_THREAD_unlock(qword_125D660);
return 1;
}
}
return result;
}