	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dma_map_area
_dma_map_area:                          ## @dma_map_area
	.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	%r8, -48(%rbp)                  ## 8-byte Spill
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r15
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r12
	movq	(%r12), %rdx
	movq	%rsi, %rdi
	movq	%r15, %rsi
	callq	_iommu_num_pages
	movq	%rax, %rbx
	leaq	(%r15,%r13), %rax
	movq	_GART_MAX_PHYS_ADDR@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	seta	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_3
LBB0_1:
	movq	_bad_dma_address@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	jmp	LBB0_2
LBB0_3:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_alloc_iommu
	cmpq	$-1, %rax
	je	LBB0_9
## %bb.4:
	testq	%rbx, %rbx
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_8
## %bb.5:
	movq	_iommu_gatt_base@GOTPCREL(%rip), %r15
	movq	%rax, %r14
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_GPTE_ENCODE
	movq	(%r15), %rcx
	movl	%eax, (%rcx,%r14,4)
	movq	(%r12), %rax
	addq	%rax, %r13
	incq	%r14
	decq	%rbx
	jne	LBB0_6
	jmp	LBB0_7
LBB0_9:
	movq	%r14, %rdi
	movq	%r13, %rsi
	movq	%r15, %rdx
	callq	_nonforced_iommu
	testl	%eax, %eax
	je	LBB0_2
## %bb.10:
	movq	_panic_on_overflow@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_12
## %bb.11:
	leaq	L_.str(%rip), %rdi
	movq	%r15, %rsi
	callq	_panic
LBB0_12:
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	callq	_iommu_full
	jmp	LBB0_1
LBB0_8:
	movq	(%r12), %rax
LBB0_7:
	movq	_iommu_bus_base@GOTPCREL(%rip), %rcx
	imulq	-48(%rbp), %rax                 ## 8-byte Folded Reload
	addq	(%rcx), %rax
	movq	_PAGE_MASK@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	notq	%rcx
	andq	%r13, %rcx
	addq	%rax, %rcx
	movq	%rcx, %r13
LBB0_2:
	movq	%r13, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_GART_MAX_PHYS_ADDR,8,3         ## @GART_MAX_PHYS_ADDR
	.comm	_bad_dma_address,8,3            ## @bad_dma_address
	.comm	_panic_on_overflow,8,3          ## @panic_on_overflow
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dma_map_area overflow %lu bytes\n"

	.comm	_iommu_gatt_base,8,3            ## @iommu_gatt_base
	.comm	_iommu_bus_base,8,3             ## @iommu_bus_base
	.comm	_PAGE_MASK,8,3                  ## @PAGE_MASK
	.no_dead_strip	_dma_map_area
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dma_map_area
_dma_map_area:                          ; @dma_map_area
	.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	x24, x4
	mov	x20, x3
	mov	x21, x2
	mov	x19, x1
	mov	x22, x0
Lloh0:
	adrp	x25, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x25, [x25, _PAGE_SIZE@GOTPAGEOFF]
	ldr	x2, [x25]
	mov	x0, x1
	mov	x1, x21
	bl	_iommu_num_pages
	mov	x23, x0
Lloh2:
	adrp	x8, _GART_MAX_PHYS_ADDR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GART_MAX_PHYS_ADDR@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	add	x9, x21, x19
	cmp	x9, x8
	cset	w0, hi
	bl	_unlikely
	cbz	x0, LBB0_2
LBB0_1:
Lloh5:
	adrp	x8, _bad_dma_address@GOTPAGE
Lloh6:
	ldr	x8, [x8, _bad_dma_address@GOTPAGEOFF]
Lloh7:
	ldr	x19, [x8]
	b	LBB0_12
LBB0_2:
	mov	x0, x22
	mov	x1, x23
	mov	x2, x24
	bl	_alloc_iommu
	cmn	x0, #1
	b.eq	LBB0_6
; %bb.3:
	mov	x24, x0
	cbz	x23, LBB0_10
; %bb.4:
	lsl	x20, x24, #2
Lloh8:
	adrp	x21, _iommu_gatt_base@GOTPAGE
Lloh9:
	ldr	x21, [x21, _iommu_gatt_base@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_GPTE_ENCODE
	ldr	x8, [x21]
	str	w0, [x8, x20]
	ldr	x8, [x25]
	add	x19, x8, x19
	add	x20, x20, #4
	subs	x23, x23, #1
	b.ne	LBB0_5
	b	LBB0_11
LBB0_6:
	mov	x0, x22
	mov	x1, x19
	mov	x2, x21
	bl	_nonforced_iommu
	cbz	w0, LBB0_12
; %bb.7:
Lloh10:
	adrp	x8, _panic_on_overflow@GOTPAGE
Lloh11:
	ldr	x8, [x8, _panic_on_overflow@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	cbz	x8, LBB0_9
; %bb.8:
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_panic
LBB0_9:
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	bl	_iommu_full
	b	LBB0_1
LBB0_10:
	ldr	x8, [x25]
LBB0_11:
Lloh15:
	adrp	x9, _iommu_bus_base@GOTPAGE
Lloh16:
	ldr	x9, [x9, _iommu_bus_base@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	madd	x8, x8, x24, x9
Lloh18:
	adrp	x9, _PAGE_MASK@GOTPAGE
Lloh19:
	ldr	x9, [x9, _PAGE_MASK@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	bic	x9, x19, x9
	add	x19, x8, x9
LBB0_12:
	mov	x0, x19
	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
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_GART_MAX_PHYS_ADDR,8,3         ; @GART_MAX_PHYS_ADDR
	.comm	_bad_dma_address,8,3            ; @bad_dma_address
	.comm	_panic_on_overflow,8,3          ; @panic_on_overflow
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dma_map_area overflow %lu bytes\n"

	.comm	_iommu_gatt_base,8,3            ; @iommu_gatt_base
	.comm	_iommu_bus_base,8,3             ; @iommu_bus_base
	.comm	_PAGE_MASK,8,3                  ; @PAGE_MASK
	.no_dead_strip	_dma_map_area
.subsections_via_symbols
