	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kgd_set_pasid_vmid_mapping
_kgd_set_pasid_vmid_mapping:            ## @kgd_set_pasid_vmid_mapping
	.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
	movl	%edx, %r15d
	movl	%esi, %ebx
	callq	_get_amdgpu_device
	movq	_ATC_VMID0_PASID_MAPPING__VALID_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	orl	%ebx, %r12d
	testl	%ebx, %ebx
	cmovel	%ebx, %r12d
	movq	_mmATC_VMID0_PASID_MAPPING@GOTPCREL(%rip), %rax
	movl	%r15d, %r14d
	movq	(%rax), %rdi
	addq	%r14, %rdi
	movl	%r12d, %esi
	callq	_WREG32
	movq	_mmATC_VMID_PASID_MAPPING_UPDATE_STATUS@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	callq	_RREG32
	movl	$1, %ebx
	movl	%r15d, %ecx
	shll	%cl, %ebx
	btl	%r15d, %eax
	jb	LBB0_2
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_cpu_relax
	movq	(%r13), %rdi
	callq	_RREG32
	testl	%ebx, %eax
	je	LBB0_1
LBB0_2:
	movq	(%r13), %rdi
	movl	%ebx, %esi
	callq	_WREG32
	movq	_mmIH_VMID_0_LUT@GOTPCREL(%rip), %rax
	addq	(%rax), %r14
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_WREG32
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATC_VMID0_PASID_MAPPING__VALID_MASK,4,2 ## @ATC_VMID0_PASID_MAPPING__VALID_MASK
	.comm	_mmATC_VMID0_PASID_MAPPING,8,3  ## @mmATC_VMID0_PASID_MAPPING
	.comm	_mmATC_VMID_PASID_MAPPING_UPDATE_STATUS,8,3 ## @mmATC_VMID_PASID_MAPPING_UPDATE_STATUS
	.comm	_mmIH_VMID_0_LUT,8,3            ## @mmIH_VMID_0_LUT
	.no_dead_strip	_kgd_set_pasid_vmid_mapping
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kgd_set_pasid_vmid_mapping
_kgd_set_pasid_vmid_mapping:            ; @kgd_set_pasid_vmid_mapping
	.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	x20, x2
	mov	x19, x1
	bl	_get_amdgpu_device
Lloh0:
	adrp	x8, _ATC_VMID0_PASID_MAPPING__VALID_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATC_VMID0_PASID_MAPPING__VALID_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	orr	w8, w8, w19
	cmp	w19, #0
	csel	w19, wzr, w8, eq
Lloh3:
	adrp	x8, _mmATC_VMID0_PASID_MAPPING@GOTPAGE
Lloh4:
	ldr	x8, [x8, _mmATC_VMID0_PASID_MAPPING@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	mov	w21, w20
	add	x0, x8, x21
	mov	x1, x19
	bl	_WREG32
Lloh6:
	adrp	x22, _mmATC_VMID_PASID_MAPPING_UPDATE_STATUS@GOTPAGE
Lloh7:
	ldr	x22, [x22, _mmATC_VMID_PASID_MAPPING_UPDATE_STATUS@GOTPAGEOFF]
	ldr	x0, [x22]
	bl	_RREG32
	mov	w8, #1
	lsl	w20, w8, w20
	tst	w0, w20
	b.ne	LBB0_2
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	bl	_cpu_relax
	ldr	x0, [x22]
	bl	_RREG32
	tst	w0, w20
	b.eq	LBB0_1
LBB0_2:
	ldr	x0, [x22]
	mov	x1, x20
	bl	_WREG32
Lloh8:
	adrp	x8, _mmIH_VMID_0_LUT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _mmIH_VMID_0_LUT@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	add	x0, x8, x21
	mov	x1, x19
	bl	_WREG32
	mov	w0, #0
	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 AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_ATC_VMID0_PASID_MAPPING__VALID_MASK,4,2 ; @ATC_VMID0_PASID_MAPPING__VALID_MASK
	.comm	_mmATC_VMID0_PASID_MAPPING,8,3  ; @mmATC_VMID0_PASID_MAPPING
	.comm	_mmATC_VMID_PASID_MAPPING_UPDATE_STATUS,8,3 ; @mmATC_VMID_PASID_MAPPING_UPDATE_STATUS
	.comm	_mmIH_VMID_0_LUT,8,3            ; @mmIH_VMID_0_LUT
	.no_dead_strip	_kgd_set_pasid_vmid_mapping
.subsections_via_symbols
