//
// sub_1005864E8 from 0x1005864e8 to 0x1005865fc (276 bytes)
//
// 1 xrefs:
// > sub_1005834D0 @ 0x100585e00
//
// 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
//
__int64 __fastcall sub_1005864E8(__int64 *a1, int a2, __int64 a3, __int64 a4, int *a5)
{
__int64 *v8; // x23
int v9; // w0
__int64 v10; // x21
__int64 v11; // x0
int v13; // w8
__int64 v14; // x0
__int64 v15; // x20
const char *v16; // x21
int *v17; // x0
_BYTE v19[120]; // [xsp+10h] [xbp-B0h] BYREF
sub_1005E1158(a1);
v8 = &a1[5 * a2];
v9 = sub_10053EB78(v8[68]);
v10 = v9;
if ( v9 <= 0 )
{
v11 = sub_100540544(v8[68], v9);
if ( (_DWORD)v11 != 6 && (_DWORD)v11 != 0 )
{
if ( (unsigned int)(v11 - 2) <= 1 )
{
v13 = 81;
LABEL_11:
*a5 = v13;
return -1;
}
v14 = sub_1005E11DC(v11);
if ( (v10 & 0x80000000) != 0 || v14 )
{
v15 = *a1;
v16 = (const char *)sub_1005E189C(v14, v19);
v17 = __error();
sub_100552734(v15, "SSL read: %s, errno %d", v16, *v17);
v13 = 56;
goto LABEL_11;
}
}
}
return v10;
}