//
// OPENSSL_cleanup from 0xa1f828 to 0xa1f994 (364 bytes)
//
// 3 xrefs:
// > ??> @ 0x7db2c
// > sub_A1F764 @ 0xa1f784
// > ??> @ 0xd1d5ec
//
// 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:55 +0000
//
void OPENSSL_cleanup()
{
_DWORD *local; // r5
int v1; // r0
int v2; // r4
int v3; // r5
int v4; // r0
int v5; // r0
if ( dword_D35710 && !dword_D35718 )
{
dword_D35718 = 1;
local = (_DWORD *)CRYPTO_THREAD_get_local(&unk_D35708);
v1 = CRYPTO_THREAD_set_local(&unk_D35708, 0);
if ( local )
{
if ( *local )
ASYNC_cleanup_thread();
if ( local[1] )
err_delete_thread_state();
v1 = CRYPTO_free(local, "crypto/init.c", 339);
}
v2 = dword_D3571C;
if ( dword_D3571C )
{
do
{
(*(void (__fastcall **)(int))v2)(v1);
v3 = *(_DWORD *)(v2 + 4);
v1 = CRYPTO_free(v2, "crypto/init.c", 398);
v2 = v3;
}
while ( v3 );
}
dword_D3571C = 0;
CRYPTO_THREAD_lock_free(dword_D3570C);
if ( dword_D356C8 )
comp_zlib_cleanup_int();
if ( dword_D356E0 )
async_deinit();
if ( dword_D35700 )
err_free_strings_int();
v4 = CRYPTO_THREAD_cleanup_local(&unk_D35708);
rand_cleanup_int(v4);
conf_modules_free_int();
engine_cleanup_int();
crypto_cleanup_all_ex_data_int();
bio_cleanup();
v5 = evp_cleanup_int();
obj_cleanup_int(v5);
err_cleanup();
dword_D35710 = 0;
}
}