//
// dtls1_handle_timeout from 0xd5d338 to 0xd5d3ac (116 bytes)
//
// 5 xrefs:
// > dtls1_read_bytes @ 0xd308dc
// > dtls1_read_bytes @ 0xd30998
// > dtls1_read_failed @ 0xd4d27c
// > dtls1_ctrl @ 0xd5d44c
// > ??> @ 0x5aca8
//
// 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
//
__int64 __fastcall dtls1_handle_timeout(__int64 a1)
{
__int64 result; // x0
__int64 v3; // x1
unsigned int v4; // w0
result = (__int64)dtls1_is_timer_expired(a1);
if ( (_DWORD)result )
{
dtls1_double_timeout(a1);
if ( (dtls1_check_timeout_num(a1) & 0x80000000) != 0 )
{
return 0xFFFFFFFFLL;
}
else
{
v3 = *(_QWORD *)(a1 + 152);
v4 = *(_DWORD *)(v3 + 472) + 1;
if ( v4 > 2 )
v4 = 1;
*(_DWORD *)(v3 + 472) = v4;
dtls1_start_timer(a1);
return dtls1_retransmit_buffered_messages(a1);
}
}
return result;
}