//
// ENGINE_finish from 0xd9d298 to 0xd9d328 (144 bytes)
//
// 44 xrefs:
// > sub_BB8DAC @ 0xbb8df4
// > sub_BB9294 @ 0xbb92ac
// > ssl_load_ciphers @ 0xd3c97c
// > ssl_load_ciphers @ 0xd3c9f0
// > ssl_load_ciphers @ 0xd3ca58
// > ssl_load_ciphers @ 0xd3cac4
// > ssl_load_ciphers @ 0xd3cb2c
// > ssl_load_ciphers @ 0xd3cb90
// > SSL_CTX_free @ 0xd413e4
// > SSL_CTX_set_client_cert_engine @ 0xd474b4
// > d2i_PrivateKey @ 0xd6a33c
// > DH_set_method @ 0xd87cfc
// > DH_free @ 0xd87d88
// > DSA_set_method @ 0xd896c8
// > DSA_free @ 0xd89754
// > EC_KEY_free @ 0xd8f9f8
// > EC_KEY_copy @ 0xd8fb48
// > EC_KEY_set_method @ 0xd90ab0
// > sub_D9BF28 @ 0xd9bf40
// > sub_D9BF74 @ 0xd9c31c
// > sub_D9BF74 @ 0xd9c368
// > EVP_MD_CTX_reset @ 0xda1764
// > EVP_DigestInit_ex @ 0xda1844
// > EVP_DigestInit_ex @ 0xda1a5c
// > EVP_CIPHER_CTX_reset @ 0xda8f90
// > EVP_PKEY_set_type @ 0xdac100
// > EVP_PKEY_set_type @ 0xdac118
// > EVP_PKEY_set_type @ 0xdac184
// > EVP_PKEY_set_type_str @ 0xdac32c
// > EVP_PKEY_set_type_str @ 0xdac350
// > EVP_PKEY_set_type_str @ 0xdac3c8
// > EVP_PKEY_type @ 0xdac788
// > EVP_PKEY_type @ 0xdac7a4
// > EVP_PKEY_free @ 0xdac828
// > EVP_PKEY_CTX_free @ 0xdadf68
// > EVP_PKEY_CTX_new @ 0xdae0d8
// > EVP_PKEY_CTX_new_id @ 0xdae30c
// > PEM_bytes_read_bio @ 0xdc8b6c
// > RAND_set_rand_method @ 0xdcf5fc
// > RAND_get_rand_method @ 0xdcf670
// > RAND_set_rand_engine @ 0xdcf6ec
// > RSA_set_method @ 0xdd3d34
// > RSA_free @ 0xdd3dc0
// > ??> @ 0x916e0
//
// 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_finish(__int64 a1)
{
unsigned int v2; // w19
if ( !a1 )
return 1;
CRYPTO_THREAD_write_lock(global_engine_lock);
v2 = engine_unlocked_finish(a1, 1);
CRYPTO_THREAD_unlock(global_engine_lock);
if ( v2 )
return v2;
ERR_put_error(38, 107, 106, "crypto/engine/eng_init.c", 104);
return 0;
}