//
// ENGINE_add from 0xa0c6b8 to 0xa0c8a0 (488 bytes)
//
// 4 xrefs:
// > sub_AC8090 @ 0xac85b0
// > engine_load_dynamic_int @ 0xac89ec
// > engine_load_openssl_int @ 0xac92d8
// > ??> @ 0x7bf9c
//
// 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:44 +0000
//
int __fastcall ENGINE_add(int a1)
{
int v2; // r4
const char *v3; // r5
int v4; // r0
unsigned int v5; // r3
unsigned int v6; // r0
int v7; // r3
int v8; // r4
if ( a1 )
{
if ( *(_DWORD *)a1 && *(_DWORD *)(a1 + 4) )
{
CRYPTO_THREAD_write_lock(global_engine_lock);
v2 = dword_D34110;
if ( dword_D34110 )
{
v3 = *(const char **)a1;
do
{
v4 = strcmp(*(const char **)v2, v3);
v2 = *(_DWORD *)(v2 + 96);
v5 = v2;
if ( v2 )
v5 = 1;
v6 = v4 == 0;
}
while ( v5 > v6 );
if ( v6 )
{
ERR_put_error(38, 120, 103, "crypto/engine/eng_list.c", 68);
goto LABEL_13;
}
v7 = dword_D34114;
if ( !dword_D34114 || *(_DWORD *)(dword_D34114 + 96) )
{
ERR_put_error(38, 120, 110, "crypto/engine/eng_list.c", 86);
LABEL_13:
ERR_put_error(38, 105, 110, "crypto/engine/eng_list.c", 228);
v8 = 0;
LABEL_14:
CRYPTO_THREAD_unlock(global_engine_lock);
return v8;
}
*(_DWORD *)(dword_D34114 + 96) = a1;
*(_DWORD *)(a1 + 92) = v7;
}
else
{
if ( dword_D34114 )
{
ERR_put_error(38, 120, 110, "crypto/engine/eng_list.c", 74);
goto LABEL_13;
}
*(_DWORD *)(a1 + 92) = 0;
dword_D34110 = a1;
engine_cleanup_add_last((int)sub_A0CA18);
}
v8 = 1;
++*(_DWORD *)(a1 + 80);
dword_D34114 = a1;
*(_DWORD *)(a1 + 96) = 0;
goto LABEL_14;
}
ERR_put_error(38, 105, 108, "crypto/engine/eng_list.c", 223);
return 0;
}
else
{
ERR_put_error(38, 105, 67, "crypto/engine/eng_list.c", 219);
return 0;
}
}