	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function device_change_notifier
_device_change_notifier:                ## @device_change_notifier
	.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	%rdx, %r12
	movq	%rsi, %rbx
	movq	%rdx, %rdi
	callq	_to_pci_dev
	movq	8(%rax), %rcx
	movl	(%rcx), %edi
	movl	(%rax), %esi
	callq	_calc_devid
	movq	_amd_iommu_last_bdf@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	ja	LBB0_13
## %bb.1:
	movq	_amd_iommu_alias_table@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx,%rax,8), %r15
	movq	_amd_iommu_rlookup_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%r15,8), %r14
	testq	%r14, %r14
	je	LBB0_13
## %bb.2:
	movq	%r15, %rdi
	callq	_domain_for_device
	cmpq	$129, %rbx
	je	LBB0_7
## %bb.3:
	cmpq	$128, %rbx
	jne	LBB0_13
## %bb.4:
	testq	%rax, %rax
	je	LBB0_13
## %bb.5:
	movq	_iommu_pass_through@GOTPCREL(%rip), %rcx
	cmpl	$0, (%rcx)
	jne	LBB0_12
## %bb.6:
	movq	%rax, %rdi
	movq	%r15, %rsi
	callq	_detach_device
	jmp	LBB0_12
LBB0_7:
	movq	_iommu_pass_through@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_9
## %bb.8:
	movq	_pt_domain@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movq	%r15, %rdx
	callq	_attach_device
LBB0_12:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_iommu_queue_inv_dev_entry
	movq	%r14, %rdi
	callq	_iommu_completion_wait
LBB0_13:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%r15, %rdi
	callq	_find_protection_domain
	testq	%rax, %rax
	jne	LBB0_13
## %bb.10:
	movq	%r14, %rdi
	callq	_dma_ops_domain_alloc
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:
	movq	%rax, %rbx
	movq	%r15, (%rax)
	movq	_iommu_pd_list_lock@GOTPCREL(%rip), %r13
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	addq	$8, %rbx
	movq	_iommu_pd_list@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	callq	_list_add_tail
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	movq	_amd_iommu_dma_ops@GOTPCREL(%rip), %rax
	movq	%rax, (%r12)
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_amd_iommu_last_bdf,8,3         ## @amd_iommu_last_bdf
	.comm	_amd_iommu_alias_table,8,3      ## @amd_iommu_alias_table
	.comm	_amd_iommu_rlookup_table,8,3    ## @amd_iommu_rlookup_table
	.comm	_iommu_pass_through,4,2         ## @iommu_pass_through
	.comm	_pt_domain,4,2                  ## @pt_domain
	.comm	_iommu_pd_list_lock,4,2         ## @iommu_pd_list_lock
	.comm	_iommu_pd_list,4,2              ## @iommu_pd_list
	.comm	_amd_iommu_dma_ops,4,2          ## @amd_iommu_dma_ops
	.no_dead_strip	_device_change_notifier
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function device_change_notifier
_device_change_notifier:                ; @device_change_notifier
	.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, x2
	mov	x22, x1
	mov	x0, x2
	bl	_to_pci_dev
	ldr	x8, [x0, #8]
	ldr	w8, [x8]
	ldr	w1, [x0]
	mov	x0, x8
	bl	_calc_devid
Lloh0:
	adrp	x8, _amd_iommu_last_bdf@GOTPAGE
Lloh1:
	ldr	x8, [x8, _amd_iommu_last_bdf@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.hi	LBB0_10
; %bb.1:
Lloh3:
	adrp	x8, _amd_iommu_alias_table@GOTPAGE
Lloh4:
	ldr	x8, [x8, _amd_iommu_alias_table@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	x20, [x8, x0, lsl #3]
Lloh6:
	adrp	x8, _amd_iommu_rlookup_table@GOTPAGE
Lloh7:
	ldr	x8, [x8, _amd_iommu_rlookup_table@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	ldr	x19, [x8, x20, lsl #3]
	cbz	x19, LBB0_10
; %bb.2:
	mov	x0, x20
	bl	_domain_for_device
	cmp	x22, #129
	b.eq	LBB0_7
; %bb.3:
	cmp	x22, #128
	b.ne	LBB0_10
; %bb.4:
	cbz	x0, LBB0_10
; %bb.5:
Lloh9:
	adrp	x8, _iommu_pass_through@GOTPAGE
Lloh10:
	ldr	x8, [x8, _iommu_pass_through@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cbnz	w8, LBB0_9
; %bb.6:
	mov	x1, x20
	bl	_detach_device
	b	LBB0_9
LBB0_7:
Lloh12:
	adrp	x8, _iommu_pass_through@GOTPAGE
Lloh13:
	ldr	x8, [x8, _iommu_pass_through@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cbz	w8, LBB0_11
; %bb.8:
Lloh15:
	adrp	x8, _pt_domain@GOTPAGE
Lloh16:
	ldr	x8, [x8, _pt_domain@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_attach_device
LBB0_9:
	mov	x0, x19
	mov	x1, x20
	bl	_iommu_queue_inv_dev_entry
	mov	x0, x19
	bl	_iommu_completion_wait
LBB0_10:
	mov	w0, #0
	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
LBB0_11:
	mov	x0, x20
	bl	_find_protection_domain
	cbnz	x0, LBB0_10
; %bb.12:
	mov	x0, x19
	bl	_dma_ops_domain_alloc
	cbz	x0, LBB0_10
; %bb.13:
	mov	x22, x0
	str	x20, [x22], #8
Lloh18:
	adrp	x23, _iommu_pd_list_lock@GOTPAGE
Lloh19:
	ldr	x23, [x23, _iommu_pd_list_lock@GOTPAGEOFF]
	mov	x0, x23
	bl	_spin_lock_irqsave
Lloh20:
	adrp	x1, _iommu_pd_list@GOTPAGE
Lloh21:
	ldr	x1, [x1, _iommu_pd_list@GOTPAGEOFF]
	mov	x0, x22
	bl	_list_add_tail
	mov	x0, x23
	bl	_spin_unlock_irqrestore
Lloh22:
	adrp	x8, _amd_iommu_dma_ops@GOTPAGE
Lloh23:
	ldr	x8, [x8, _amd_iommu_dma_ops@GOTPAGEOFF]
	str	x8, [x21]
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_amd_iommu_last_bdf,8,3         ; @amd_iommu_last_bdf
	.comm	_amd_iommu_alias_table,8,3      ; @amd_iommu_alias_table
	.comm	_amd_iommu_rlookup_table,8,3    ; @amd_iommu_rlookup_table
	.comm	_iommu_pass_through,4,2         ; @iommu_pass_through
	.comm	_pt_domain,4,2                  ; @pt_domain
	.comm	_iommu_pd_list_lock,4,2         ; @iommu_pd_list_lock
	.comm	_iommu_pd_list,4,2              ; @iommu_pd_list
	.comm	_amd_iommu_dma_ops,4,2          ; @amd_iommu_dma_ops
	.no_dead_strip	_device_change_notifier
.subsections_via_symbols
