//
// dtls1_handle_timeout from 0x9cb104 to 0x9cb164 (96 bytes)
//
// 5 xrefs:
// > dtls1_read_bytes @ 0x99bb90
// > dtls1_read_bytes @ 0x99bc40
// > dtls1_read_failed @ 0x9b9ef8
// > dtls1_ctrl @ 0x9cb1f4
// > ??> @ 0x7402c
//
// 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:09 +0000
//
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;
}