	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rk_iommu_domain_free
_rk_iommu_domain_free:                  ## @rk_iommu_domain_free
	.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, -48(%rbp)                 ## 8-byte Spill
	callq	_to_rk_domain
	movq	%rax, %r15
	leaq	20(%rax), %rdi
	callq	_list_empty
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_WARN_ON
	movq	_NUM_DT_ENTRIES@GOTPCREL(%rip), %r13
	cmpl	$0, (%r13)
	jle	LBB0_5
## %bb.1:
	xorl	%r14d, %r14d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r14
	movslq	(%r13), %rax
	cmpq	%rax, %r14
	jge	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rax
	movl	(%rax,%r14,4), %ebx
	movl	%ebx, %edi
	callq	_rk_dte_is_pt_valid
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, %edi
	callq	_rk_dte_pt_address
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_phys_to_virt
	movq	%rax, %r12
	movq	_dma_dev@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SPAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ebx, %esi
	callq	_dma_unmap_single
	movq	%r12, %rdi
	callq	_free_page
	jmp	LBB0_4
LBB0_5:
	movq	_dma_dev@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	16(%r15), %esi
	movq	_SPAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_unmap_single
	movq	8(%r15), %rdi
	callq	_free_page
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	_IOMMU_DOMAIN_DMA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.7:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_iommu_put_dma_cookie           ## TAILCALL
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NUM_DT_ENTRIES,4,2             ## @NUM_DT_ENTRIES
	.comm	_dma_dev,4,2                    ## @dma_dev
	.comm	_SPAGE_SIZE,4,2                 ## @SPAGE_SIZE
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.comm	_IOMMU_DOMAIN_DMA,8,3           ## @IOMMU_DOMAIN_DMA
	.no_dead_strip	_rk_iommu_domain_free
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rk_iommu_domain_free
_rk_iommu_domain_free:                  ; @rk_iommu_domain_free
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x0
	bl	_to_rk_domain
	mov	x19, x0
	add	x0, x0, #20
	bl	_list_empty
	cmp	w0, #0
	cset	w0, eq
	bl	_WARN_ON
Lloh0:
	adrp	x23, _NUM_DT_ENTRIES@GOTPAGE
Lloh1:
	ldr	x23, [x23, _NUM_DT_ENTRIES@GOTPAGEOFF]
Lloh2:
	adrp	x26, _dma_dev@GOTPAGE
Lloh3:
	ldr	x26, [x26, _dma_dev@GOTPAGEOFF]
	ldr	w8, [x23]
Lloh4:
	adrp	x24, _SPAGE_SIZE@GOTPAGE
Lloh5:
	ldr	x24, [x24, _SPAGE_SIZE@GOTPAGEOFF]
Lloh6:
	adrp	x25, _DMA_TO_DEVICE@GOTPAGE
Lloh7:
	ldr	x25, [x25, _DMA_TO_DEVICE@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.1:
	mov	x27, #0
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x27, x27, #1
	ldrsw	x8, [x23]
	cmp	x27, x8
	b.ge	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	w21, [x8, x27, lsl #2]
	mov	x0, x21
	bl	_rk_dte_is_pt_valid
	cbz	x0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x21
	bl	_rk_dte_pt_address
	mov	x21, x0
	bl	_phys_to_virt
	mov	x22, x0
	ldr	w0, [x26]
	ldr	w2, [x24]
	ldr	w3, [x25]
	mov	x1, x21
	bl	_dma_unmap_single
	mov	x0, x22
	bl	_free_page
	b	LBB0_2
LBB0_5:
	ldr	w0, [x26]
	ldr	w1, [x19, #16]
	ldr	w2, [x24]
	ldr	w3, [x25]
	bl	_dma_unmap_single
	ldr	x0, [x19, #8]
	bl	_free_page
	ldr	x8, [x20]
Lloh8:
	adrp	x9, _IOMMU_DOMAIN_DMA@GOTPAGE
Lloh9:
	ldr	x9, [x9, _IOMMU_DOMAIN_DMA@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.6:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_iommu_put_dma_cookie
LBB0_7:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_NUM_DT_ENTRIES,4,2             ; @NUM_DT_ENTRIES
	.comm	_dma_dev,4,2                    ; @dma_dev
	.comm	_SPAGE_SIZE,4,2                 ; @SPAGE_SIZE
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.comm	_IOMMU_DOMAIN_DMA,8,3           ; @IOMMU_DOMAIN_DMA
	.no_dead_strip	_rk_iommu_domain_free
.subsections_via_symbols
