	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __detach_device
___detach_device:                       ## @__detach_device
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	_amd_iommu_rlookup_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%rsi,8), %r14
	leaq	12(%rdi), %r12
	movq	%r12, %rdi
	callq	_spin_lock
	movq	_amd_iommu_pd_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	$0, (%rax,%rbx,8)
	movq	_IOMMU_PTE_P@GOTPCREL(%rip), %rax
	movq	_IOMMU_PTE_TV@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_amd_iommu_dev_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%rbx,8), %rax
	movl	%ecx, (%rax)
	movq	$0, 4(%rax)
	movq	%rbx, %rdi
	callq	_amd_iommu_apply_erratum_63
	decq	(%r15)
	movq	%r12, %rdi
	callq	_spin_unlock
	movq	_iommu_pass_through@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_3
## %bb.1:
	movq	_pt_domain@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	cmpq	%r15, %rsi
	je	LBB0_3
## %bb.2:
	movq	%r14, %rdi
	movq	%rbx, %rdx
	callq	___attach_device
LBB0_3:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_iommu_queue_inv_dev_entry
	cmpq	$0, (%r15)
	jne	LBB0_5
## %bb.4:
	movl	8(%r15), %esi
	movq	%r14, %rdi
	callq	_iommu_flush_tlb_pde
LBB0_5:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_iommu_completion_wait          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_amd_iommu_rlookup_table,8,3    ## @amd_iommu_rlookup_table
	.comm	_amd_iommu_pd_table,8,3         ## @amd_iommu_pd_table
	.comm	_IOMMU_PTE_P,4,2                ## @IOMMU_PTE_P
	.comm	_IOMMU_PTE_TV,4,2               ## @IOMMU_PTE_TV
	.comm	_amd_iommu_dev_table,8,3        ## @amd_iommu_dev_table
	.comm	_iommu_pass_through,8,3         ## @iommu_pass_through
	.comm	_pt_domain,8,3                  ## @pt_domain
	.no_dead_strip	___detach_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __detach_device
___detach_device:                       ; @__detach_device
	.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
Lloh0:
	adrp	x8, _amd_iommu_rlookup_table@GOTPAGE
Lloh1:
	ldr	x8, [x8, _amd_iommu_rlookup_table@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	lsl	x23, x1, #3
	ldr	x19, [x8, x23]
	add	x22, x0, #12
	mov	x0, x22
	bl	_spin_lock
Lloh3:
	adrp	x8, _amd_iommu_pd_table@GOTPAGE
Lloh4:
	ldr	x8, [x8, _amd_iommu_pd_table@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	str	xzr, [x8, x23]
Lloh6:
	adrp	x8, _IOMMU_PTE_P@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IOMMU_PTE_P@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _IOMMU_PTE_TV@GOTPAGE
Lloh10:
	ldr	x9, [x9, _IOMMU_PTE_TV@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh12:
	adrp	x9, _amd_iommu_dev_table@GOTPAGE
Lloh13:
	ldr	x9, [x9, _amd_iommu_dev_table@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	ldr	x9, [x9, x23]
	stp	wzr, wzr, [x9, #4]
	str	w8, [x9]
	mov	x0, x21
	bl	_amd_iommu_apply_erratum_63
	ldr	x8, [x20]
	sub	x8, x8, #1
	str	x8, [x20]
	mov	x0, x22
	bl	_spin_unlock
Lloh15:
	adrp	x8, _iommu_pass_through@GOTPAGE
Lloh16:
	ldr	x8, [x8, _iommu_pass_through@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	cbz	x8, LBB0_3
; %bb.1:
Lloh18:
	adrp	x8, _pt_domain@GOTPAGE
Lloh19:
	ldr	x8, [x8, _pt_domain@GOTPAGEOFF]
Lloh20:
	ldr	x1, [x8]
	cmp	x1, x20
	b.eq	LBB0_3
; %bb.2:
	mov	x0, x19
	mov	x2, x21
	bl	___attach_device
LBB0_3:
	mov	x0, x19
	mov	x1, x21
	bl	_iommu_queue_inv_dev_entry
	ldr	x8, [x20]
	cbnz	x8, LBB0_5
; %bb.4:
	ldr	w1, [x20, #8]
	mov	x0, x19
	bl	_iommu_flush_tlb_pde
LBB0_5:
	mov	x0, x19
	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
	b	_iommu_completion_wait
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_amd_iommu_rlookup_table,8,3    ; @amd_iommu_rlookup_table
	.comm	_amd_iommu_pd_table,8,3         ; @amd_iommu_pd_table
	.comm	_IOMMU_PTE_P,4,2                ; @IOMMU_PTE_P
	.comm	_IOMMU_PTE_TV,4,2               ; @IOMMU_PTE_TV
	.comm	_amd_iommu_dev_table,8,3        ; @amd_iommu_dev_table
	.comm	_iommu_pass_through,8,3         ; @iommu_pass_through
	.comm	_pt_domain,8,3                  ; @pt_domain
	.no_dead_strip	___detach_device
.subsections_via_symbols
