//
// dtls1_check_timeout_num from 0x9cb04c to 0x9cb0f8 (172 bytes)
//
// 3 xrefs:
// > dtls1_read_bytes @ 0x99c7e4
// > dtls1_handle_timeout @ 0x9cb124
// > ??> @ 0x740dc
//
// 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_check_timeout_num(int a1)
{
int v1; // r2
unsigned int v2; // r3
unsigned int v5; // r3
int wbio; // r0
unsigned int v7; // r0
int v8; // r2
v1 = *(_DWORD *)(a1 + 108);
v2 = *(_DWORD *)(v1 + 384) + 1;
*(_DWORD *)(v1 + 384) = v2;
if ( v2 <= 2 )
return 0;
if ( (SSL_get_options(a1) & 0x1000) != 0 )
{
v5 = *(_DWORD *)(*(_DWORD *)(a1 + 108) + 384);
}
else
{
wbio = SSL_get_wbio(a1);
v7 = BIO_ctrl(wbio, 47, 0, 0);
v8 = *(_DWORD *)(a1 + 108);
if ( v7 < *(_DWORD *)(v8 + 284) )
*(_DWORD *)(v8 + 284) = v7;
v5 = *(_DWORD *)(v8 + 384);
}
if ( v5 <= 0xC )
return 0;
ERR_put_error(20, 318, 312, "ssl/d1_lib.c", 361);
return -1;
}