	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vq_endchains                   ## -- Begin function vq_endchains
	.p2align	4, 0x90
_vq_endchains:                          ## @vq_endchains
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	24(%rdi), %r14
	movl	(%rdi), %r12d
	movq	16(%rdi), %rax
	movl	(%rax), %r13d
	movl	%r13d, (%rdi)
	xorl	%eax, %eax
	callq	_atomic_thread_fence_seq_cst
	movl	(%r14), %eax
	testl	%r15d, %r15d
	je	LBB0_2
## %bb.1:
	movq	_VIRTIO_F_NOTIFY_ON_EMPTY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_4
LBB0_2:
	movq	_VIRTIO_RING_F_EVENT_IDX@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.3:
	movq	%rbx, %rdi
	callq	_VQ_USED_EVENT_IDX
	notl	%eax
	addl	%r13d, %eax
	subl	%r12d, %r13d
	cmpl	%r13d, %eax
	jge	LBB0_7
	jmp	LBB0_4
LBB0_5:
	cmpl	%r12d, %r13d
	je	LBB0_7
## %bb.6:
	movq	8(%rbx), %rax
	movq	_VRING_AVAIL_F_NO_INTERRUPT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_4
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_vq_interrupt                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_VIRTIO_F_NOTIFY_ON_EMPTY,4,2   ## @VIRTIO_F_NOTIFY_ON_EMPTY
	.comm	_VIRTIO_RING_F_EVENT_IDX,4,2    ## @VIRTIO_RING_F_EVENT_IDX
	.comm	_VRING_AVAIL_F_NO_INTERRUPT,4,2 ## @VRING_AVAIL_F_NO_INTERRUPT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vq_endchains                   ; -- Begin function vq_endchains
	.p2align	2
_vq_endchains:                          ; @vq_endchains
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x1
	mov	x19, x0
	ldr	w22, [x0]
	ldp	x8, x20, [x0, #16]
	ldr	w23, [x8]
	str	w23, [x0]
	bl	_atomic_thread_fence_seq_cst
	ldr	w8, [x20]
	cbz	w21, LBB0_2
; %bb.1:
Lloh0:
	adrp	x9, _VIRTIO_F_NOTIFY_ON_EMPTY@GOTPAGE
Lloh1:
	ldr	x9, [x9, _VIRTIO_F_NOTIFY_ON_EMPTY@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_7
LBB0_2:
Lloh3:
	adrp	x9, _VIRTIO_RING_F_EVENT_IDX@GOTPAGE
Lloh4:
	ldr	x9, [x9, _VIRTIO_RING_F_EVENT_IDX@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_VQ_USED_EVENT_IDX
	mvn	w8, w0
	add	w8, w23, w8
	sub	w9, w23, w22
	cmp	w8, w9
	b.ge	LBB0_6
	b	LBB0_7
LBB0_4:
	cmp	w23, w22
	b.eq	LBB0_6
; %bb.5:
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _VRING_AVAIL_F_NO_INTERRUPT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _VRING_AVAIL_F_NO_INTERRUPT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
LBB0_6:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_7:
	mov	x0, x20
	mov	x1, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_vq_interrupt
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_VIRTIO_F_NOTIFY_ON_EMPTY,4,2   ; @VIRTIO_F_NOTIFY_ON_EMPTY
	.comm	_VIRTIO_RING_F_EVENT_IDX,4,2    ; @VIRTIO_RING_F_EVENT_IDX
	.comm	_VRING_AVAIL_F_NO_INTERRUPT,4,2 ; @VRING_AVAIL_F_NO_INTERRUPT
.subsections_via_symbols
