//
// CRYPTO_clear_realloc from 0xa23318 to 0xa233ac (148 bytes)
//
// 4 xrefs:
// > BUF_MEM_grow_clean @ 0x9eda64
// > ASN1_BIT_STRING_set_bit @ 0xa74adc
// > a2i_ASN1_INTEGER @ 0xa7bb4c
// > ??> @ 0x79a7c
//
// 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:57 +0000
//
void *__fastcall CRYPTO_clear_realloc(_BYTE *a1, unsigned int a2, void *a3, int a4, int a5)
{
const void *v5; // r6
void *v7; // r4
size_t v8; // r5
void *v9; // r0
v5 = a1;
if ( !a1 )
return CRYPTO_malloc(a3, a4, a5);
v7 = a3;
if ( !a3 )
goto LABEL_6;
v8 = a2;
if ( (unsigned int)a3 >= a2 )
{
v9 = CRYPTO_malloc(a3, a4, a5);
v7 = v9;
if ( !v9 )
return v7;
memcpy(v9, v5, v8);
a1 = v5;
a2 = v8;
LABEL_6:
CRYPTO_clear_free(a1, a2, a4, a5);
return v7;
}
OPENSSL_cleanse((_BYTE *)a3 + (_DWORD)a1, a2 - (_DWORD)a3);
return (void *)v5;
}