	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movl	%esi, %ebx
	callq	_get_amdgpu_device
	movq	_ATC_VMID0_PASID_MAPPING__VALID_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	orl	%ebx, %r15d
	testl	%ebx, %ebx
	cmovel	%ebx, %r15d
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	movl	%r14d, %edx
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_pr_debug
	movq	_ATHUB@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movq	_mmATC_VMID0_PASID_MAPPING@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	xorl	%esi, %esi
	callq	_SOC15_REG_OFFSET
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%r14), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	movl	(%r12), %edi
	movl	(%rbx), %edx
	xorl	%esi, %esi
	callq	_SOC15_REG_OFFSET
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%r14), %edi
	movl	%r15d, %esi
	callq	_WREG32
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	movq	_OSSSYS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_mmIH_VMID_0_LUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_SOC15_REG_OFFSET
	addl	%eax, %r14d
	movl	%r14d, %edi
	movl	%r15d, %esi
	callq	_WREG32
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	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
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pasid 0x%x vmid %d, reg value %x\n"

L_.str.1:                               ## @.str.1
	.asciz	"ATHUB, reg %x\n"

	.comm	_ATHUB,4,2                      ## @ATHUB
	.comm	_mmATC_VMID0_PASID_MAPPING,4,2  ## @mmATC_VMID0_PASID_MAPPING
L_.str.2:                               ## @.str.2
	.asciz	"update mapping for IH block and mmhub"

	.comm	_OSSSYS,4,2                     ## @OSSSYS
	.comm	_mmIH_VMID_0_LUT,4,2            ## @mmIH_VMID_0_LUT
	.comm	_mmATC_VMID_PASID_MAPPING_UPDATE_STATUS,4,2 ## @mmATC_VMID_PASID_MAPPING_UPDATE_STATUS
	.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:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x2
	mov	x21, 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, w21
	cmp	w21, #0
	csel	w20, wzr, w8, eq
	stp	x21, x19, [sp]
	str	x20, [sp, #16]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
Lloh5:
	adrp	x21, _ATHUB@GOTPAGE
Lloh6:
	ldr	x21, [x21, _ATHUB@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh7:
	adrp	x22, _mmATC_VMID0_PASID_MAPPING@GOTPAGE
Lloh8:
	ldr	x22, [x22, _mmATC_VMID0_PASID_MAPPING@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	w1, #0
	bl	_SOC15_REG_OFFSET
	add	w8, w0, w19
	str	x8, [sp]
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_debug
	ldr	w0, [x21]
	ldr	w2, [x22]
	mov	w1, #0
	bl	_SOC15_REG_OFFSET
	add	w0, w0, w19
	mov	x1, x20
	bl	_WREG32
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_debug
Lloh13:
	adrp	x8, _OSSSYS@GOTPAGE
Lloh14:
	ldr	x8, [x8, _OSSSYS@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
Lloh16:
	adrp	x8, _mmIH_VMID_0_LUT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _mmIH_VMID_0_LUT@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_SOC15_REG_OFFSET
	add	w0, w0, w19
	mov	x1, x20
	bl	_WREG32
	mov	w0, #0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ATC_VMID0_PASID_MAPPING__VALID_MASK,4,2 ; @ATC_VMID0_PASID_MAPPING__VALID_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pasid 0x%x vmid %d, reg value %x\n"

l_.str.1:                               ; @.str.1
	.asciz	"ATHUB, reg %x\n"

	.comm	_ATHUB,4,2                      ; @ATHUB
	.comm	_mmATC_VMID0_PASID_MAPPING,4,2  ; @mmATC_VMID0_PASID_MAPPING
l_.str.2:                               ; @.str.2
	.asciz	"update mapping for IH block and mmhub"

	.comm	_OSSSYS,4,2                     ; @OSSSYS
	.comm	_mmIH_VMID_0_LUT,4,2            ; @mmIH_VMID_0_LUT
	.comm	_mmATC_VMID_PASID_MAPPING_UPDATE_STATUS,4,2 ; @mmATC_VMID_PASID_MAPPING_UPDATE_STATUS
	.no_dead_strip	_kgd_set_pasid_vmid_mapping
.subsections_via_symbols
