	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function request_default_domain_for_dev
_request_default_domain_for_dev:        ## @request_default_domain_for_dev
	.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
	movq	%rsi, %r15
	movq	%rdi, %r14
	callq	_iommu_group_get
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_mutex_lock
	movq	8(%r12), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	xorl	%ebx, %ebx
	cmpq	%r15, (%rax)
	je	LBB0_11
LBB0_4:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	%r12, %rdi
	callq	_iommu_group_device_count
	cmpl	$1, %eax
	jne	LBB0_11
## %bb.5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	movl	(%r14), %edi
	movq	%r15, %rsi
	callq	___iommu_domain_alloc
	movl	%r13d, %ebx
	testq	%rax, %rax
	je	LBB0_11
## %bb.6:
	movq	%rax, %r13
	movq	%rax, %rdi
	movq	%r12, %rsi
	callq	___iommu_attach_group
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	_iommu_domain_free
	jmp	LBB0_11
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_8:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_iommu_group_create_direct_mappings
	movq	8(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.9:
	callq	_iommu_domain_free
LBB0_10:
	movq	%r13, 8(%r12)
	movq	_IOMMU_DOMAIN_DMA@GOTPCREL(%rip), %rax
	cmpq	%r15, (%rax)
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str.2(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_info
	xorl	%ebx, %ebx
LBB0_11:
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	%r12, %rdi
	callq	_iommu_group_put
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Using iommu %s mapping\n"

	.comm	_IOMMU_DOMAIN_DMA,8,3           ## @IOMMU_DOMAIN_DMA
L_.str.1:                               ## @.str.1
	.asciz	"dma"

L_.str.2:                               ## @.str.2
	.asciz	"direct"

	.no_dead_strip	_request_default_domain_for_dev
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function request_default_domain_for_dev
_request_default_domain_for_dev:        ; @request_default_domain_for_dev
	.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
	mov	x20, x0
	bl	_iommu_group_get
	cbz	x0, LBB0_7
; %bb.1:
	mov	x19, x0
	bl	_mutex_lock
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_3
; %bb.2:
	ldr	x8, [x8]
	cmp	x8, x21
	b.eq	LBB0_12
LBB0_3:
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	mov	x0, x19
	bl	_iommu_group_device_count
	cmp	w0, #1
	b.ne	LBB0_8
; %bb.4:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
	ldr	w0, [x20]
	mov	x1, x21
	bl	___iommu_domain_alloc
	cbz	x0, LBB0_8
; %bb.5:
	mov	x23, x0
	mov	x1, x19
	bl	___iommu_attach_group
	cbz	w0, LBB0_9
; %bb.6:
	mov	x22, x0
	mov	x0, x23
	bl	_iommu_domain_free
	b	LBB0_13
LBB0_7:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_14
LBB0_8:
	neg	w22, w22
	b	LBB0_13
LBB0_9:
	mov	x0, x19
	mov	x1, x20
	bl	_iommu_group_create_direct_mappings
	ldr	x0, [x19, #8]
	cbz	x0, LBB0_11
; %bb.10:
	bl	_iommu_domain_free
LBB0_11:
	str	x23, [x19, #8]
Lloh9:
	adrp	x8, _IOMMU_DOMAIN_DMA@GOTPAGE
Lloh10:
	ldr	x8, [x8, _IOMMU_DOMAIN_DMA@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
Lloh12:
	adrp	x9, l_.str.2@PAGE
Lloh13:
	add	x9, x9, l_.str.2@PAGEOFF
Lloh14:
	adrp	x10, l_.str.1@PAGE
Lloh15:
	add	x10, x10, l_.str.1@PAGEOFF
	cmp	x8, x21
	csel	x2, x10, x9, eq
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_info
LBB0_12:
	mov	w22, #0
LBB0_13:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x19
	bl	_iommu_group_put
LBB0_14:
	mov	x0, x22
	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
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Using iommu %s mapping\n"

	.comm	_IOMMU_DOMAIN_DMA,8,3           ; @IOMMU_DOMAIN_DMA
l_.str.1:                               ; @.str.1
	.asciz	"dma"

l_.str.2:                               ; @.str.2
	.asciz	"direct"

	.no_dead_strip	_request_default_domain_for_dev
.subsections_via_symbols
