//
// dtls1_retransmit_buffered_messages from 0xd4d714 to 0xd4d7a8 (148 bytes)
//
// 3 xrefs:
// > dtls1_read_bytes @ 0xd3147c
// > dtls1_handle_timeout @ 0xd5d3a0
// > ??> @ 0x50928
//
// 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 dtls1_retransmit_buffered_messages(__int64 a1)
{
__int64 v2; // x0
__int16 queue_priority; // w0
__int64 v4; // x0
int v6; // [xsp+34h] [xbp+34h] BYREF
__int64 v7; // [xsp+38h] [xbp+38h] BYREF
v2 = *(_QWORD *)(a1 + 152);
v6 = 0;
v7 = pqueue_iterator(*(_QWORD *)(v2 + 280));
do
{
v4 = pqueue_next(&v7);
if ( !v4 )
return 1;
queue_priority = dtls1_get_queue_priority(
*(_WORD *)(*(_QWORD *)(v4 + 8) + 16LL),
*(_DWORD *)(*(_QWORD *)(v4 + 8) + 40LL));
}
while ( (int)dtls1_retransmit_message(a1, queue_priority, &v6) > 0 );
return 0xFFFFFFFFLL;
}