	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rk_iommu_domain_alloc
_rk_iommu_domain_alloc:                 ## @rk_iommu_domain_alloc
	.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
	movl	%edi, %ebx
	movq	_IOMMU_DOMAIN_UNMANAGED@GOTPCREL(%rip), %rax
	movq	_IOMMU_DOMAIN_DMA@GOTPCREL(%rip), %r15
	cmpl	%edi, (%rax)
	je	LBB0_2
## %bb.1:
	cmpl	%ebx, (%r15)
	jne	LBB0_11
LBB0_2:
	movq	_dma_dev@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	testl	%edi, %edi
	je	LBB0_11
## %bb.3:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movl	$40, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_11
## %bb.4:
	movq	%rax, %r14
	cmpl	%ebx, (%r15)
	jne	LBB0_6
## %bb.5:
	movq	%r14, %rdi
	callq	_iommu_get_dma_cookie
	testq	%rax, %rax
	jne	LBB0_11
LBB0_6:
	movq	_GFP_DMA32@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	orl	(%r13), %edi
	callq	_get_zeroed_page
	movq	%rax, 16(%r14)
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	movl	(%r12), %edi
	movq	_SPAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%rax, %rsi
	callq	_dma_map_single
	movl	%eax, 36(%r14)
	movl	(%r12), %edi
	movl	%eax, %esi
	callq	_dma_mapping_error
	testq	%rax, %rax
	je	LBB0_13
## %bb.8:
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	16(%r14), %rdi
	callq	_free_page
LBB0_9:
	cmpl	%ebx, (%r15)
	jne	LBB0_11
## %bb.10:
	movq	%r14, %rdi
	callq	_iommu_put_dma_cookie
LBB0_11:
	xorl	%r14d, %r14d
LBB0_12:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movl	36(%r14), %esi
	movq	_NUM_DT_ENTRIES@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_rk_table_flush
	leaq	32(%r14), %rdi
	callq	_spin_lock_init
	leaq	28(%r14), %rdi
	callq	_spin_lock_init
	movq	%r14, %rdi
	addq	$24, %rdi
	callq	_INIT_LIST_HEAD
	movq	$0, 8(%r14)
	movl	$32, %edi
	callq	_DMA_BIT_MASK
	movl	%eax, 4(%r14)
	movl	$1, (%r14)
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_IOMMU_DOMAIN_UNMANAGED,4,2     ## @IOMMU_DOMAIN_UNMANAGED
	.comm	_IOMMU_DOMAIN_DMA,4,2           ## @IOMMU_DOMAIN_DMA
	.comm	_dma_dev,4,2                    ## @dma_dev
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_GFP_DMA32,4,2                  ## @GFP_DMA32
	.comm	_SPAGE_SIZE,4,2                 ## @SPAGE_SIZE
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DMA map error for DT\n"

	.comm	_NUM_DT_ENTRIES,4,2             ## @NUM_DT_ENTRIES
	.no_dead_strip	_rk_iommu_domain_alloc
.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_alloc
_rk_iommu_domain_alloc:                 ; @rk_iommu_domain_alloc
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
Lloh0:
	adrp	x8, _IOMMU_DOMAIN_UNMANAGED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IOMMU_DOMAIN_UNMANAGED@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x21, _IOMMU_DOMAIN_DMA@GOTPAGE
Lloh4:
	ldr	x21, [x21, _IOMMU_DOMAIN_DMA@GOTPAGEOFF]
	ldr	w9, [x21]
	cmp	w8, w0
	ccmp	w9, w0, #4, ne
	b.ne	LBB0_10
; %bb.1:
	mov	x20, x0
Lloh5:
	adrp	x22, _dma_dev@GOTPAGE
Lloh6:
	ldr	x22, [x22, _dma_dev@GOTPAGEOFF]
	ldr	w0, [x22]
	cbz	w0, LBB0_10
; %bb.2:
Lloh7:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh8:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	w1, #40
	bl	_devm_kzalloc
	mov	x19, x0
	cbz	x0, LBB0_11
; %bb.3:
	ldr	w8, [x21]
	cmp	w8, w20
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_iommu_get_dma_cookie
	cbnz	x0, LBB0_10
LBB0_5:
	ldr	w8, [x23]
Lloh9:
	adrp	x9, _GFP_DMA32@GOTPAGE
Lloh10:
	ldr	x9, [x9, _GFP_DMA32@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w0, w9, w8
	bl	_get_zeroed_page
	str	x0, [x19, #16]
	cbz	x0, LBB0_8
; %bb.6:
	mov	x1, x0
	ldr	w0, [x22]
Lloh12:
	adrp	x8, _SPAGE_SIZE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SPAGE_SIZE@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
Lloh15:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh17:
	ldr	w3, [x8]
	bl	_dma_map_single
	mov	x1, x0
	str	w0, [x19, #36]
	ldr	w0, [x22]
	bl	_dma_mapping_error
	cbz	x0, LBB0_12
; %bb.7:
	ldr	w0, [x22]
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	ldr	x0, [x19, #16]
	bl	_free_page
LBB0_8:
	ldr	w8, [x21]
	cmp	w8, w20
	b.ne	LBB0_10
; %bb.9:
	mov	x0, x19
	bl	_iommu_put_dma_cookie
LBB0_10:
	mov	x19, #0
LBB0_11:
	mov	x0, x19
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_12:
	ldr	w1, [x19, #36]
Lloh20:
	adrp	x8, _NUM_DT_ENTRIES@GOTPAGE
Lloh21:
	ldr	x8, [x8, _NUM_DT_ENTRIES@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_rk_table_flush
	add	x0, x19, #32
	bl	_spin_lock_init
	add	x0, x19, #28
	bl	_spin_lock_init
	add	x0, x19, #24
	bl	_INIT_LIST_HEAD
	str	xzr, [x19, #8]
	mov	w0, #32
	bl	_DMA_BIT_MASK
	mov	w8, #1
	stp	w8, w0, [x19]
	b	LBB0_11
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_IOMMU_DOMAIN_UNMANAGED,4,2     ; @IOMMU_DOMAIN_UNMANAGED
	.comm	_IOMMU_DOMAIN_DMA,4,2           ; @IOMMU_DOMAIN_DMA
	.comm	_dma_dev,4,2                    ; @dma_dev
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_GFP_DMA32,4,2                  ; @GFP_DMA32
	.comm	_SPAGE_SIZE,4,2                 ; @SPAGE_SIZE
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DMA map error for DT\n"

	.comm	_NUM_DT_ENTRIES,4,2             ; @NUM_DT_ENTRIES
	.no_dead_strip	_rk_iommu_domain_alloc
.subsections_via_symbols
