	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_domain
_get_domain:                            ## @get_domain
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_check_device
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	%r14, %rdi
	callq	_get_dev_data
	movq	8(%rax), %rbx
	testq	%rbx, %rbx
	je	LBB0_3
LBB0_5:
	movq	%rbx, %rdi
	callq	_dma_ops_domain
	testl	%eax, %eax
	je	LBB0_6
## %bb.8:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %r15
	jmp	LBB0_7
LBB0_3:
	movq	%r14, %rdi
	callq	_get_dev_data
	movq	_EBUSY@GOTPCREL(%rip), %r15
	cmpl	$0, (%rax)
	je	LBB0_7
## %bb.4:
	movq	%r14, %rdi
	callq	_get_dev_data
	movl	$0, (%rax)
	movq	%r14, %rdi
	callq	_iommu_get_domain_for_dev
	movq	%rax, %rdi
	callq	_to_pdomain
	movq	%rax, %rbx
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_attach_device
	testq	%rbx, %rbx
	jne	LBB0_5
	jmp	LBB0_7
LBB0_6:
	movq	_EBUSY@GOTPCREL(%rip), %r15
LBB0_7:
	xorl	%edi, %edi
	subl	(%r15), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_get_domain
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_domain
_get_domain:                            ; @get_domain
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	bl	_check_device
	cbz	w0, LBB0_4
; %bb.1:
	mov	x0, x19
	bl	_get_dev_data
	ldr	x20, [x0, #8]
	cbz	x20, LBB0_5
LBB0_2:
	mov	x0, x20
	bl	_dma_ops_domain
	cbz	w0, LBB0_7
; %bb.3:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_4:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_8
LBB0_5:
	mov	x0, x19
	bl	_get_dev_data
	ldr	w8, [x0]
	cbz	w8, LBB0_7
; %bb.6:
	mov	x0, x19
	bl	_get_dev_data
	str	wzr, [x0]
	mov	x0, x19
	bl	_iommu_get_domain_for_dev
	bl	_to_pdomain
	mov	x20, x0
	mov	x0, x19
	mov	x1, x20
	bl	_attach_device
	cbnz	x20, LBB0_2
LBB0_7:
Lloh2:
	adrp	x8, _EBUSY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_ERR_PTR
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_get_domain
.subsections_via_symbols
