//
// ssl3_setup_read_buffer from 0x78a5d8 to 0x78a698 (192 bytes)
//
// 5 xrefs:
// > RECORD_LAYER_set_data @ 0x788438
// > ssl3_read_n @ 0x788948
// > ssl3_read_bytes @ 0x78a03c
// > ssl3_setup_buffers @ 0x78a7c0
// > ??> @ 0x5a84c
//
// 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 ssl3_setup_read_buffer(_DWORD *a1)
{
int v1; // r12
unsigned int v2; // r5
int v3; // r6
int v6; // r0
v1 = a1[144];
v2 = 17736;
if ( (*(_DWORD *)(*(_DWORD *)(a1[1] + 100) + 52) & 8) != 0 )
{
v3 = 16720;
v2 = 17744;
}
else
{
v3 = 16712;
}
if ( v1 )
goto LABEL_5;
if ( !ssl_allow_compression() )
v2 = v3;
if ( v2 < a1[145] )
v2 = a1[145];
v6 = CRYPTO_malloc(v2, "ssl/record/ssl3_buffer.c", 63);
if ( v6 )
{
v1 = v6;
a1[144] = v6;
a1[146] = v2;
LABEL_5:
a1[693] = v1;
return 1;
}
ERR_put_error(20, 156, 65, "ssl/record/ssl3_buffer.c", 73);
return 0;
}