	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iommu_pasid_shutdown_callback
_iommu_pasid_shutdown_callback:         ## @iommu_pasid_shutdown_callback
	.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
	movl	%esi, %ebx
	callq	_kfd_device_by_pci_dev
	testq	%rax, %rax
	je	LBB0_9
## %bb.1:
	movq	%rax, %r15
	movl	%ebx, %edi
	callq	_kfd_lookup_process_by_pasid
	testq	%rax, %rax
	je	LBB0_9
## %bb.2:
	movq	%rax, %r12
	movq	%rax, %r14
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_pr_debug
	xorl	%eax, %eax
	callq	_kfd_get_dbgmgr_mutex
	movq	%rax, %rdi
	callq	_mutex_lock
	movq	(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.3:
	movq	(%rdi), %rax
	cmpq	(%r14), %rax
	jne	LBB0_6
## %bb.4:
	movq	%r14, %rsi
	callq	_kfd_dbgmgr_unregister
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:
	movq	(%r15), %rdi
	callq	_kfd_dbgmgr_destroy
	movq	$0, (%r15)
LBB0_6:
	xorl	%eax, %eax
	callq	_kfd_get_dbgmgr_mutex
	movq	%rax, %rdi
	callq	_mutex_unlock
	addq	$8, %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_kfd_get_process_device_data
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	%rax, %rdi
	callq	_kfd_process_dequeue_from_device
LBB0_8:
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kfd_unref_process              ## TAILCALL
LBB0_9:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unbinding process %d from IOMMU\n"

	.no_dead_strip	_iommu_pasid_shutdown_callback
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iommu_pasid_shutdown_callback
_iommu_pasid_shutdown_callback:         ; @iommu_pasid_shutdown_callback
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x1
	bl	_kfd_device_by_pci_dev
	cbz	x0, LBB0_9
; %bb.1:
	mov	x20, x0
	mov	x0, x21
	bl	_kfd_lookup_process_by_pasid
	cbz	x0, LBB0_9
; %bb.2:
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_pr_debug
	bl	_kfd_get_dbgmgr_mutex
	bl	_mutex_lock
	ldr	x0, [x20]
	cbz	x0, LBB0_6
; %bb.3:
	ldr	x8, [x0]
	ldr	x9, [x19]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.4:
	mov	x1, x19
	bl	_kfd_dbgmgr_unregister
	cbnz	w0, LBB0_6
; %bb.5:
	ldr	x0, [x20]
	bl	_kfd_dbgmgr_destroy
	str	xzr, [x20]
LBB0_6:
	bl	_kfd_get_dbgmgr_mutex
	bl	_mutex_unlock
	add	x21, x19, #8
	mov	x0, x21
	bl	_mutex_lock
	mov	x0, x20
	mov	x1, x19
	bl	_kfd_get_process_device_data
	cbz	x0, LBB0_8
; %bb.7:
	bl	_kfd_process_dequeue_from_device
LBB0_8:
	mov	x0, x21
	bl	_mutex_unlock
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_kfd_unref_process
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unbinding process %d from IOMMU\n"

	.no_dead_strip	_iommu_pasid_shutdown_callback
.subsections_via_symbols
