//
// ERR_get_state from 0x101e2c0 to 0x101e5ec (812 bytes)
//
// 16 xrefs:
// > ERR_put_error @ 0x101e610
// > ERR_clear_error @ 0x101e6ec
// > ERR_get_error_line_data @ 0x101ec8c
// > err_delete_thread_state @ 0x101edb8
// > ERR_get_error_line @ 0x101f0e8
// > ERR_peek_last_error @ 0x101f1bc
// > ERR_peek_error @ 0x101f1f4
// > ERR_get_error @ 0x101f24c
// > ERR_peek_last_error_line @ 0x101f2f4
// > ERR_peek_error_line @ 0x101f398
// > ERR_peek_last_error_line_data @ 0x101f45c
// > ERR_peek_error_line_data @ 0x101f548
// > ERR_set_error_data @ 0x101f6d0
// > ERR_set_mark @ 0x101f92c
// > ERR_pop_to_mark @ 0x101f980
// > ??> @ 0xc46f0
//
// 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_get_state()
{
__int64 local; // x20
__int64 v2; // x21
int v3; // w0
int v4; // w0
int v5; // w0
int v6; // w0
int v7; // w0
int v8; // w0
int v9; // w0
int v10; // w0
int v11; // w0
int v12; // w0
int v13; // w0
int v14; // w0
int v15; // w0
int v16; // w0
int v17; // w0
if ( (unsigned int)CRYPTO_THREAD_run_once(&byte_1567C70[256], sub_101D8E0) && dword_1566470 )
{
local = CRYPTO_THREAD_get_local(&unk_156646C);
if ( local )
return local;
v2 = CRYPTO_zalloc(584, "crypto/err/err.c", 652);
if ( v2 )
{
if ( (unsigned int)CRYPTO_THREAD_set_local(&unk_156646C, v2) )
{
local = v2;
OPENSSL_init_crypto(2);
ossl_init_thread_start(2);
}
else
{
if ( (*(_DWORD *)(v2 + 320) & 1) != 0 )
{
CRYPTO_free(*(_QWORD *)(v2 + 192), "crypto/err/err.c", 247);
*(_QWORD *)(v2 + 192) = 0;
}
v3 = *(_DWORD *)(v2 + 324);
*(_DWORD *)(v2 + 320) = 0;
if ( (v3 & 1) != 0 )
{
CRYPTO_free(*(_QWORD *)(v2 + 200), "crypto/err/err.c", 247);
*(_QWORD *)(v2 + 200) = 0;
}
v4 = *(_DWORD *)(v2 + 328);
*(_DWORD *)(v2 + 324) = 0;
if ( (v4 & 1) != 0 )
{
CRYPTO_free(*(_QWORD *)(v2 + 208), "crypto/err/err.c", 247);
*(_QWORD *)(v2 + 208) = 0;
}
v5 = *(_DWORD *)(v2 + 332);
*(_DWORD *)(v2 + 328) = 0;
if ( (v5 & 1) != 0 )
{
CRYPTO_free(*(_QWORD *)(v2 + 216), "crypto/err/err.c", 247);
*(_QWORD *)(v2 + 216) = 0;
}
v6 = *(_DWORD *)(v2 + 336);
*(_DWORD *)(v2 + 332) = 0;
if ( (v6 & 1) != 0 )
{
CRYPTO_free(*(_QWORD *)(v2 + 224), "crypto/err/err.c", 247);
*(_QWORD *)(v2 + 224) = 0;
}
v7 = *(_DWORD *)(v2 + 340);
*(_DWORD *)(v2 + 336) = 0;
if ( (v7 & 1) != 0 )
{
CRYPTO_free(*(_QWORD *)(v2 + 232), "crypto/err/err.c", 247);
*(_QWORD *)(v2 + 232) = 0;
}
v8 = *(_DWORD *)(v2 + 344);
*(_DWORD *)(v2 + 340) = 0;
if ( (v8 & 1) != 0 )
{
CRYPTO_free(*(_QWORD *)(v2 + 240), "crypto/err/err.c", 247);
*(_QWORD *)(v2 + 240) = 0;
}
v9 = *(_DWORD *)(v2 + 348);
*(_DWORD *)(v2 + 344) = 0;
if ( (v9 & 1) != 0 )
{
CRYPTO_free(*(_QWORD *)(v2 + 248), "crypto/err/err.c", 247);
*(_QWORD *)(v2 + 248) = 0;
}
v10 = *(_DWORD *)(v2 + 352);
*(_DWORD *)(v2 + 348) = 0;
if ( (v10 & 1) != 0 )
{
CRYPTO_free(*(_QWORD *)(v2 + 256), "crypto/err/err.c", 247);
*(_QWORD *)(v2 + 256) = 0;
}
v11 = *(_DWORD *)(v2 + 356);
*(_DWORD *)(v2 + 352) = 0;
if ( (v11 & 1) != 0 )
{
CRYPTO_free(*(_QWORD *)(v2 + 264), "crypto/err/err.c", 247);
*(_QWORD *)(v2 + 264) = 0;
}
v12 = *(_DWORD *)(v2 + 360);
*(_DWORD *)(v2 + 356) = 0;
if ( (v12 & 1) != 0 )
{
CRYPTO_free(*(_QWORD *)(v2 + 272), "crypto/err/err.c", 247);
*(_QWORD *)(v2 + 272) = 0;
}
v13 = *(_DWORD *)(v2 + 364);
*(_DWORD *)(v2 + 360) = 0;
if ( (v13 & 1) != 0 )
{
CRYPTO_free(*(_QWORD *)(v2 + 280), "crypto/err/err.c", 247);
*(_QWORD *)(v2 + 280) = 0;
}
v14 = *(_DWORD *)(v2 + 368);
*(_DWORD *)(v2 + 364) = 0;
if ( (v14 & 1) != 0 )
{
CRYPTO_free(*(_QWORD *)(v2 + 288), "crypto/err/err.c", 247);
*(_QWORD *)(v2 + 288) = 0;
}
v15 = *(_DWORD *)(v2 + 372);
*(_DWORD *)(v2 + 368) = 0;
if ( (v15 & 1) != 0 )
{
CRYPTO_free(*(_QWORD *)(v2 + 296), "crypto/err/err.c", 247);
*(_QWORD *)(v2 + 296) = 0;
}
v16 = *(_DWORD *)(v2 + 376);
*(_DWORD *)(v2 + 372) = 0;
if ( (v16 & 1) != 0 )
{
CRYPTO_free(*(_QWORD *)(v2 + 304), "crypto/err/err.c", 247);
*(_QWORD *)(v2 + 304) = 0;
}
v17 = *(_DWORD *)(v2 + 380);
*(_DWORD *)(v2 + 376) = 0;
if ( (v17 & 1) != 0 )
{
CRYPTO_free(*(_QWORD *)(v2 + 312), "crypto/err/err.c", 247);
*(_QWORD *)(v2 + 312) = 0;
}
*(_DWORD *)(v2 + 380) = 0;
local = 0;
CRYPTO_free(v2, "crypto/err/err.c", 249);
}
return local;
}
}
return 0;
}