	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iommu_dma_alloc_iova
_iommu_dma_alloc_iova:                  ## @iommu_dma_alloc_iova
	.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	%rcx, %rbx
	movq	%rsi, %r14
	movq	16(%rdi), %r13
	movq	(%r13), %rax
	movq	_IOMMU_DMA_MSI_COOKIE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	8(%r13), %rax
	addq	%rax, %r14
	movq	%r14, 8(%r13)
	jmp	LBB0_11
LBB0_2:
	movq	%rdx, %r12
	movq	%rdi, %r15
	addq	$16, %r13
	movq	%r13, %rdi
	callq	_iova_shift
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	%eax, %ecx
	shrq	%cl, %r14
	movq	_IOVA_RANGE_CACHE_MAX_SIZE@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	decb	%cl
	movl	$1, %eax
	shll	%cl, %eax
	cltq
	cmpq	%rax, %r14
	jae	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	callq	_roundup_pow_of_two
	movq	%rax, %r14
LBB0_4:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %eax
	xorl	%ecx, %ecx
	cmpl	$1, %eax
	sbbl	%ecx, %ecx
	orl	%eax, %ecx
	movslq	%ecx, %rbx
	andq	%r12, %rbx
	cmpq	$0, 8(%r15)
	je	LBB0_6
## %bb.5:
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_min
	movq	%rax, %rbx
LBB0_6:
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movl	$32, %edi
	callq	_DMA_BIT_MASK
	cmpq	%rax, %rbx
	jbe	LBB0_9
## %bb.7:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_is_pci
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movl	$32, %edi
	callq	_DMA_BIT_MASK
	movl	%r15d, %ecx
	shrq	%cl, %rax
	movq	%r13, %rdi
	movq	%r14, %rsi
	movq	%rax, %rdx
	xorl	%ecx, %ecx
	callq	_alloc_iova_fast
	testq	%rax, %rax
	jne	LBB0_10
LBB0_9:
	movl	%r15d, %ecx
	shrq	%cl, %rbx
	movq	%r13, %rdi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	movl	$1, %ecx
	callq	_alloc_iova_fast
LBB0_10:
	movl	%r15d, %ecx
	shlq	%cl, %rax
LBB0_11:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IOMMU_DMA_MSI_COOKIE,8,3       ## @IOMMU_DMA_MSI_COOKIE
	.comm	_IOVA_RANGE_CACHE_MAX_SIZE,4,2  ## @IOVA_RANGE_CACHE_MAX_SIZE
	.no_dead_strip	_iommu_dma_alloc_iova
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iommu_dma_alloc_iova
_iommu_dma_alloc_iova:                  ; @iommu_dma_alloc_iova
	.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
	mov	x21, x1
	ldr	x8, [x0, #16]
	mov	x19, x8
	ldr	x9, [x19], #16
Lloh0:
	adrp	x10, _IOMMU_DMA_MSI_COOKIE@GOTPAGE
Lloh1:
	ldr	x10, [x10, _IOMMU_DMA_MSI_COOKIE@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_2
; %bb.1:
	ldr	x0, [x8, #8]
	add	x9, x0, x21
	str	x9, [x8, #8]
	b	LBB0_11
LBB0_2:
	mov	x22, x3
	mov	x23, x2
	mov	x24, x0
	mov	x0, x19
	bl	_iova_shift
	mov	x20, x0
Lloh3:
	adrp	x8, _IOVA_RANGE_CACHE_MAX_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IOVA_RANGE_CACHE_MAX_SIZE@GOTPAGEOFF]
	lsr	x21, x21, x0
Lloh5:
	ldr	w8, [x8]
	sub	w8, w8, #1
	mov	w9, #1
	lsl	w8, w9, w8
	cmp	x21, w8, sxtw
	b.hs	LBB0_4
; %bb.3:
	mov	x0, x21
	bl	_roundup_pow_of_two
	mov	x21, x0
LBB0_4:
	ldr	w8, [x22]
	cmp	w8, #0
	csinv	w8, w8, wzr, ne
	sxtw	x8, w8
	and	x23, x8, x23
	ldr	x8, [x24, #8]
	cbz	x8, LBB0_6
; %bb.5:
	ldr	w1, [x24]
	mov	x0, x23
	bl	_min
	mov	x23, x0
LBB0_6:
	mov	w0, #32
	bl	_DMA_BIT_MASK
	cmp	x23, x0
	b.ls	LBB0_9
; %bb.7:
	mov	x0, x22
	bl	_dev_is_pci
	cbz	x0, LBB0_9
; %bb.8:
	mov	w0, #32
	bl	_DMA_BIT_MASK
	lsr	x2, x0, x20
	mov	x0, x19
	mov	x1, x21
	mov	w3, #0
	bl	_alloc_iova_fast
	cbnz	x0, LBB0_10
LBB0_9:
	lsr	x2, x23, x20
	mov	x0, x19
	mov	x1, x21
	mov	w3, #1
	bl	_alloc_iova_fast
LBB0_10:
	lsl	x0, x0, x20
LBB0_11:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_IOMMU_DMA_MSI_COOKIE,8,3       ; @IOMMU_DMA_MSI_COOKIE
	.comm	_IOVA_RANGE_CACHE_MAX_SIZE,4,2  ; @IOVA_RANGE_CACHE_MAX_SIZE
	.no_dead_strip	_iommu_dma_alloc_iova
.subsections_via_symbols
