//
// ASYNC_init_thread from 0x9dfa30 to 0x9dfc00 (464 bytes)
//
// 2 xrefs:
// > ASYNC_start_job @ 0x9dff88
// > ??> @ 0x78d1c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:07:20 +0000
//
int __fastcall ASYNC_init_thread(unsigned int a1, unsigned int a2)
{
int v4; // r4
int v6; // r0
int *v7; // r7
int v8; // r0
int v9; // r4
int v10; // r0
if ( a2 > a1 )
{
ERR_put_error(51, 101, 103, "crypto/async/async.c", 322);
return 0;
}
else
{
if ( !OPENSSL_init_crypto(256) || !ossl_init_thread_start(1, 0) )
return 0;
v6 = CRYPTO_zalloc(12, "crypto/async/async.c", 333);
v7 = (int *)v6;
if ( v6 )
{
v4 = OPENSSL_sk_new_null(v6);
*v7 = v4;
if ( v4 )
{
v7[2] = a1;
if ( a2 )
{
v8 = CRYPTO_zalloc(24, "crypto/async/async.c", 84);
v9 = v8;
if ( v8 )
{
v10 = *(_DWORD *)(v8 + 8);
*(_DWORD *)(v9 + 16) = 0;
CRYPTO_free(v10, "crypto/async/async.c", 98);
CRYPTO_free(v9, "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_D34070, v7);
if ( v4 )
{
return 1;
}
else
{
ERR_put_error(51, 101, 101, "crypto/async/async.c", 366);
sub_9DF81C(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);
}
return v4;
}
}