	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gfx_v10_0_kiq_enable_kgq
_gfx_v10_0_kiq_enable_kgq:              ## @gfx_v10_0_kiq_enable_kgq
	.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
	movq	16(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	cmpq	$0, 8(%rax)
	je	LBB0_2
## %bb.3:
	movq	%rdi, %r12
	leaq	24(%rdi), %r14
	movl	(%rdi), %esi
	imull	(%rax), %esi
	movq	%r14, %rdi
	callq	_amdgpu_ring_alloc
	testl	%eax, %eax
	je	LBB0_4
## %bb.11:
	movl	%eax, %r15d
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_10
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_10:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	cmpl	$0, (%r12)
	jle	LBB0_7
## %bb.5:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%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_6
LBB0_7:
	movq	%r14, %rdi
	callq	_amdgpu_ring_test_ring
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	movl	%eax, %r15d
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movl	$0, (%r14)
	jmp	LBB0_10
LBB0_8:
	xorl	%r15d, %r15d
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to lock KIQ (%d).\n"

L_.str.1:                               ## @.str.1
	.asciz	"kfq enable failed\n"

	.no_dead_strip	_gfx_v10_0_kiq_enable_kgq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gfx_v10_0_kiq_enable_kgq
_gfx_v10_0_kiq_enable_kgq:              ; @gfx_v10_0_kiq_enable_kgq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_4
; %bb.1:
	ldr	x9, [x8, #8]
	cbz	x9, LBB0_4
; %bb.2:
	mov	x20, x0
	add	x19, x0, #24
	ldr	w8, [x8]
	ldr	w9, [x0]
	mul	w1, w9, w8
	mov	x0, x19
	bl	_amdgpu_ring_alloc
	cbz	w0, LBB0_6
; %bb.3:
	mov	x21, x0
	str	x21, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_5
LBB0_4:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_5:
	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
	add	sp, sp, #64
	ret
LBB0_6:
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.7:
	mov	x21, #0
	mov	x22, #0
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldp	x9, x8, [x20, #8]
	ldr	x8, [x8, #8]
	add	x1, x9, x21
	mov	x0, x19
	blr	x8
	add	x22, x22, #1
	ldrsw	x8, [x20]
	add	x21, x21, #4
	cmp	x22, x8
	b.lt	LBB0_8
LBB0_9:
	mov	x0, x19
	bl	_amdgpu_ring_test_ring
	mov	x21, x0
	cbz	w0, LBB0_5
; %bb.10:
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
	str	wzr, [x19]
	b	LBB0_5
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to lock KIQ (%d).\n"

l_.str.1:                               ; @.str.1
	.asciz	"kfq enable failed\n"

	.no_dead_strip	_gfx_v10_0_kiq_enable_kgq
.subsections_via_symbols
