	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amd_iommu_bind_pasid           ## -- Begin function amd_iommu_bind_pasid
	.p2align	4, 0x90
_amd_iommu_bind_pasid:                  ## @amd_iommu_bind_pasid
	.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, %r13
	movl	%esi, %r15d
	movq	%rdi, %rbx
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_might_sleep
	xorl	%eax, %eax
	callq	_amd_iommu_v2_supported
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	%rbx, %rdi
	callq	_device_id
	movl	%eax, %edi
	callq	_get_device_state
	movq	%rax, %r14
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	testq	%r14, %r14
	je	LBB0_14
## %bb.3:
	testl	%r15d, %r15d
	js	LBB0_13
## %bb.4:
	cmpl	%r15d, (%r14)
	jle	LBB0_13
## %bb.5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$48, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_13
## %bb.6:
	movq	%rax, %rbx
	leaq	40(%rax), %rdi
	movl	$1, %esi
	callq	_atomic_set
	leaq	36(%rbx), %rdi
	callq	_init_waitqueue_head
	leaq	32(%rbx), %rdi
	callq	_spin_lock_init
	movq	%r13, %rdi
	callq	_get_task_mm
	movq	%rax, 16(%rbx)
	movq	%r14, 24(%rbx)
	movl	%r15d, (%rbx)
	movl	$1, 4(%rbx)
	movq	_iommu_mn@GOTPCREL(%rip), %rcx
	movq	%rcx, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_12
## %bb.7:
	movq	%rbx, %r13
	addq	$8, %r13
	movq	%r13, %rdi
	movq	%rax, %rsi
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	callq	_mmu_notifier_register
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movl	%r15d, %edx
	callq	_set_pasid_state
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_11
## %bb.8:
	movl	4(%r14), %r12d
	movq	16(%rbx), %rax
	movl	(%rax), %edi
	callq	___pa
	movl	%r12d, %edi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_amd_iommu_domain_set_gcr3
	testl	%eax, %eax
	je	LBB0_9
## %bb.10:
	movl	%eax, %r12d
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_clear_pasid_state
LBB0_11:
	movq	%r13, %rdi
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rsi
	callq	_mmu_notifier_unregister
	movq	%r15, %rdi
	callq	_mmput
LBB0_12:
	movq	%rbx, %rdi
	callq	_free_pasid_state
LBB0_13:
	movq	%r14, %rdi
	callq	_put_device_state
	jmp	LBB0_14
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
LBB0_14:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	$0, 4(%rbx)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mmput
	xorl	%r12d, %r12d
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_iommu_mn,4,2                   ## @iommu_mn
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amd_iommu_bind_pasid           ; -- Begin function amd_iommu_bind_pasid
	.p2align	2
_amd_iommu_bind_pasid:                  ; @amd_iommu_bind_pasid
	.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	x23, x2
	mov	x20, x1
	mov	x19, x0
	bl	_might_sleep
	bl	_amd_iommu_v2_supported
	cbz	w0, LBB0_12
; %bb.1:
	mov	x0, x19
	bl	_device_id
	bl	_get_device_state
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w21, w8
	cbz	x0, LBB0_13
; %bb.2:
	mov	x19, x0
	tbnz	w20, #31, LBB0_11
; %bb.3:
	ldr	w8, [x19]
	cmp	w8, w20
	b.le	LBB0_11
; %bb.4:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w21, w8
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	w0, #48
	bl	_kzalloc
	cbz	x0, LBB0_11
; %bb.5:
	mov	x22, x0
	add	x0, x0, #40
	mov	w24, #1
	mov	w1, #1
	bl	_atomic_set
	add	x0, x22, #36
	bl	_init_waitqueue_head
	add	x0, x22, #32
	bl	_spin_lock_init
	mov	x0, x23
	bl	_get_task_mm
	stp	x0, x19, [x22, #16]
	stp	w20, w24, [x22]
Lloh9:
	adrp	x8, _iommu_mn@GOTPAGE
Lloh10:
	ldr	x8, [x8, _iommu_mn@GOTPAGEOFF]
	mov	x24, x22
	str	x8, [x24, #8]!
	cbz	x0, LBB0_10
; %bb.6:
	mov	x23, x0
	mov	x0, x24
	mov	x1, x23
	bl	_mmu_notifier_register
	mov	x0, x19
	mov	x1, x22
	mov	x2, x20
	bl	_set_pasid_state
	mov	x21, x0
	cbnz	w0, LBB0_9
; %bb.7:
	ldr	w21, [x19, #4]
	ldr	x8, [x22, #16]
	ldr	w0, [x8]
	bl	___pa
	mov	x2, x0
	mov	x0, x21
	mov	x1, x20
	bl	_amd_iommu_domain_set_gcr3
	mov	x21, x0
	cbz	w0, LBB0_14
; %bb.8:
	mov	x0, x19
	mov	x1, x20
	bl	_clear_pasid_state
LBB0_9:
	mov	x0, x24
	mov	x1, x23
	bl	_mmu_notifier_unregister
	mov	x0, x23
	bl	_mmput
LBB0_10:
	mov	x0, x22
	bl	_free_pasid_state
LBB0_11:
	mov	x0, x19
	bl	_put_device_state
	b	LBB0_13
LBB0_12:
Lloh11:
	adrp	x8, _ENODEV@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_13:
	mov	x0, x21
	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_14:
	str	wzr, [x22, #4]
	mov	x0, x23
	bl	_mmput
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_iommu_mn,4,2                   ; @iommu_mn
.subsections_via_symbols
