//
// sub_9E7C90 from 0x9e7c90 to 0x9e7db0 (288 bytes)
//
// 2 xrefs:
// > ??> @ 0xc77a88
// > ??> @ 0xc77ab0
//
// 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:24 +0000
//
int __fastcall sub_9E7C90(_DWORD *a1, const void *a2, size_t a3)
{
_DWORD **v5; // r4
int v7; // r7
_DWORD *v8; // r12
int v9; // r1
int v10; // r2
int v11; // r3
_DWORD *v13; // r5
size_t *v14; // r3
const void *v15; // r1
void *v16; // r0
_DWORD *v17; // r3
int v18; // r1
v5 = (_DWORD **)a1[8];
if ( a2 )
{
if ( (a1[5] & 0x200) != 0 )
{
ERR_put_error(32, 117, 126, "crypto/bio/bss_mem.c", 211);
return -1;
}
else
{
BIO_clear_flags((int)a1, 15);
v7 = *v5[1];
if ( a1[3] )
{
v13 = (_DWORD *)a1[8];
if ( v13 )
{
v14 = (size_t *)v13[1];
v15 = (const void *)v14[1];
v16 = *(void **)(*v13 + 4);
if ( v15 != v16 )
{
memmove(v16, v15, *v14);
v17 = (_DWORD *)v13[1];
v18 = *(_DWORD *)(*v13 + 4);
*(_DWORD *)*v13 = *v17;
v17[1] = v18;
}
}
}
if ( BUF_MEM_grow_clean(*v5, v7 + a3) )
{
memcpy((void *)((*v5)[1] + v7), a2, a3);
v8 = v5[1];
v9 = (*v5)[1];
v10 = (*v5)[2];
v11 = (*v5)[3];
*v8 = **v5;
v8[1] = v9;
v8[2] = v10;
v8[3] = v11;
}
else
{
return -1;
}
}
}
else
{
ERR_put_error(32, 117, 115, "crypto/bio/bss_mem.c", 207);
return -1;
}
return a3;
}