//
// sub_99A71C from 0x99a71c to 0x99a8b0 (404 bytes)
//
// 1 xrefs:
// > ??> @ 0xc760fc
//
// 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:06:44 +0000
//
int __fastcall sub_99A71C(int a1, int a2, int a3)
{
_DWORD *data; // r0
int v7; // r7
_DWORD *v8; // r8
int v9; // r4
int v11; // r1
unsigned int v12; // r3
unsigned int v13; // r2
unsigned int v14; // r0
int v15; // r3
if ( !a2 )
return 0;
data = (_DWORD *)BIO_get_data();
v7 = *data;
v8 = data;
BIO_clear_flags(a1, 15);
v9 = SSL_read(v7, a2, a3);
switch ( SSL_get_error(v7, v9) )
{
case 0:
if ( v9 <= 0 )
goto LABEL_16;
v12 = v8[2];
if ( !v12 )
goto LABEL_15;
v13 = v9 + v8[3];
if ( v12 < v13 )
{
++v8[1];
v8[3] = 0;
SSL_renegotiate(v7);
v11 = 0;
}
else
{
v8[3] = v13;
LABEL_15:
if ( !v8[4] )
goto LABEL_16;
v14 = time(nullptr);
if ( v14 <= v8[4] + v8[5] )
goto LABEL_16;
v15 = v8[1];
v8[5] = v14;
v8[1] = v15 + 1;
SSL_renegotiate(v7);
v11 = 0;
}
LABEL_5:
BIO_set_retry_reason(a1, v11);
return v9;
case 2:
BIO_set_flags(a1, 9);
v11 = 0;
goto LABEL_5;
case 3:
BIO_set_flags(a1, 10);
v11 = 0;
goto LABEL_5;
case 4:
BIO_set_flags(a1, 12);
v11 = 1;
goto LABEL_5;
case 7:
BIO_set_flags(a1, 12);
v11 = 2;
goto LABEL_5;
case 8:
BIO_set_flags(a1, 12);
v11 = 3;
goto LABEL_5;
default:
LABEL_16:
v11 = 0;
goto LABEL_5;
}
}