	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function omap_iommu_attach_dev
_omap_iommu_attach_dev:                 ## @omap_iommu_attach_dev
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %rbx
	callq	_to_omap_domain
	movq	(%r12), %r13
	testq	%r13, %r13
	je	LBB0_2
## %bb.1:
	cmpq	$0, (%r13)
	je	LBB0_2
## %bb.3:
	movq	%rax, %r15
	movq	%rax, %r14
	addq	$4, %r14
	movq	%r14, %rdi
	callq	_spin_lock
	cmpq	$0, 8(%r15)
	je	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EBUSY@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_17
LBB0_2:
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_18
LBB0_5:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_omap_iommu_attach_init
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_7:
	movq	%r15, %rdi
	callq	_omap_iommu_detach_fini
	jmp	LBB0_17
LBB0_8:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%r15)
	jle	LBB0_16
## %bb.9:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	16(%rax), %r15
	addq	$-16, %r15
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r13,%r12,8), %r14
	movl	24(%r15), %esi
	movq	%r14, %rdi
	callq	_omap_iommu_attach
	testl	%eax, %eax
	jne	LBB0_11
## %bb.15:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, (%r14)
	movq	%r14, 16(%r15)
	addq	$16, %r15
	incq	%r12
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpl	(%rax), %r12d
	jl	LBB0_10
LBB0_16:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, 8(%rax)
	xorl	%ebx, %ebx
	movq	-56(%rbp), %r14                 ## 8-byte Reload
LBB0_17:
	movq	%r14, %rdi
	callq	_spin_unlock
LBB0_18:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	testl	%r12d, %r12d
	je	LBB0_14
## %bb.12:
	negq	%r12
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %r14
	movq	%r14, %rdi
	callq	_omap_iommu_detach
	movq	$0, (%r15)
	movq	$0, (%r14)
	addq	$-16, %r15
	incl	%r12d
	jne	LBB0_13
LBB0_14:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"device doesn't have an associated iommu\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"iommu domain is already attached\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
L_.str.2:                               ## @.str.2
	.asciz	"failed to allocate required iommu data %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"can't get omap iommu: %d\n"

	.no_dead_strip	_omap_iommu_attach_dev
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function omap_iommu_attach_dev
_omap_iommu_attach_dev:                 ; @omap_iommu_attach_dev
	.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, x1
	mov	x22, x0
	bl	_to_omap_domain
	ldr	x27, [x21]
	cbz	x27, LBB0_4
; %bb.1:
	ldr	x8, [x27]
	cbz	x8, LBB0_4
; %bb.2:
	mov	x20, x0
	add	x19, x0, #4
	mov	x0, x19
	bl	_spin_lock
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_5
; %bb.3:
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_dev_err
Lloh2:
	adrp	x8, _EBUSY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_13
LBB0_4:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_err
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_14
LBB0_5:
	mov	x0, x21
	mov	x1, x20
	bl	_omap_iommu_attach_init
	cbz	w0, LBB0_8
; %bb.6:
	mov	x23, x0
	str	x23, [sp]
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_dev_err
                                        ; kill: def $w23 killed $w23 killed $x23 def $x23
LBB0_7:
	mov	x0, x20
	bl	_omap_iommu_detach_fini
	b	LBB0_13
LBB0_8:
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.9:
	mov	w25, #0
	mov	w28, #0
	ldr	x26, [x20, #16]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x24, [x27]
	ldr	w1, [x26, #8]
	mov	x0, x24
	bl	_omap_iommu_attach
	cbnz	w0, LBB0_15
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	str	x24, [x26], #16
	str	x22, [x24]
	add	w28, w28, #1
	add	x27, x27, #8
	ldr	w8, [x20]
	sub	w25, w25, #1
	cmp	w28, w8
	b.lt	LBB0_10
LBB0_12:
	mov	w23, #0
	str	x21, [x20, #8]
LBB0_13:
	mov	x0, x19
	bl	_spin_unlock
LBB0_14:
	mov	x0, x23
	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_15:
	mov	x23, x0
	str	x23, [sp]
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	cbz	w28, LBB0_7
; %bb.16:
	mov	x22, #-16
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldr	x21, [x26, x22]
	mov	x0, x21
	bl	_omap_iommu_detach
	str	xzr, [x26, x22]
	str	xzr, [x21]
	sub	x22, x22, #16
	adds	w25, w25, #1
	b.lo	LBB0_17
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"device doesn't have an associated iommu\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"iommu domain is already attached\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
l_.str.2:                               ; @.str.2
	.asciz	"failed to allocate required iommu data %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"can't get omap iommu: %d\n"

	.no_dead_strip	_omap_iommu_attach_dev
.subsections_via_symbols
