//
// ossl_statem_server_pre_work from 0x7a83b0 to 0x7a853c (396 bytes)
//
// 4 xrefs:
// > sub_79ED8C @ 0x79ef28
// > ??> @ 0x5ceac
// > sub_79ED8C @ 0x79f3d4
// > ??> @ 0xab8524
//
// 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_pre_work(_DWORD *a1)
{
int v2; // r3
int (*v4)(void); // r3
int v5; // r3
switch ( a1[16] )
{
case 1:
return tls_finish_handshake(a1);
case 0x13:
v2 = *(_DWORD *)(a1[1] + 100);
a1[10] = 0;
if ( (*(_DWORD *)(v2 + 52) & 8) == 0 )
return 2;
dtls1_clear_sent_buffer();
return 2;
case 0x15:
v5 = *(_DWORD *)(a1[1] + 100);
a1[10] = 0;
if ( (*(_DWORD *)(v5 + 52) & 8) == 0 )
return 2;
dtls1_clear_sent_buffer();
a1[21] = 0;
return 2;
case 0x16:
if ( (*(_DWORD *)(*(_DWORD *)(a1[1] + 100) + 52) & 8) == 0 )
return 2;
a1[21] = 1;
return 2;
case 0x21:
goto LABEL_5;
case 0x23:
v4 = *(int (**)(void))(*(_DWORD *)(a1[1] + 100) + 8);
*(_DWORD *)(a1[60] + 172) = *(_DWORD *)(a1[26] + 528);
if ( v4() )
{
LABEL_5:
if ( (*(_DWORD *)(*(_DWORD *)(a1[1] + 100) + 52) & 8) != 0 )
{
a1[21] = 0;
return 2;
}
else
{
return 2;
}
}
else
{
ossl_statem_set_error((int)a1);
return 0;
}
default:
return 2;
}
}