//
// ERR_load_ERR_strings from 0x101d938 to 0x101dc18 (736 bytes)
//
// 3 xrefs:
// > ERR_load_strings @ 0x101dc30
// > err_load_crypto_strings_int @ 0x10dc610
// > ??> @ 0x8f758
//
// 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 ERR_load_ERR_strings()
{
__int64 result; // x0
__int64 v1; // x0
__int64 *v2; // x19
__int64 v3; // x0
__int64 *v4; // x19
__int64 v5; // x0
__int64 *v6; // x19
__int64 v7; // x2
char **v8; // x19
__int64 v9; // x20
char *v10; // x21
char *v11; // x0
int v12; // w0
char *v13; // x1
__int64 v14; // t1
__int64 v15; // t1
__int64 v16; // t1
__int64 v17; // x0
__int64 *v18; // x19
__int64 v19; // x2
__int64 v20; // t1
result = CRYPTO_THREAD_run_once(&unk_1566C78, sub_101D8A8);
if ( !(_DWORD)result )
return result;
result = (unsigned int)dword_1566468;
if ( !dword_1566468 )
return result;
CRYPTO_THREAD_write_lock(qword_1566460);
v1 = qword_1566C80;
if ( qword_1566C80 || (v1 = OPENSSL_LH_new(sub_101D850, sub_101D898), (qword_1566C80 = v1) != 0) )
{
v2 = &qword_1551D28;
if ( qword_1551D28 )
{
while ( 1 )
{
OPENSSL_LH_insert(v1, v2);
v14 = v2[2];
v2 += 2;
if ( !v14 )
break;
v1 = qword_1566C80;
}
}
}
CRYPTO_THREAD_unlock(qword_1566460);
CRYPTO_THREAD_write_lock(qword_1566460);
v3 = qword_1566C80;
if ( qword_1566C80 || (v3 = OPENSSL_LH_new(sub_101D850, sub_101D898), (qword_1566C80 = v3) != 0) )
{
v4 = &qword_1551F48;
if ( qword_1551F48 )
{
while ( 1 )
{
OPENSSL_LH_insert(v3, v4);
v15 = v4[2];
v4 += 2;
if ( !v15 )
break;
v3 = qword_1566C80;
}
}
}
CRYPTO_THREAD_unlock(qword_1566460);
CRYPTO_THREAD_write_lock(qword_1566460);
v5 = qword_1566C80;
if ( (qword_1566C80 || (v5 = OPENSSL_LH_new(sub_101D850, sub_101D898), (qword_1566C80 = v5) != 0))
&& (v6 = &qword_15520F8, (v7 = qword_15520F8) != 0) )
{
while ( 1 )
{
*v6 = v7 | 0x2000000;
OPENSSL_LH_insert(v5, v6);
v16 = v6[2];
v6 += 2;
v7 = v16;
if ( !v16 )
break;
v5 = qword_1566C80;
}
CRYPTO_THREAD_unlock(qword_1566460);
CRYPTO_THREAD_write_lock(qword_1566460);
if ( dword_1551D20 )
{
LABEL_11:
v8 = (char **)&unk_1566480;
v9 = 1;
v10 = (char *)&unk_1566C90;
do
{
while ( 1 )
{
v11 = *v8;
*(v8 - 1) = (char *)v9;
if ( !v11 )
{
v12 = openssl_strerror_r((unsigned int)v9, v10, 32);
v13 = v10;
if ( v12 )
*v8 = v10;
else
v13 = *v8;
if ( !v13 )
break;
}
++v9;
v8 += 2;
v10 += 32;
if ( v9 == 128 )
goto LABEL_18;
}
++v9;
*v8 = "unknown";
v8 += 2;
v10 += 32;
}
while ( v9 != 128 );
LABEL_18:
dword_1551D20 = 0;
CRYPTO_THREAD_unlock(qword_1566460);
goto LABEL_29;
}
}
else
{
CRYPTO_THREAD_unlock(qword_1566460);
CRYPTO_THREAD_write_lock(qword_1566460);
if ( dword_1551D20 )
goto LABEL_11;
}
CRYPTO_THREAD_unlock(qword_1566460);
LABEL_29:
CRYPTO_THREAD_write_lock(qword_1566460);
v17 = qword_1566C80;
if ( qword_1566C80 || (v17 = OPENSSL_LH_new(sub_101D850, sub_101D898), (qword_1566C80 = v17) != 0) )
{
v18 = &qword_1566478;
v19 = qword_1566478;
if ( qword_1566478 )
{
while ( 1 )
{
*v18 = v19 | 0x2000000;
OPENSSL_LH_insert(v17, v18);
v20 = v18[2];
v18 += 2;
v19 = v20;
if ( !v20 )
break;
v17 = qword_1566C80;
}
}
}
CRYPTO_THREAD_unlock(qword_1566460);
return 1;
}