//
// dtls1_handle_timeout from 0x7b6500 to 0x7b6560 (96 bytes)
//
// 5 xrefs:
// > dtls1_read_bytes @ 0x786f8c
// > dtls1_read_bytes @ 0x78703c
// > dtls1_read_failed @ 0x7a52f4
// > dtls1_ctrl @ 0x7b65f0
// > ??> @ 0x5a5ac
//
// 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 dtls1_handle_timeout(int a1)
{
int result; // r0
int v3; // r2
unsigned int v4; // r3
result = (int)dtls1_is_timer_expired(a1);
if ( result )
{
dtls1_double_timeout(a1);
if ( dtls1_check_timeout_num(a1) < 0 )
{
return -1;
}
else
{
v3 = *(_DWORD *)(a1 + 108);
v4 = *(_DWORD *)(v3 + 376) + 1;
if ( v4 > 2 )
v4 = 1;
*(_DWORD *)(v3 + 376) = v4;
dtls1_start_timer(a1);
return dtls1_retransmit_buffered_messages(a1);
}
}
return result;
}