//
// dtls1_record_replay_check from 0xfdcd1c to 0xfdce38 (284 bytes)
//
// 3 xrefs:
// > dtls1_process_buffered_records @ 0xfafd3c
// > dtls1_get_record @ 0xfb4540
// > ??> @ 0xcb2d8
//
// 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_record_replay_check(__int64 a1, _QWORD *a2)
{
unsigned __int64 v2; // x4
unsigned __int64 v3; // x2
__int64 v4; // x3
v2 = _byteswap_uint64(*(_QWORD *)(a1 + 4368));
v3 = _byteswap_uint64(a2[1]);
v4 = v2 - v3;
if ( (__int64)(v2 - v3) < 0 && v2 > v3 )
goto LABEL_3;
if ( v4 <= 0 || v2 >= v3 )
{
if ( v4 > 128 )
goto LABEL_3;
if ( v4 >= -128 )
{
if ( (int)v4 > 0 )
goto LABEL_3;
if ( (int)v3 - (int)v2 <= 63 )
{
if ( ((*a2 >> ((unsigned __int8)v3 - (unsigned __int8)v2)) & 1) != 0 )
return 0;
LABEL_3:
SSL3_RECORD_set_seq_num(a1 + 2008, (_QWORD *)(a1 + 4368));
return 1;
}
}
}
return 0;
}