//
// ENGINE_remove from 0xd9dbf0 to 0xd9dd30 (320 bytes)
//
// 2 xrefs:
// > sub_D9DD30 @ 0xd9dd48
// > ??> @ 0x66fd8
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall ENGINE_remove(__int64 a1)
{
__int64 v2; // x1
__int64 i; // x5
__int64 v4; // x2
__int64 v5; // x3
__int64 v6; // x0
unsigned int v7; // w19
if ( a1 )
{
CRYPTO_THREAD_write_lock(global_engine_lock);
v2 = qword_125D600;
for ( i = qword_125D600; a1 != i && i; i = *(_QWORD *)(i + 184) )
;
if ( i )
{
v4 = *(_QWORD *)(a1 + 184);
if ( v4 )
*(_QWORD *)(v4 + 176) = *(_QWORD *)(a1 + 176);
v5 = *(_QWORD *)(a1 + 176);
if ( v5 )
*(_QWORD *)(v5 + 184) = v4;
if ( a1 == v2 )
qword_125D600 = *(_QWORD *)(a1 + 184);
if ( a1 == qword_125D608 )
qword_125D608 = v5;
v6 = a1;
v7 = 1;
engine_free_util(v6, 0);
}
else
{
v7 = 0;
ERR_put_error(38, 121, 105, "crypto/engine/eng_list.c", 117);
ERR_put_error(38, 123, 110, "crypto/engine/eng_list.c", 245);
}
CRYPTO_THREAD_unlock(global_engine_lock);
return v7;
}
else
{
ERR_put_error(38, 123, 67, "crypto/engine/eng_list.c", 240);
return 0;
}
}