//
// dtls1_process_buffered_records from 0xfafc94 to 0xfafdd4 (320 bytes)
//
// 3 xrefs:
// > dtls1_get_record @ 0xfb4488
// > dtls1_get_record @ 0xfb44f8
// > ??> @ 0xb62a8
//
// 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_process_buffered_records(__int64 a1)
{
unsigned __int16 *v2; // x3
__int64 result; // x0
unsigned __int16 *bitmap; // x20
__int16 *v5; // x2
__int16 v6; // w1
int v7; // [xsp+4Ch] [xbp+4Ch] BYREF
if ( !pqueue_peek(*(_QWORD *)(*(_QWORD *)(a1 + 4392) + 48LL)) )
{
LABEL_10:
v5 = *(__int16 **)(a1 + 4392);
v6 = *v5;
v5[28] = *v5;
v5[20] = v6 + 1;
return 1;
}
v2 = *(unsigned __int16 **)(a1 + 4392);
result = 1;
if ( v2[20] == *v2 && *(int *)(a1 + 980) <= 0 )
{
while ( pqueue_peek(*((_QWORD *)v2 + 6)) )
{
dtls1_retrieve_buffered_record(a1, *(_QWORD *)(a1 + 4392) + 40LL);
bitmap = dtls1_get_bitmap(a1, a1 + 2008, &v7);
if ( !bitmap )
{
ERR_put_error(20, 424, 68, "ssl/record/rec_layer_d1.c", 269);
return 0;
}
if ( (unsigned int)dtls1_record_replay_check(a1, bitmap) && (unsigned int)dtls1_process_record(a1, bitmap) )
{
if ( (dtls1_buffer_record(a1, *(_QWORD *)(a1 + 4392) + 56LL, a1 + 2072) & 0x80000000) != 0 )
return 0;
}
else
{
*(_DWORD *)(a1 + 2016) = 0;
*(_DWORD *)(a1 + 4320) = 0;
}
v2 = *(unsigned __int16 **)(a1 + 4392);
}
goto LABEL_10;
}
return result;
}