//
// dtls1_check_timeout_num from 0xfdb5d4 to 0xfdb68c (184 bytes)
//
// 3 xrefs:
// > dtls1_read_bytes @ 0xfaf7c4
// > dtls1_handle_timeout @ 0xfdb6bc
// > ??> @ 0x685f0
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:15:35 +0000
//
__int64 __fastcall dtls1_check_timeout_num(__int64 a1)
{
unsigned int v1; // w4
__int64 v2; // x2
unsigned int v3; // w1
__int16 options; // w0
unsigned int v7; // w1
__int64 wbio; // x0
unsigned int v9; // w0
__int64 v10; // x2
__int64 v11; // [xsp+28h] [xbp+28h]
v1 = 0;
v2 = *(_QWORD *)(a1 + 152);
v3 = *(_DWORD *)(v2 + 480) + 1;
*(_DWORD *)(v2 + 480) = v3;
if ( v3 > 2 )
{
options = SSL_get_options(a1);
if ( (options & 0x1000) != 0 )
{
v7 = *(_DWORD *)(*(_QWORD *)(a1 + 152) + 480LL);
}
else
{
v11 = options & 0x1000;
wbio = SSL_get_wbio(a1);
v9 = BIO_ctrl(wbio, 47, v11, v11);
v10 = *(_QWORD *)(a1 + 152);
v7 = *(_DWORD *)(v10 + 480);
if ( v9 < *(_DWORD *)(v10 + 292) )
*(_DWORD *)(v10 + 292) = v9;
}
v1 = 0;
if ( v7 > 0xC )
{
ERR_put_error(20, 318, 312, "ssl/d1_lib.c", 361);
return (unsigned int)-1;
}
}
return v1;
}