	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __iommu_queue_command_sync
___iommu_queue_command_sync:            ## @__iommu_queue_command_sync
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movslq	(%rdi), %rax
	addq	$4, %rax
	movq	_CMD_BUFFER_SIZE@GOTPCREL(%rip), %r13
	movslq	(%r13), %rcx
	movq	%rax, %rdi
	orq	%rcx, %rdi
	shrq	$32, %rdi
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_1
## %bb.2:
	xorl	%edx, %edx
	divq	%rcx
	movq	%rdx, %r12
	jmp	LBB0_3
LBB0_1:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
	movl	%edx, %r12d
LBB0_3:
	movl	4(%rbx), %eax
	subl	%r12d, %eax
	cltd
	idivl	%ecx
	cmpl	$32, %edx
	jg	LBB0_10
## %bb.4:
	movl	$1, %r14d
	movq	_MMIO_CMD_HEAD_OFFSET@GOTPCREL(%rip), %r15
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	(%r15), %rdi
	addq	16(%rbx), %rdi
	callq	_readl
	movl	%eax, 4(%rbx)
	subl	%r12d, %eax
	cltd
	idivl	(%r13)
	incl	%r14d
	cmpl	$33, %edx
	jge	LBB0_10
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$1, %r14d
	je	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_LOOP_TIMEOUT@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	$1, %edi
	callq	_udelay
	jmp	LBB0_9
LBB0_10:
	movq	%rbx, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_copy_cmd_to_buffer
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 8(%rbx)
	xorl	%eax, %eax
LBB0_11:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_CMD_BUFFER_SIZE,4,2            ## @CMD_BUFFER_SIZE
	.comm	_LOOP_TIMEOUT,4,2               ## @LOOP_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Command buffer timeout\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_MMIO_CMD_HEAD_OFFSET,8,3       ## @MMIO_CMD_HEAD_OFFSET
	.no_dead_strip	___iommu_queue_command_sync
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __iommu_queue_command_sync
___iommu_queue_command_sync:            ; @__iommu_queue_command_sync
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	ldp	w8, w9, [x0]
                                        ; kill: def $w8 killed $w8 def $x8
	sxtw	x8, w8
	add	x8, x8, #4
Lloh0:
	adrp	x22, _CMD_BUFFER_SIZE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _CMD_BUFFER_SIZE@GOTPAGEOFF]
	ldrsw	x10, [x22]
	udiv	x11, x8, x10
	msub	w23, w11, w10, w8
	sub	w8, w9, w23
	sdiv	w9, w8, w10
	msub	w8, w9, w10, w8
	cmp	w8, #32
	b.gt	LBB0_6
; %bb.1:
	mov	w24, #1
Lloh2:
	adrp	x25, _MMIO_CMD_HEAD_OFFSET@GOTPAGE
Lloh3:
	ldr	x25, [x25, _MMIO_CMD_HEAD_OFFSET@GOTPAGEOFF]
Lloh4:
	adrp	x26, _LOOP_TIMEOUT@GOTPAGE
Lloh5:
	ldr	x26, [x26, _LOOP_TIMEOUT@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x20, #16]
	ldr	x9, [x25]
	add	x0, x9, x8
	bl	_readl
	str	w0, [x20, #4]
	sub	w8, w0, w23
	ldr	w9, [x22]
	sdiv	w10, w8, w9
	msub	w8, w10, w9, w8
	add	w24, w24, #1
	cmp	w8, #33
	b.ge	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w24, #1
	b.eq	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x26]
	cmp	w24, w8
	b.eq	LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #1
	bl	_udelay
	b	LBB0_2
LBB0_6:
	mov	x0, x20
	mov	x1, x21
	bl	_copy_cmd_to_buffer
	mov	w0, #0
	str	w19, [x20, #8]
LBB0_7:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_8:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_CMD_BUFFER_SIZE,4,2            ; @CMD_BUFFER_SIZE
	.comm	_LOOP_TIMEOUT,4,2               ; @LOOP_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Command buffer timeout\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_MMIO_CMD_HEAD_OFFSET,8,3       ; @MMIO_CMD_HEAD_OFFSET
	.no_dead_strip	___iommu_queue_command_sync
.subsections_via_symbols
