//
// ossl_statem_server_post_work from 0x9bd140 to 0x9bd274 (308 bytes)
//
// 5 xrefs:
// > sub_9B3990 @ 0x9b3b00
// > sub_9B3990 @ 0x9b3bb0
// > ??> @ 0x7691c
// > sub_9B3990 @ 0x9b3fd4
// > ??> @ 0xd1d4e4
//
// 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:07:02 +0000
//
int __fastcall ossl_statem_server_post_work(_DWORD *a1)
{
int v1; // r3
v1 = a1[16] - 19;
a1[24] = 0;
switch ( v1 )
{
case 0:
if ( statem_flush((int)a1) != 1 )
return 3;
if ( ssl3_init_finished_mac(a1) )
return 2;
goto LABEL_9;
case 2:
if ( statem_flush((int)a1) != 1 )
return 3;
if ( *a1 != 256 && !ssl3_init_finished_mac(a1) )
goto LABEL_9;
a1[80] = 1;
return 2;
case 7:
case 17:
if ( statem_flush((int)a1) == 1 )
return 2;
return 3;
case 16:
if ( (*(int (**)(void))(*(_DWORD *)(a1[1] + 100) + 16))() )
{
if ( (*(_DWORD *)(*(_DWORD *)(a1[1] + 100) + 52) & 8) != 0 )
{
dtls1_reset_seq_numbers((int)a1, 2);
return 2;
}
else
{
return 2;
}
}
else
{
LABEL_9:
ossl_statem_set_error((int)a1);
return 0;
}
default:
return 2;
}
}