	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iommu_dvmamap_create
_iommu_dvmamap_create:                  ## @iommu_dvmamap_create
	.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	%rdx, %r15
	movl	%esi, %ebx
	movq	%rdi, %r13
	movq	8(%rdi), %r14
	movq	%rdx, %rsi
	callq	_sparc64_dma_alloc_map
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_11
## %bb.1:
	movq	_BUS_DMA_COHERENT@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_3
## %bb.2:
	movq	_DMF_COHERENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%r15), %rcx
	orl	%eax, (%rcx)
LBB0_3:
	movl	(%r13), %edi
	callq	_IOMMU_SIZE_ROUNDUP
	movq	_IOMMU_MAX_PRE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	movq	%rax, %rdi
	callq	_ulmin
	movq	%rax, %rbx
	movq	(%r15), %rdx
	movq	%r13, %rdi
	movq	%r14, %rsi
	movq	%rax, %rcx
	callq	_iommu_dvma_valloc
	xorl	%r12d, %r12d
	testl	%eax, %eax
	jne	LBB0_11
## %bb.4:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movl	4(%r13), %edi
	movq	_IOMMU_MAX_PRE_SEG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_imin
	movl	%eax, %ecx
	movl	(%r13), %eax
	cltd
	idivl	%ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	cmpl	$2, %ecx
	jl	LBB0_10
## %bb.5:
	movq	_IOMMU_MAX_PRE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	cmpq	%rbx, %rsi
	jle	LBB0_10
## %bb.6:
	cltq
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	$2, %r15d
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	subq	%rbx, %rsi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_ulmin
	movq	%rax, %rdi
	callq	_round_io_page
	movq	%rax, %r14
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdx
	movq	%r13, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	%r14, %rcx
	callq	_iommu_dvma_valloc
	testl	%eax, %eax
	jne	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	cmpl	-44(%rbp), %r15d                ## 4-byte Folded Reload
	jge	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	addq	%r14, %rbx
	incl	%r15d
	movq	_IOMMU_MAX_PRE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	cmpq	%rbx, %rsi
	jg	LBB0_7
LBB0_10:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_IS_LOCK
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rsi
	movq	%rbx, %rdi
	callq	_iommu_map_insq
	movq	%rbx, %rdi
	callq	_IS_UNLOCK
LBB0_11:
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BUS_DMA_COHERENT,4,2           ## @BUS_DMA_COHERENT
	.comm	_DMF_COHERENT,4,2               ## @DMF_COHERENT
	.comm	_IOMMU_MAX_PRE,8,3              ## @IOMMU_MAX_PRE
	.comm	_IOMMU_MAX_PRE_SEG,4,2          ## @IOMMU_MAX_PRE_SEG
	.no_dead_strip	_iommu_dvmamap_create
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iommu_dvmamap_create
_iommu_dvmamap_create:                  ; @iommu_dvmamap_create
	.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, x2
	mov	x22, x1
	mov	x21, x0
	ldr	x19, [x0, #8]
	mov	x1, x2
	bl	_sparc64_dma_alloc_map
	cbnz	w0, LBB0_7
; %bb.1:
Lloh0:
	adrp	x8, _BUS_DMA_COHERENT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BUS_DMA_COHERENT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, _DMF_COHERENT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DMF_COHERENT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	x9, [x20]
	ldr	w10, [x9]
	orr	w8, w10, w8
	str	w8, [x9]
LBB0_3:
	ldr	w0, [x21]
	bl	_IOMMU_SIZE_ROUNDUP
Lloh6:
	adrp	x26, _IOMMU_MAX_PRE@GOTPAGE
Lloh7:
	ldr	x26, [x26, _IOMMU_MAX_PRE@GOTPAGEOFF]
	ldr	x1, [x26]
	bl	_ulmin
	mov	x22, x0
	ldr	x2, [x20]
	mov	x0, x21
	mov	x1, x19
	mov	x3, x22
	bl	_iommu_dvma_valloc
	cbnz	w0, LBB0_6
; %bb.4:
	ldr	w0, [x21, #4]
Lloh8:
	adrp	x8, _IOMMU_MAX_PRE_SEG@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IOMMU_MAX_PRE_SEG@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	bl	_imin
	ldr	x8, [x26]
	cmp	w0, #2
	ccmp	x8, x22, #4, ge
	b.gt	LBB0_8
LBB0_5:
	mov	x0, x19
	bl	_IS_LOCK
	ldr	x1, [x20]
	mov	x0, x19
	bl	_iommu_map_insq
	mov	x0, x19
	bl	_IS_UNLOCK
LBB0_6:
	mov	w0, #0
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
LBB0_8:
	mov	x23, x0
	ldr	w9, [x21]
	sdiv	w9, w9, w0
	sxtw	x24, w9
	mov	w27, #2
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	sub	x1, x8, x22
	mov	x0, x24
	bl	_ulmin
	bl	_round_io_page
	mov	x25, x0
	ldr	x2, [x20]
	mov	x0, x21
	mov	x1, x19
	mov	x3, x25
	bl	_iommu_dvma_valloc
	cbnz	w0, LBB0_5
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	cmp	w27, w23
	b.ge	LBB0_5
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x26]
	add	w27, w27, #1
	add	x22, x25, x22
	cmp	x8, x22
	b.gt	LBB0_9
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_BUS_DMA_COHERENT,4,2           ; @BUS_DMA_COHERENT
	.comm	_DMF_COHERENT,4,2               ; @DMF_COHERENT
	.comm	_IOMMU_MAX_PRE,8,3              ; @IOMMU_MAX_PRE
	.comm	_IOMMU_MAX_PRE_SEG,4,2          ; @IOMMU_MAX_PRE_SEG
	.no_dead_strip	_iommu_dvmamap_create
.subsections_via_symbols
