	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __viommu_sync_req
___viommu_sync_req:                     ## @__viommu_sync_req
	.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
	movq	%rdi, %r12
	movq	8(%rdi), %rax
	movq	_VIOMMU_REQUEST_VQ@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %r14
	addq	$4, %rdi
	callq	_assert_spin_locked
	movq	%r14, %rdi
	callq	_virtqueue_kick
	movq	%r12, %rdi
	callq	_list_empty
	testl	%eax, %eax
	je	LBB0_1
LBB0_10:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	leaq	-44(%rbp), %r15
	movq	_VIRTIO_IOMMU_S_IOERR@GOTPCREL(%rip), %r13
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	addq	$24, %rdi
	callq	_list_del
	movq	%rbx, %rdi
	callq	_kfree
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %rdi
	callq	_list_empty
	testl	%eax, %eax
	jne	LBB0_10
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	$0, -44(%rbp)
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_virtqueue_get_buf
	testq	%rax, %rax
	je	LBB0_9
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %rbx
	movl	-44(%rbp), %eax
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rbx), %rdi
	movq	8(%rbx), %rsi
	movl	(%r13), %edx
	callq	_viommu_set_req_status
	movl	-44(%rbp), %eax
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	32(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%rbx), %rdx
	movq	16(%rbx), %rsi
	subq	%rsi, %rdx
	movl	%eax, %eax
	cmpq	%rax, %rdx
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	addq	(%rbx), %rsi
	callq	_memcpy
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_VIOMMU_REQUEST_VQ,8,3          ## @VIOMMU_REQUEST_VQ
	.comm	_VIRTIO_IOMMU_S_IOERR,4,2       ## @VIRTIO_IOMMU_S_IOERR
	.no_dead_strip	___viommu_sync_req
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __viommu_sync_req
___viommu_sync_req:                     ; @__viommu_sync_req
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x9, _VIOMMU_REQUEST_VQ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _VIOMMU_REQUEST_VQ@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldr	x20, [x8, x9, lsl #3]
	add	x0, x0, #4
	bl	_assert_spin_locked
	mov	x0, x20
	bl	_virtqueue_kick
	mov	x0, x19
	bl	_list_empty
	cbz	w0, LBB0_2
LBB0_1:
	mov	w0, #0
	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
	add	sp, sp, #64
	ret
LBB0_2:
Lloh3:
	adrp	x22, _VIRTIO_IOMMU_S_IOERR@GOTPAGE
Lloh4:
	ldr	x22, [x22, _VIRTIO_IOMMU_S_IOERR@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x0, x21, #24
	bl	_list_del
	mov	x0, x21
	bl	_kfree
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x19
	bl	_list_empty
	cbnz	w0, LBB0_1
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	str	wzr, [sp, #12]
	add	x1, sp, #12
	mov	x0, x20
	bl	_virtqueue_get_buf
	cbz	x0, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x21, x0
	ldr	w8, [sp, #12]
	cbnz	w8, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldp	x0, x1, [x21]
	ldr	w2, [x22]
	bl	_viommu_set_req_status
	ldr	w8, [sp, #12]
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldp	x10, x9, [x21, #8]
	sub	x2, x10, x9
	ldr	x0, [x21, #32]
	mov	w8, w8
	cmp	x0, #0
	ccmp	x2, x8, #0, ne
	b.ne	LBB0_3
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x21]
	add	x1, x8, x9
	bl	_memcpy
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_VIOMMU_REQUEST_VQ,8,3          ; @VIOMMU_REQUEST_VQ
	.comm	_VIRTIO_IOMMU_S_IOERR,4,2       ; @VIRTIO_IOMMU_S_IOERR
	.no_dead_strip	___viommu_sync_req
.subsections_via_symbols
