//
// dtls1_reset_seq_numbers from 0xfafdd4 to 0xfafe64 (144 bytes)
//
// 4 xrefs:
// > ossl_statem_client_post_work @ 0xfc91a4
// > tls_process_change_cipher_spec @ 0xfcc834
// > ossl_statem_server_post_work @ 0xfce6e4
// > ??> @ 0x4acb0
//
// 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:11 +0000
//
__int64 __fastcall dtls1_reset_seq_numbers(_QWORD *a1, char a2)
{
__int64 v3; // x1
__int64 result; // x0
_QWORD *v5; // x19
__int64 v6; // x1
_QWORD *v7; // x4
__int64 v8; // x5
_QWORD *v9; // x1
if ( (a2 & 1) != 0 )
{
v5 = a1 + 546;
v6 = a1[549];
v7 = (_QWORD *)(v6 + 24);
++*(_WORD *)v6;
v6 += 8;
v8 = v7[1];
*(_QWORD *)v6 = *v7;
*(_QWORD *)(v6 + 8) = v8;
v9 = (_QWORD *)(a1[549] + 24LL);
*v9 = 0;
v9[1] = 0;
result = dtls1_clear_received_buffer();
*v5 = 0;
}
else
{
*(_QWORD *)(a1[549] + 112LL) = a1[547];
v3 = a1[549];
result = (unsigned int)(unsigned __int16)(*(_WORD *)(v3 + 2))++ + 1;
a1[547] = 0;
}
return result;
}