	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iommu_map                      ## -- Begin function iommu_map
	.p2align	4, 0x90
_iommu_map:                             ## @iommu_map
	.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	%r8d, -52(%rbp)                 ## 4-byte Spill
	movq	%rcx, %r13
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	%rdx, -48(%rbp)
	movq	16(%rdi), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	xorl	%edi, %edi
	cmpq	$0, (%rbx)
	sete	%dil
	jmp	LBB0_3
LBB0_2:
	movl	$1, %edi
LBB0_3:
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	movq	___IOMMU_DOMAIN_PAGING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%edi, %edi
	andl	8(%rbx), %eax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_9
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_7:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_8:
	movl	%r14d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	(%rbx), %rdi
	callq	___ffs
	movl	$1, %r14d
	movl	%eax, %ecx
	shll	%cl, %r14d
	movq	%r13, %rdi
	orq	%r12, %rdi
	orq	%r15, %rdi
	movl	%r14d, %esi
	callq	_IS_ALIGNED
	testl	%eax, %eax
	je	LBB0_15
## %bb.10:
	leaq	L_.str.1(%rip), %rdi
	leaq	-48(%rbp), %rdx
	movq	%r12, %rsi
	movq	%r13, %rcx
	callq	_pr_debug
	testq	%r13, %r13
	movq	%r15, -88(%rbp)                 ## 8-byte Spill
	je	LBB0_16
## %bb.11:
	movq	-48(%rbp), %rsi
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movq	%r13, %r15
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	orq	%r12, %rsi
	movq	%rbx, %rdi
	movq	%r15, %rdx
	callq	_iommu_pgsize
	movq	%rax, %r13
	leaq	L_.str.2(%rip), %rdi
	movq	%r12, %rsi
	leaq	-48(%rbp), %rdx
	movq	%rax, %rcx
	callq	_pr_debug
	movq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movq	%r13, %rcx
	movl	-52(%rbp), %r8d                 ## 4-byte Reload
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	callq	*(%rax)
	testl	%eax, %eax
	jne	LBB0_17
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	addq	%r13, %r12
	movq	-48(%rbp), %rsi
	addq	%r13, %rsi
	movq	%rsi, -48(%rbp)
	subq	%r13, %r15
	jne	LBB0_12
## %bb.14:
	xorl	%r15d, %r15d
	xorl	%r14d, %r14d
	jmp	LBB0_18
LBB0_15:
	leaq	L_.str(%rip), %rdi
	leaq	-48(%rbp), %rdx
	movq	%r12, %rsi
	movq	%r13, %rcx
	movl	%r14d, %r8d
	callq	_pr_err
	jmp	LBB0_6
LBB0_16:
	xorl	%r15d, %r15d
	xorl	%r14d, %r14d
	jmp	LBB0_19
LBB0_17:
	movl	%eax, %r14d
LBB0_18:
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movq	-64(%rbp), %r12                 ## 8-byte Reload
LBB0_19:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	LBB0_21
## %bb.20:
	movq	%rbx, %rdi
	callq	*%rax
LBB0_21:
	testl	%r14d, %r14d
	je	LBB0_23
## %bb.22:
	subq	%r15, %r13
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movq	%r13, %rdx
	callq	_iommu_unmap
	jmp	LBB0_8
LBB0_23:
	movq	%r12, %rdi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movq	%r13, %rdx
	callq	_trace_map
	xorl	%r14d, %r14d
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	___IOMMU_DOMAIN_PAGING,4,2      ## @__IOMMU_DOMAIN_PAGING
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unaligned: iova 0x%lx pa %pa size 0x%zx min_pagesz 0x%x\n"

L_.str.1:                               ## @.str.1
	.asciz	"map: iova 0x%lx pa %pa size 0x%zx\n"

L_.str.2:                               ## @.str.2
	.asciz	"mapping: iova 0x%lx pa %pa pgsize 0x%zx\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iommu_map                      ; -- Begin function iommu_map
	.p2align	2
_iommu_map:                             ; @iommu_map
	.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	x23, x4
	mov	x19, x3
	mov	x21, x2
	mov	x20, x1
	mov	x22, x0
	str	x2, [sp, #8]
	ldr	x26, [x0, #16]
	ldr	x8, [x26]
	cbz	x8, LBB0_3
; %bb.1:
	ldr	x8, [x22]
	cmp	x8, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_4
LBB0_2:
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_6
LBB0_3:
	mov	w0, #1
	bl	_unlikely
	cbnz	x0, LBB0_2
LBB0_4:
	ldr	w8, [x22, #8]
Lloh2:
	adrp	x9, ___IOMMU_DOMAIN_PAGING@GOTPAGE
Lloh3:
	ldr	x9, [x9, ___IOMMU_DOMAIN_PAGING@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_8
LBB0_5:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w25, w8
LBB0_7:
	mov	x0, x25
	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
LBB0_8:
	ldr	x0, [x22]
	bl	___ffs
	mov	w8, #1
	lsl	w24, w8, w0
	orr	x8, x19, x20
	orr	x0, x8, x21
	mov	x1, x24
	bl	_IS_ALIGNED
	cbz	w0, LBB0_13
; %bb.9:
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	add	x2, sp, #8
	mov	x1, x20
	mov	x3, x19
	bl	_pr_debug
	cbz	x19, LBB0_14
; %bb.10:
	ldr	x8, [sp, #8]
	mov	x27, x20
	mov	x24, x19
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	orr	x1, x8, x27
	mov	x0, x22
	mov	x2, x24
	bl	_iommu_pgsize
	mov	x28, x0
	add	x2, sp, #8
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x27
	mov	x3, x28
	bl	_pr_debug
	ldr	x8, [x26]
	ldr	x2, [sp, #8]
	mov	x0, x22
	mov	x1, x27
	mov	x3, x28
	mov	x4, x23
	blr	x8
	cbnz	w0, LBB0_20
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	add	x27, x28, x27
	ldr	x8, [sp, #8]
	add	x8, x8, x28
	str	x8, [sp, #8]
	subs	x24, x24, x28
	b.ne	LBB0_11
	b	LBB0_15
LBB0_13:
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	add	x2, sp, #8
	mov	x1, x20
	mov	x3, x19
	mov	x4, x24
	bl	_pr_err
	b	LBB0_5
LBB0_14:
	mov	x24, #0
LBB0_15:
	mov	w25, #0
	ldr	x8, [x26, #8]
	cbz	x8, LBB0_17
LBB0_16:
	mov	x0, x22
	blr	x8
LBB0_17:
	cbz	w25, LBB0_19
; %bb.18:
	sub	x2, x19, x24
	mov	x0, x22
	mov	x1, x20
	bl	_iommu_unmap
	b	LBB0_7
LBB0_19:
	mov	x0, x20
	mov	x1, x21
	mov	x2, x19
	bl	_trace_map
	b	LBB0_7
LBB0_20:
	mov	x25, x0
	ldr	x8, [x26, #8]
	cbnz	x8, LBB0_16
	b	LBB0_17
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	___IOMMU_DOMAIN_PAGING,4,2      ; @__IOMMU_DOMAIN_PAGING
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unaligned: iova 0x%lx pa %pa size 0x%zx min_pagesz 0x%x\n"

l_.str.1:                               ; @.str.1
	.asciz	"map: iova 0x%lx pa %pa size 0x%zx\n"

l_.str.2:                               ; @.str.2
	.asciz	"mapping: iova 0x%lx pa %pa pgsize 0x%zx\n"

.subsections_via_symbols
