	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iommu_dvmamem_alloc
_iommu_dvmamem_alloc:                   ## @iommu_dvmamem_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
	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, %r12
	movl	%edx, %r15d
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movq	8(%rdi), %r13
	movq	%rcx, %rsi
	callq	_sparc64_dma_alloc_map
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_12
## %bb.1:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	_BUS_DMA_NOWAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%r15d, %eax
	movl	%r15d, %r13d
	jne	LBB0_2
## %bb.3:
	movq	_M_WAITOK@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_2:
	movq	_M_NOWAIT@GOTPCREL(%rip), %rax
LBB0_4:
	movq	%r12, %r15
	movq	_BUS_DMA_ZERO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	andl	%r13d, %edx
	je	LBB0_6
## %bb.5:
	movq	_M_ZERO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
LBB0_6:
	orl	(%rax), %edx
	movl	(%rbx), %edi
	movq	_M_IOMMU@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_malloc
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	_BUS_DMA_COHERENT@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	je	LBB0_9
## %bb.10:
	movq	_DMF_COHERENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%r15), %r14
	orl	%eax, (%r14)
	jmp	LBB0_11
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	(%r15), %rsi
	movq	%rbx, %rdi
	callq	_sparc64_dma_free_map
	jmp	LBB0_12
LBB0_9:
	movq	(%r15), %r14
LBB0_11:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movl	(%rbx), %edi
	callq	_IOMMU_SIZE_ROUNDUP
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movq	%r14, %rdx
	movl	%eax, %ecx
	callq	_iommu_dvma_valloc
	movq	%r12, %rdi
	callq	_IS_LOCK
	movq	(%r15), %rsi
	movq	%r12, %rdi
	callq	_iommu_map_insq
	movq	%r12, %rdi
	callq	_IS_UNLOCK
	xorl	%r14d, %r14d
LBB0_12:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BUS_DMA_NOWAIT,4,2             ## @BUS_DMA_NOWAIT
	.comm	_M_NOWAIT,4,2                   ## @M_NOWAIT
	.comm	_M_WAITOK,4,2                   ## @M_WAITOK
	.comm	_BUS_DMA_ZERO,4,2               ## @BUS_DMA_ZERO
	.comm	_M_ZERO,4,2                     ## @M_ZERO
	.comm	_M_IOMMU,4,2                    ## @M_IOMMU
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_BUS_DMA_COHERENT,4,2           ## @BUS_DMA_COHERENT
	.comm	_DMF_COHERENT,4,2               ## @DMF_COHERENT
	.no_dead_strip	_iommu_dvmamem_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iommu_dvmamem_alloc
_iommu_dvmamem_alloc:                   ; @iommu_dvmamem_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
	mov	x19, x3
	mov	x22, x2
	mov	x23, x1
	mov	x21, x0
	ldr	x20, [x0, #8]
	mov	x1, x3
	bl	_sparc64_dma_alloc_map
	mov	x24, x0
	cbnz	w0, LBB0_7
; %bb.1:
Lloh0:
	adrp	x8, _BUS_DMA_NOWAIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BUS_DMA_NOWAIT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _M_WAITOK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _M_WAITOK@GOTPAGEOFF]
Lloh5:
	adrp	x10, _M_NOWAIT@GOTPAGE
Lloh6:
	ldr	x10, [x10, _M_NOWAIT@GOTPAGEOFF]
	tst	w8, w22
	csel	x8, x9, x10, eq
Lloh7:
	adrp	x9, _BUS_DMA_ZERO@GOTPAGE
Lloh8:
	ldr	x9, [x9, _BUS_DMA_ZERO@GOTPAGEOFF]
	ldr	w8, [x8]
Lloh9:
	ldr	w9, [x9]
Lloh10:
	adrp	x10, _M_ZERO@GOTPAGE
Lloh11:
	ldr	x10, [x10, _M_ZERO@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
	tst	w9, w22
	csel	w9, wzr, w10, eq
	orr	w2, w9, w8
	ldr	w0, [x21]
Lloh13:
	adrp	x8, _M_IOMMU@GOTPAGE
Lloh14:
	ldr	x8, [x8, _M_IOMMU@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	bl	_malloc
	str	x0, [x23]
	cbz	x0, LBB0_4
; %bb.2:
Lloh16:
	adrp	x8, _BUS_DMA_COHERENT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _BUS_DMA_COHERENT@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_5
; %bb.3:
Lloh19:
	adrp	x8, _DMF_COHERENT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _DMF_COHERENT@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	ldr	x22, [x19]
	ldr	w9, [x22]
	orr	w8, w9, w8
	str	w8, [x22]
	b	LBB0_6
LBB0_4:
Lloh22:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh24:
	ldr	w24, [x8]
	ldr	x1, [x19]
	mov	x0, x21
	bl	_sparc64_dma_free_map
	b	LBB0_7
LBB0_5:
	ldr	x22, [x19]
LBB0_6:
	ldr	w0, [x21]
	bl	_IOMMU_SIZE_ROUNDUP
	mov	x3, x0
	mov	x0, x21
	mov	x1, x20
	mov	x2, x22
	bl	_iommu_dvma_valloc
	mov	x0, x20
	bl	_IS_LOCK
	ldr	x1, [x19]
	mov	x0, x20
	bl	_iommu_map_insq
	mov	x0, x20
	bl	_IS_UNLOCK
	mov	w24, #0
LBB0_7:
	mov	x0, x24
	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	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_BUS_DMA_NOWAIT,4,2             ; @BUS_DMA_NOWAIT
	.comm	_M_NOWAIT,4,2                   ; @M_NOWAIT
	.comm	_M_WAITOK,4,2                   ; @M_WAITOK
	.comm	_BUS_DMA_ZERO,4,2               ; @BUS_DMA_ZERO
	.comm	_M_ZERO,4,2                     ; @M_ZERO
	.comm	_M_IOMMU,4,2                    ; @M_IOMMU
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_BUS_DMA_COHERENT,4,2           ; @BUS_DMA_COHERENT
	.comm	_DMF_COHERENT,4,2               ; @DMF_COHERENT
	.no_dead_strip	_iommu_dvmamem_alloc
.subsections_via_symbols
