	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function drain_ring_lockless
_drain_ring_lockless:                   ## @drain_ring_lockless
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	movq	%rdx, %rbx
	movq	%rdi, %r14
	movq	%rsi, -72(%rbp)
	movq	_BUSY@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	movq	%rsi, %r15
	cmpq	%rsi, (%rax)
	sete	%dil
	callq	_MPASS
	xorl	%edi, %edi
	callq	_MPASS
	movq	_IDLE@GOTPCREL(%rip), %rax
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	cmpq	%rbx, (%rax)
	jne	LBB0_2
## %bb.1:
	movl	24(%r14), %edi
	movl	$1, %esi
	callq	_counter_u64_add
LBB0_2:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	leaq	16(%r14), %rdx
	xorl	%r13d, %r13d
	movq	%r15, %rax
	movq	%r15, %rcx
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
                                        ##     Child Loop BB0_10 Depth 2
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	%rcx, %rax
	je	LBB0_24
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	%r13d, -56(%rbp)                ## 4-byte Spill
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	movq	%rax, %rsi
	movq	%rcx, %r15
	movq	%rcx, %rdx
	movq	%rax, %r12
	callq	*(%r13)
	testl	%eax, %eax
	je	LBB0_16
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	%eax, %ebx
	movq	%r13, %rdi
	movq	%r12, %rsi
	movl	%eax, %edx
	callq	_increment_idx
	movl	-56(%rbp), %r13d                ## 4-byte Reload
	addl	%ebx, %r13d
	cmpq	%r15, %rax
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	leaq	-72(%rbp), %r12
	je	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=2
	addl	%ebx, %r14d
	cmpl	$63, %r14d
	jg	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	%r15, %rcx
	cmpl	-60(%rbp), %r13d                ## 4-byte Folded Reload
	jl	LBB0_4
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	movq	%rdx, %r14
	callq	_critical_enter
	movl	(%r14), %eax
	movl	%eax, -72(%rbp)
	xorl	%r15d, %r15d
	cmpl	-60(%rbp), %r13d                ## 4-byte Folded Reload
	setge	%r15b
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %esi
	callq	_state_to_flags
	movq	%rax, %rbx
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	%ebx, %edx
	callq	_atomic_fcmpset_acq_64
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_critical_exit
	movq	_ABDICATED@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	movq	%rbx, %rcx
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	12(%rax), %edi
	movl	$1, %esi
	movq	%rcx, %rbx
	callq	_counter_u64_add
	movq	%rbx, %rcx
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	_BUSY@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rcx
	movq	%r15, %rax
	je	LBB0_3
## %bb.14:
	movq	_STALLED@GOTPCREL(%rip), %rbx
	xorl	%edi, %edi
	cmpq	(%rbx), %rcx
	setne	%dil
	callq	_MPASS
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	cmpq	%rax, (%rbx)
	jne	LBB0_24
## %bb.15:
	xorl	%edi, %edi
	testl	%r13d, %r13d
	setg	%dil
	callq	_MPASS
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	addq	$8, %rbx
	jmp	LBB0_23
LBB0_16:
	xorl	%eax, %eax
	callq	_critical_enter
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %eax
	movl	%eax, -72(%rbp)
	movq	_STALLED@GOTPCREL(%rip), %r14
	leaq	-72(%rbp), %r15
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_atomic_fcmpset_64
	testq	%rax, %rax
	je	LBB0_17
## %bb.18:
	xorl	%eax, %eax
	callq	_critical_exit
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	cmpq	%rax, (%r14)
	movl	-56(%rbp), %r12d                ## 4-byte Reload
	jne	LBB0_21
## %bb.19:
	testl	%r12d, %r12d
	jle	LBB0_24
## %bb.20:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movl	8(%rbx), %edi
	movl	$1, %esi
	callq	_counter_u64_add
	jmp	LBB0_22
LBB0_21:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
LBB0_22:
	addq	$20, %rbx
LBB0_23:
	movl	(%rbx), %edi
	movl	$1, %esi
	callq	_counter_u64_add
LBB0_24:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BUSY,8,3                       ## @BUSY
	.comm	_IDLE,8,3                       ## @IDLE
	.comm	_STALLED,8,3                    ## @STALLED
	.comm	_ABDICATED,8,3                  ## @ABDICATED
	.no_dead_strip	_drain_ring_lockless
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function drain_ring_lockless
_drain_ring_lockless:                   ; @drain_ring_lockless
	.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	x21, x3
	mov	x20, x2
	mov	x22, x1
	mov	x19, x0
	str	x1, [sp, #8]
Lloh0:
	adrp	x27, _BUSY@GOTPAGE
Lloh1:
	ldr	x27, [x27, _BUSY@GOTPAGEOFF]
	ldr	x8, [x27]
	cmp	x8, x1
	cset	w0, eq
	bl	_MPASS
	mov	w0, #0
	bl	_MPASS
Lloh2:
	adrp	x8, _IDLE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _IDLE@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x8, x20
	b.ne	LBB0_2
; %bb.1:
	ldr	w0, [x19, #24]
	mov	w1, #1
	bl	_counter_u64_add
LBB0_2:
	mov	w26, #0
	add	x23, x19, #16
	mov	x24, x22
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
                                        ;     Child Loop BB0_9 Depth 2
	mov	w28, #0
LBB0_4:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	x22, x24
	b.eq	LBB0_22
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=2
	ldr	x8, [x19]
	mov	x0, x19
	mov	x1, x22
	mov	x2, x24
	blr	x8
	cbz	w0, LBB0_15
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=2
	mov	x25, x0
	mov	x0, x19
	mov	x1, x22
	mov	x2, x25
	bl	_increment_idx
	mov	x22, x0
	add	w26, w25, w26
	cmp	x0, x24
	b.eq	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=2
	add	w28, w25, w28
	cmp	w28, #63
	ccmp	w26, w21, #0, le
	b.lt	LBB0_4
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=1
	bl	_critical_enter
	ldr	w8, [x23]
	str	w8, [sp, #8]
	cmp	w26, w21
	cset	w25, ge
LBB0_9:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x22
	mov	x1, x25
	bl	_state_to_flags
	mov	x24, x0
	add	x1, sp, #8
	mov	x0, x23
	mov	x2, x24
	bl	_atomic_fcmpset_acq_64
	cbz	x0, LBB0_9
; %bb.10:                               ;   in Loop: Header=BB0_3 Depth=1
	bl	_critical_exit
Lloh5:
	adrp	x8, _ABDICATED@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ABDICATED@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x24, x8
	b.ne	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x19, #12]
	mov	w1, #1
	bl	_counter_u64_add
LBB0_12:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x27]
	cmp	x24, x8
	b.eq	LBB0_3
; %bb.13:
Lloh8:
	adrp	x21, _STALLED@GOTPAGE
Lloh9:
	ldr	x21, [x21, _STALLED@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x24, x8
	cset	w0, ne
	bl	_MPASS
	ldr	x8, [x21]
	cmp	x8, x20
	b.ne	LBB0_22
; %bb.14:
	cmp	w26, #0
	cset	w0, gt
	bl	_MPASS
	add	x8, x19, #8
	b	LBB0_21
LBB0_15:
	bl	_critical_enter
	ldr	w8, [x23]
	str	w8, [sp, #8]
Lloh10:
	adrp	x21, _STALLED@GOTPAGE
Lloh11:
	ldr	x21, [x21, _STALLED@GOTPAGEOFF]
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	w2, [x21]
	add	x1, sp, #8
	mov	x0, x23
	bl	_atomic_fcmpset_64
	cbz	x0, LBB0_16
; %bb.17:
	bl	_critical_exit
	ldr	x8, [x21]
	cmp	x8, x20
	b.ne	LBB0_20
; %bb.18:
	cmp	w26, #1
	b.lt	LBB0_22
; %bb.19:
	ldr	w0, [x19, #8]
	mov	w1, #1
	bl	_counter_u64_add
LBB0_20:
	add	x8, x19, #20
LBB0_21:
	ldr	w0, [x8]
	mov	w1, #1
	bl	_counter_u64_add
LBB0_22:
	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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_BUSY,8,3                       ; @BUSY
	.comm	_IDLE,8,3                       ; @IDLE
	.comm	_STALLED,8,3                    ; @STALLED
	.comm	_ABDICATED,8,3                  ; @ABDICATED
	.no_dead_strip	_drain_ring_lockless
.subsections_via_symbols
