//
// ossl_statem_server_post_work from 0xfce5ec to 0xfce700 (276 bytes)
//
// 5 xrefs:
// > sub_FC5998 @ 0xfc5b08
// > sub_FC5998 @ 0xfc5bb0
// > ??> @ 0x56620
// > sub_FC5998 @ 0xfc6000
// > ??> @ 0x1541f28
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:15:28 +0000
//
__int64 __fastcall ossl_statem_server_post_work(__int64 a1)
{
int v1; // w1
v1 = *(_DWORD *)(a1 + 92) - 19;
*(_DWORD *)(a1 + 136) = 0;
switch ( v1 )
{
case 0:
if ( (unsigned int)statem_flush(a1) != 1 )
return 3;
if ( (unsigned int)ssl3_init_finished_mac(a1) )
return 2;
goto LABEL_8;
case 2:
if ( (unsigned int)statem_flush(a1) != 1 )
return 3;
if ( *(_DWORD *)a1 != 256 && !(unsigned int)ssl3_init_finished_mac(a1) )
goto LABEL_8;
*(_DWORD *)(a1 + 512) = 1;
return 2;
case 7:
case 17:
if ( (unsigned int)statem_flush(a1) == 1 )
return 2;
return 3;
case 16:
if ( (*(unsigned int (__fastcall **)(__int64, __int64))(*(_QWORD *)(*(_QWORD *)(a1 + 8) + 192LL) + 32LL))(a1, 34) )
{
if ( (*(_DWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 8) + 192LL) + 104LL) & 8) != 0 )
{
dtls1_reset_seq_numbers((_QWORD *)a1, 2);
return 2;
}
else
{
return 2;
}
}
else
{
LABEL_8:
ossl_statem_set_error(a1);
return 0;
}
default:
return 2;
}
}