//
// DSO_free from 0x9f7bf4 to 0x9f7d24 (304 bytes)
//
// 12 xrefs:
// > CONF_modules_load @ 0x9ef3b4
// > CONF_modules_unload @ 0x9ef5ec
// > CONF_modules_unload @ 0x9ef66c
// > DSO_new @ 0x9f7dd8
// > DSO_load @ 0x9f8378
// > DSO_load @ 0x9f83dc
// > sub_AC8024 @ 0xac8040
// > sub_AC8090 @ 0xac8310
// > sub_AC8090 @ 0xac8730
// > sub_AC8090 @ 0xac87c4
// > sub_AC8090 @ 0xac8850
// > ??> @ 0x79d8c
//
// 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:33 +0000
//
int __fastcall DSO_free(int *a1)
{
int v2; // r5
int v4; // r3
int (__fastcall *v5)(int *); // r2
int (__fastcall *v6)(int *); // r3
int v7; // [sp+Ch] [bp-8h] BYREF
if ( !a1 )
return 1;
if ( CRYPTO_atomic_add(a1 + 2, -1, &v7, a1[9]) > 0 )
{
if ( v7 <= 0 )
{
v4 = *a1;
if ( (a1[3] & 4) == 0 )
{
v5 = *(int (__fastcall **)(int *))(v4 + 8);
if ( v5 )
{
v2 = v5(a1);
if ( !v2 )
{
ERR_put_error(37, 111, 107, "crypto/dso/dso_lib.c", 78);
return v2;
}
v4 = *a1;
}
}
v6 = *(int (__fastcall **)(int *))(v4 + 32);
if ( v6 )
{
v2 = v6(a1);
if ( !v2 )
{
ERR_put_error(37, 111, 102, "crypto/dso/dso_lib.c", 84);
return v2;
}
}
OPENSSL_sk_free(a1[1]);
CRYPTO_free(a1[7], "crypto/dso/dso_lib.c", 89);
CRYPTO_free(a1[8], "crypto/dso/dso_lib.c", 90);
CRYPTO_THREAD_lock_free(a1[9]);
CRYPTO_free(a1, "crypto/dso/dso_lib.c", 92);
}
return 1;
}
return 0;
}