//
// dtls1_retrieve_buffered_record from 0xfaea7c to 0xfaeb58 (220 bytes)
//
// 3 xrefs:
// > dtls1_process_buffered_records @ 0xfafd18
// > dtls1_get_record @ 0xfb449c
// > ??> @ 0xcab88
//
// 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:10 +0000
//
__int64 __fastcall dtls1_retrieve_buffered_record(__int64 a1, __int64 a2)
{
__int64 result; // x0
__int64 v4; // x20
_QWORD *v5; // x22
__int64 *v6; // x21
_QWORD *v7; // x3
int v8; // w0
__int64 v9; // x19
__int64 v10; // x7
__int64 v11; // x7
__int64 v12; // x7
__int64 v13; // x7
__int64 v14; // x7
__int64 v15; // x7
__int64 v16; // x0
result = pqueue_pop(*(_QWORD *)(a2 + 8));
v4 = result;
if ( result )
{
v5 = (_QWORD *)(a1 + 952);
v6 = *(__int64 **)(result + 8);
SSL3_BUFFER_release(a1 + 952);
v7 = (_QWORD *)(a1 + 2008);
v8 = *((_DWORD *)v6 + 2);
v9 = a1 + 4096;
*(_QWORD *)(v9 + 216) = *v6;
*(_DWORD *)(v9 + 224) = v8;
v9 += 274;
v10 = v6[3];
*v5 = v6[2];
v5[1] = v10;
v11 = v6[5];
v5[2] = v6[4];
v5[3] = v11;
v12 = v6[7];
*v7 = v6[6];
v7[1] = v12;
v13 = v6[9];
v7[2] = v6[8];
v7[3] = v13;
v14 = v6[11];
v7[4] = v6[10];
v7[5] = v14;
v15 = v6[13];
v7[6] = v6[12];
v7[7] = v15;
v7[8] = v6[14];
v16 = *v6;
*(_DWORD *)v9 = *(_DWORD *)(*v6 + 5);
*(_WORD *)(v9 + 4) = *(_WORD *)(v16 + 9);
CRYPTO_free(*(_QWORD *)(v4 + 8), "ssl/record/rec_layer_d1.c", 212);
pitem_free(v4);
return 1;
}
return result;
}