	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dequeue_events
_dequeue_events:                        ## @dequeue_events
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -64(%rbp)                  ## 8-byte Spill
	movq	%r8, -72(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r12
	movq	%rdx, %rbx
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	callq	_VALID_TASK
	movl	%eax, %edi
	callq	_REQUIRE
	xorl	%edi, %edi
	movq	%r12, %r14
	cmpq	%rbx, %r12
	setge	%dil
	callq	_REQUIRE
	leaq	L_.str(%rip), %rdi
	callq	_XTRACE
	movq	%r15, %rdi
	callq	_LOCK
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movl	4(%r15), %edi
	callq	_HEAD
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movq	_ev_link@GOTPCREL(%rip), %r13
	jmp	LBB0_3
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %edi
	movl	(%r13), %edx
	movq	%r15, %rsi
	callq	_DEQUEUE
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movl	(%r13), %edx
	movq	%r15, %rsi
	callq	_ENQUEUE
	incl	-44(%rbp)                       ## 4-byte Folded Spill
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %r15
	testq	%r12, %r12
	je	LBB0_13
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_NEXT
	movq	%rax, %r12
	movq	(%r15), %rax
	cmpq	%rbx, %rax
	jl	LBB0_12
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	%r14, %rax
	jg	LBB0_12
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	%rax, 8(%r15)
	jne	LBB0_12
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	%rax, 16(%r15)
	jne	LBB0_12
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$0, 16(%rbp)
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%r15, %rdi
	callq	_PURGE_OK
	testq	%rax, %rax
	jne	LBB0_11
	jmp	LBB0_12
LBB0_1:
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_13:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_UNLOCK
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dequeue_events"

	.comm	_ev_link,4,2                    ## @ev_link
	.no_dead_strip	_dequeue_events
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dequeue_events
_dequeue_events:                        ; @dequeue_events
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x6
	str	x5, [sp, #8]                    ; 8-byte Folded Spill
	mov	x22, x4
	mov	x23, x3
	mov	x24, x2
	mov	x25, x1
	mov	x19, x0
	bl	_VALID_TASK
	bl	_REQUIRE
	cmp	x23, x24
	cset	w0, ge
	bl	_REQUIRE
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_XTRACE
	mov	x0, x19
	bl	_LOCK
	ldr	w0, [x19, #4]
	bl	_HEAD
	cbz	x0, LBB0_11
; %bb.1:
	mov	x28, x0
	mov	w26, #0
Lloh2:
	adrp	x21, _ev_link@GOTPAGE
Lloh3:
	ldr	x21, [x21, _ev_link@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x19, #4]
	ldr	w2, [x21]
	mov	x1, x28
	bl	_DEQUEUE
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	ldr	w0, [x8]
	ldr	w2, [x21]
	mov	x1, x28
	bl	_ENQUEUE
	add	w26, w26, #1
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x28, x27
	cbz	x27, LBB0_12
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	mov	x0, x28
	bl	_NEXT
	mov	x27, x0
	ldr	x8, [x28]
	cmp	x8, x24
	ccmp	x8, x23, #0, ge
	b.gt	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	cbz	x25, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x28, #8]
	cmp	x8, x25
	b.ne	LBB0_3
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	cbz	x22, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x28, #16]
	cmp	x8, x22
	b.ne	LBB0_3
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
	cbz	w20, LBB0_2
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x28
	bl	_PURGE_OK
	cbnz	x0, LBB0_2
	b	LBB0_3
LBB0_11:
	mov	w26, #0
LBB0_12:
	mov	x0, x19
	bl	_UNLOCK
	mov	x0, x26
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dequeue_events"

	.comm	_ev_link,4,2                    ; @ev_link
	.no_dead_strip	_dequeue_events
.subsections_via_symbols
