	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_gfx_enable_kcq          ## -- Begin function amdgpu_gfx_enable_kcq
	.p2align	4, 0x90
_amdgpu_gfx_enable_kcq:                 ## @amdgpu_gfx_enable_kcq
	.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	24(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	cmpq	$0, 8(%rax)
	je	LBB0_5
## %bb.2:
	cmpq	$0, 16(%rax)
	je	LBB0_5
## %bb.3:
	movq	%rdi, %r12
	leaq	32(%rdi), %r14
	movq	_AMDGPU_MAX_COMPUTE_QUEUES@GOTPCREL(%rip), %r13
	cmpl	$0, (%r13)
	jle	LBB0_4
## %bb.6:
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=1
	btsq	%rbx, %r15
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=1
	incq	%rbx
	movslq	(%r13), %rax
	cmpq	%rax, %rbx
	jge	LBB0_12
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	16(%r12), %esi
	movl	%ebx, %edi
	callq	_test_bit
	testl	%eax, %eax
	je	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	xorl	%edi, %edi
	cmpq	$65, %rbx
	setae	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_12
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_20:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	xorl	%r15d, %r15d
LBB0_12:
	movl	40(%r12), %esi
	movl	32(%r12), %ecx
	movl	36(%r12), %edx
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_INFO
	movq	24(%r12), %rax
	movslq	(%rax), %rcx
	movslq	(%r12), %rsi
	imulq	%rcx, %rsi
	addq	24(%rax), %rsi
	movq	%r14, %rdi
	callq	_amdgpu_ring_alloc
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_20
LBB0_14:
	movq	24(%r12), %rax
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	*16(%rax)
	cmpl	$0, (%r12)
	jle	LBB0_17
## %bb.15:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	24(%r12), %rax
	movq	8(%r12), %rsi
	addq	%r15, %rsi
	movq	%r14, %rdi
	callq	*8(%rax)
	incq	%rbx
	movslq	(%r12), %rax
	addq	$4, %r15
	cmpq	%rax, %rbx
	jl	LBB0_16
LBB0_17:
	movq	%r14, %rdi
	callq	_amdgpu_ring_test_helper
	testl	%eax, %eax
	je	LBB0_18
## %bb.19:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_20
LBB0_18:
	xorl	%ebx, %ebx
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AMDGPU_MAX_COMPUTE_QUEUES,4,2  ## @AMDGPU_MAX_COMPUTE_QUEUES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid KCQ enabled: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"kiq ring mec %d pipe %d q %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to lock KIQ (%d).\n"

L_.str.3:                               ## @.str.3
	.asciz	"KCQ enable failed\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_gfx_enable_kcq          ; -- Begin function amdgpu_gfx_enable_kcq
	.p2align	2
_amdgpu_gfx_enable_kcq:                 ; @amdgpu_gfx_enable_kcq
	.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
	ldr	x8, [x0, #24]
	cbz	x8, LBB0_10
; %bb.1:
	ldr	x9, [x8, #8]
	cbz	x9, LBB0_10
; %bb.2:
	ldr	x8, [x8, #16]
	cbz	x8, LBB0_10
; %bb.3:
	mov	x19, x0
	add	x20, x0, #32
Lloh0:
	adrp	x23, _AMDGPU_MAX_COMPUTE_QUEUES@GOTPAGE
Lloh1:
	ldr	x23, [x23, _AMDGPU_MAX_COMPUTE_QUEUES@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.4:
	mov	x22, #0
	mov	x21, #0
	mov	w24, #1
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	lsl	x8, x24, x22
	orr	x21, x8, x21
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x22, x22, #1
	ldrsw	x8, [x23]
	cmp	x22, x8
	b.ge	LBB0_12
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x19, #16]
	mov	x0, x22
	bl	_test_bit
	cbz	w0, LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	cmp	x22, #64
	cset	w0, hi
	bl	_WARN_ON
	cbz	x0, LBB0_5
; %bb.9:
	str	x22, [sp]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_12
LBB0_10:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_20
LBB0_11:
	mov	x21, #0
LBB0_12:
	ldp	w2, w1, [x19, #36]
	ldr	w3, [x19, #32]
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_INFO
	ldr	x8, [x19, #24]
	ldrsw	x9, [x8]
	ldrsw	x10, [x19]
	ldr	x8, [x8, #24]
	madd	x1, x10, x9, x8
	mov	x0, x20
	bl	_amdgpu_ring_alloc
	cbz	w0, LBB0_14
; %bb.13:
	mov	x22, x0
	str	x22, [sp]
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_19
LBB0_14:
	ldr	x8, [x19, #24]
	ldr	x8, [x8, #16]
	mov	x0, x20
	mov	x1, x21
	blr	x8
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_17
; %bb.15:
	mov	x21, #0
	mov	x22, #0
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #24]
	ldr	x8, [x8, #8]
	ldr	x9, [x19, #8]
	add	x1, x9, x21
	mov	x0, x20
	blr	x8
	add	x22, x22, #1
	ldrsw	x8, [x19]
	add	x21, x21, #4
	cmp	x22, x8
	b.lt	LBB0_16
LBB0_17:
	mov	x0, x20
	bl	_amdgpu_ring_test_helper
	mov	x22, x0
	cbz	w0, LBB0_20
; %bb.18:
Lloh11:
	adrp	x0, l_.str.3@PAGE
Lloh12:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_19:
	bl	_DRM_ERROR
LBB0_20:
	mov	x0, x22
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AMDGPU_MAX_COMPUTE_QUEUES,4,2  ; @AMDGPU_MAX_COMPUTE_QUEUES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid KCQ enabled: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"kiq ring mec %d pipe %d q %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to lock KIQ (%d).\n"

l_.str.3:                               ; @.str.3
	.asciz	"KCQ enable failed\n"

.subsections_via_symbols
