//
// DTLS_RECORD_LAYER_clear from 0xd30338 to 0xd3046c (308 bytes)
//
// 4 xrefs:
// > DTLS_RECORD_LAYER_free @ 0xd3047c
// > RECORD_LAYER_clear @ 0xd31cd4
// > dtls1_clear @ 0xd5cf90
// > ??> @ 0xc42a8
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall DTLS_RECORD_LAYER_clear(__int64 a1)
{
_QWORD *v1; // x20
__int64 v2; // x0
__int64 v3; // x19
__int64 v4; // x0
__int64 v5; // x19
__int64 v6; // x0
__int64 v7; // x19
__int64 v8; // x2
__int64 v9; // x1
__int64 result; // x0
v1 = *(_QWORD **)(a1 + 3464);
while ( 1 )
{
v2 = pqueue_pop(v1[6]);
v3 = v2;
if ( !v2 )
break;
CRYPTO_free(*(_QWORD *)(*(_QWORD *)(v2 + 8) + 16LL), "ssl/record/rec_layer_d1.c", 67);
CRYPTO_free(*(_QWORD *)(v3 + 8), "ssl/record/rec_layer_d1.c", 68);
pitem_free(v3);
}
while ( 1 )
{
v4 = pqueue_pop(v1[8]);
v5 = v4;
if ( !v4 )
break;
CRYPTO_free(*(_QWORD *)(*(_QWORD *)(v4 + 8) + 16LL), "ssl/record/rec_layer_d1.c", 74);
CRYPTO_free(*(_QWORD *)(v5 + 8), "ssl/record/rec_layer_d1.c", 75);
pitem_free(v5);
}
while ( 1 )
{
v6 = pqueue_pop(v1[10]);
v7 = v6;
if ( !v6 )
break;
CRYPTO_free(*(_QWORD *)(*(_QWORD *)(v6 + 8) + 16LL), "ssl/record/rec_layer_d1.c", 81);
CRYPTO_free(*(_QWORD *)(v7 + 8), "ssl/record/rec_layer_d1.c", 82);
pitem_free(v7);
}
v8 = v1[6];
v9 = v1[8];
v1[6] = 0;
v1[7] = 0;
v1[8] = 0;
v1[9] = 0;
result = v1[10];
v1[10] = 0;
v1[11] = 0;
*v1 = 0;
v1[1] = 0;
v1[2] = 0;
v1[3] = 0;
v1[4] = 0;
v1[5] = 0;
v1[12] = 0;
v1[13] = 0;
v1[14] = 0;
v1[15] = 0;
v1[6] = v8;
v1[8] = v9;
v1[10] = result;
return result;
}