//
// ASYNC_init_thread from 0xfef24c to 0xfef40c (448 bytes)
//
// 2 xrefs:
// > ASYNC_start_job @ 0xfef74c
// > ??> @ 0x86470
//
// 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:15:45 +0000
//
__int64 __fastcall ASYNC_init_thread(unsigned __int64 a1, unsigned __int64 a2)
{
unsigned int v4; // w19
__int64 v6; // x0
_QWORD *v7; // x22
__int64 v8; // x0
__int64 v9; // x0
__int64 v10; // x19
__int64 v11; // x0
if ( a2 > a1 )
{
ERR_put_error(51, 101, 103, "crypto/async/async.c", 322);
return 0;
}
else
{
if ( (unsigned int)OPENSSL_init_crypto(256) && (unsigned int)ossl_init_thread_start(1) )
{
v6 = CRYPTO_zalloc(24, "crypto/async/async.c", 333);
v7 = (_QWORD *)v6;
if ( v6 )
{
v8 = OPENSSL_sk_new_null(v6);
*v7 = v8;
v4 = v8;
if ( v8 )
{
v7[2] = a1;
if ( a2 )
{
v9 = CRYPTO_zalloc(40, "crypto/async/async.c", 84);
v10 = v9;
if ( v9 )
{
v11 = *(_QWORD *)(v9 + 16);
*(_DWORD *)(v10 + 28) = 0;
CRYPTO_free(v11, "crypto/async/async.c", 98);
CRYPTO_free(v10, "crypto/async/async.c", 100);
}
else
{
ERR_put_error(51, 102, 65, "crypto/async/async.c", 86);
}
}
v7[1] = 0;
v4 = CRYPTO_THREAD_set_local(&unk_1566314, v7);
if ( v4 )
{
return 1;
}
else
{
ERR_put_error(51, 101, 101, "crypto/async/async.c", 366);
sub_FEEFF8(v7);
}
}
else
{
ERR_put_error(51, 101, 65, "crypto/async/async.c", 341);
CRYPTO_free(v7, "crypto/async/async.c", 342);
}
}
else
{
v4 = 0;
ERR_put_error(51, 101, 65, "crypto/async/async.c", 335);
}
}
else
{
return 0;
}
return v4;
}
}