	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gfx_v9_0_kcq_disable
_gfx_v9_0_kcq_disable:                  ## @gfx_v9_0_kcq_disable
	.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	%rdi, %r14
	leaq	16(%rdi), %r15
	movl	(%rdi), %eax
	addl	%eax, %eax
	leal	(%rax,%rax,2), %esi
	movq	%r15, %rdi
	callq	_amdgpu_ring_alloc
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_2:
	cmpl	$0, (%r14)
	jle	LBB0_5
## %bb.3:
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_PACKET3_UNMAP_QUEUES@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$4, %esi
	callq	_PACKET3
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_amdgpu_ring_write
	movl	$1, %edi
	callq	_PACKET3_UNMAP_QUEUES_ACTION
	movl	%eax, %r12d
	xorl	%edi, %edi
	callq	_PACKET3_UNMAP_QUEUES_QUEUE_SEL
	orl	%eax, %r12d
	xorl	%edi, %edi
	callq	_PACKET3_UNMAP_QUEUES_ENGINE_SEL
	movl	%eax, %ebx
	movl	$1, %edi
	callq	_PACKET3_UNMAP_QUEUES_NUM_QUEUES
	orl	%eax, %ebx
	orl	%r12d, %ebx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_amdgpu_ring_write
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax,%r13,4), %edi
	callq	_PACKET3_UNMAP_QUEUES_DOORBELL_OFFSET0
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_amdgpu_ring_write
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_amdgpu_ring_write
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_amdgpu_ring_write
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_amdgpu_ring_write
	incq	%r13
	movslq	(%r14), %rax
	cmpq	%rax, %r13
	jl	LBB0_4
LBB0_5:
	movq	%r15, %rdi
	callq	_amdgpu_ring_test_helper
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to lock KIQ (%d).\n"

	.comm	_PACKET3_UNMAP_QUEUES,4,2       ## @PACKET3_UNMAP_QUEUES
L_.str.1:                               ## @.str.1
	.asciz	"KCQ disable failed\n"

	.no_dead_strip	_gfx_v9_0_kcq_disable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gfx_v9_0_kcq_disable
_gfx_v9_0_kcq_disable:                  ; @gfx_v9_0_kcq_disable
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x0
	mov	x19, x0
	ldr	w8, [x19], #16
	add	w8, w8, w8, lsl #1
	lsl	w1, w8, #1
	mov	x0, x19
	bl	_amdgpu_ring_alloc
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_2
; %bb.1:
	str	x0, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
LBB0_2:
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.3:
	mov	x22, #0
Lloh2:
	adrp	x23, _PACKET3_UNMAP_QUEUES@GOTPAGE
Lloh3:
	ldr	x23, [x23, _PACKET3_UNMAP_QUEUES@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x24, [x20, #8]
	ldr	w0, [x23]
	mov	w1, #4
	bl	_PACKET3
	mov	x1, x0
	mov	x0, x19
	bl	_amdgpu_ring_write
	mov	w0, #1
	bl	_PACKET3_UNMAP_QUEUES_ACTION
	mov	x21, x0
	mov	w0, #0
	bl	_PACKET3_UNMAP_QUEUES_QUEUE_SEL
	orr	w21, w0, w21
	mov	w0, #0
	bl	_PACKET3_UNMAP_QUEUES_ENGINE_SEL
	orr	w21, w21, w0
	mov	w0, #1
	bl	_PACKET3_UNMAP_QUEUES_NUM_QUEUES
	orr	w1, w21, w0
	mov	x0, x19
	bl	_amdgpu_ring_write
	ldr	w0, [x24, x22, lsl #2]
	bl	_PACKET3_UNMAP_QUEUES_DOORBELL_OFFSET0
	mov	x1, x0
	mov	x0, x19
	bl	_amdgpu_ring_write
	mov	x0, x19
	mov	w1, #0
	bl	_amdgpu_ring_write
	mov	x0, x19
	mov	w1, #0
	bl	_amdgpu_ring_write
	mov	x0, x19
	mov	w1, #0
	bl	_amdgpu_ring_write
	add	x22, x22, #1
	ldrsw	x8, [x20]
	cmp	x22, x8
	b.lt	LBB0_4
LBB0_5:
	mov	x0, x19
	bl	_amdgpu_ring_test_helper
	mov	x19, x0
	cbz	w0, LBB0_7
; %bb.6:
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
LBB0_7:
	mov	x0, x19
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to lock KIQ (%d).\n"

	.comm	_PACKET3_UNMAP_QUEUES,4,2       ; @PACKET3_UNMAP_QUEUES
l_.str.1:                               ; @.str.1
	.asciz	"KCQ disable failed\n"

	.no_dead_strip	_gfx_v9_0_kcq_disable
.subsections_via_symbols
