//
// OBJ_NAME_cleanup from 0x81be28 to 0x81bea8 (128 bytes)
//
// 4 xrefs:
// > evp_cleanup_int @ 0x804d70
// > evp_cleanup_int @ 0x804d78
// > evp_cleanup_int @ 0x804d80
// > ??> @ 0x63a0c
//
// 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
//
int __fastcall OBJ_NAME_cleanup(int a1)
{
int result; // r0
int down_load; // r6
result = dword_AD4508;
if ( dword_AD4508 )
{
dword_AD450C = a1;
down_load = OPENSSL_LH_get_down_load(dword_AD4508);
OPENSSL_LH_set_down_load(dword_AD4508, 0);
OPENSSL_LH_doall(dword_AD4508, (int (__fastcall *)(_DWORD))sub_81BCE0);
if ( a1 < 0 )
{
OPENSSL_LH_free((int *)dword_AD4508);
result = OPENSSL_sk_pop_free(dword_AD4504, sub_81B73C);
dword_AD4508 = 0;
dword_AD4504 = 0;
}
else
{
return OPENSSL_LH_set_down_load(dword_AD4508, down_load);
}
}
return result;
}