//
// ossl_statem_server_read_transition from 0x7a7e68 to 0x7a809c (564 bytes)
//
// 4 xrefs:
// > sub_79ED8C @ 0x79f178
// > ??> @ 0x5cefc
// > sub_79ED8C @ 0x79f0a8
// > ??> @ 0xab8538
//
// 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 ossl_statem_server_read_transition(_DWORD *a1, int a2)
{
int v2; // r3
_BOOL4 v3; // r1
switch ( a1[16] )
{
case 0:
case 0x15:
if ( a2 != 1 )
goto LABEL_7;
a1[16] = 20;
return a2;
case 0x1A:
v2 = *(_DWORD *)(a1[26] + 588);
if ( a2 == 16 )
{
if ( !v2 )
goto LABEL_21;
if ( *a1 != 768 )
goto LABEL_7;
if ( (a1[62] & 3) != 3 )
goto LABEL_21;
ssl3_send_alert(a1, 2, 40);
ERR_put_error(20, 418, 199, "ssl/statem/statem_srvr.c", 117);
return 0;
}
else
{
v3 = a2 == 11;
if ( !v2 )
v3 = 0;
if ( !v3 )
goto LABEL_7;
a1[16] = 27;
return 1;
}
case 0x1B:
if ( a2 != 16 )
goto LABEL_7;
LABEL_21:
a1[16] = 28;
return 1;
case 0x1C:
if ( !*(_DWORD *)(a1[60] + 140) || a1[20] )
goto LABEL_11;
if ( a2 != 15 )
goto LABEL_7;
a1[16] = 29;
return 1;
case 0x1D:
case 0x24:
LABEL_11:
if ( a2 != 257 )
goto LABEL_7;
a1[16] = 31;
return 1;
case 0x1E:
goto LABEL_14;
case 0x1F:
if ( *(_DWORD *)(a1[26] + 836) )
{
if ( a2 == 67 )
{
a1[16] = 30;
return 1;
}
LABEL_7:
ssl3_send_alert(a1, 2, 10);
ERR_put_error(20, 418, 244, "ssl/statem/statem_srvr.c", 217);
return 0;
}
LABEL_14:
if ( a2 != 20 )
goto LABEL_7;
a1[16] = 32;
return 1;
default:
goto LABEL_7;
}
}