//
// dtls1_retransmit_buffered_messages from 0x9ba3ac to 0x9ba440 (148 bytes)
//
// 3 xrefs:
// > dtls1_read_bytes @ 0x99c7f4
// > dtls1_handle_timeout @ 0x9cb158
// > ??> @ 0x740ec
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:07:01 +0000
//
int __fastcall dtls1_retransmit_buffered_messages(int a1)
{
int v2; // r0
int v3; // r0
__int16 queue_priority; // r0
int v6; // [sp+0h] [bp-8h] BYREF
int v7; // [sp+4h] [bp-4h] BYREF
v2 = *(_DWORD *)(*(_DWORD *)(a1 + 108) + 276);
v7 = 0;
v6 = pqueue_iterator(v2);
v3 = pqueue_next(&v6);
if ( !v3 )
return 1;
while ( 1 )
{
queue_priority = dtls1_get_queue_priority(
*(unsigned __int16 *)(*(_DWORD *)(v3 + 8) + 8),
*(_DWORD *)(*(_DWORD *)(v3 + 8) + 20));
if ( dtls1_retransmit_message(a1, queue_priority, &v7) <= 0 )
break;
v3 = pqueue_next(&v6);
if ( !v3 )
return 1;
}
return -1;
}