	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdgpu_gfx_kiq_acquire
_amdgpu_gfx_kiq_acquire:                ## @amdgpu_gfx_kiq_acquire
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movl	8(%rdi), %ebx
	imull	4(%rdi), %ebx
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	imull	12(%rdi), %ebx
	testl	%ebx, %ebx
	js	LBB0_4
## %bb.1:
	decl	%ebx
	leaq	-52(%rbp), %r12
	leaq	-48(%rbp), %r13
	leaq	-44(%rbp), %r14
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	decl	%ebx
	cmpl	$-2, %ebx
	je	LBB0_4
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	16(%r15), %esi
	movl	%ebx, %edi
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_3
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	movl	%ebx, %esi
	movq	%r12, %rdx
	movq	%r13, %rcx
	movq	%r14, %r8
	callq	_amdgpu_gfx_bit_to_mec_queue
	movl	-52(%rbp), %esi
	cmpl	$1, %esi
	sete	%dl
	movl	-48(%rbp), %ecx
	cmpl	$2, %ecx
	setge	%al
	testb	%al, %dl
	jne	LBB0_3
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$0, -44(%rbp)
	jne	LBB0_3
## %bb.7:
	incl	%esi
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	%esi, (%rax)
	movl	%ecx, 4(%rax)
	movl	$0, 8(%rax)
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_4:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	addq	$24, %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 find a queue for KIQ\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_amdgpu_gfx_kiq_acquire
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amdgpu_gfx_kiq_acquire
_amdgpu_gfx_kiq_acquire:                ; @amdgpu_gfx_kiq_acquire
	.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
	mov	x20, x0
	ldp	w8, w9, [x0, #4]
	mul	w8, w9, w8
	ldr	w9, [x0, #12]
	mul	w8, w8, w9
	tbnz	w8, #31, LBB0_6
; %bb.1:
	mov	x19, x1
	sub	w21, w8, #1
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	sub	w21, w21, #1
	cmn	w21, #2
	b.eq	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x20, #16]
	mov	x0, x21
	bl	_test_bit
	cbnz	x0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x2, sp, #12
	add	x3, sp, #8
	add	x4, sp, #4
	mov	x0, x20
	mov	x1, x21
	bl	_amdgpu_gfx_bit_to_mec_queue
	ldp	w8, w9, [sp, #8]
	cmp	w8, #1
	ccmp	w9, #1, #0, gt
	ldr	w10, [sp, #4]
	ccmp	w10, #0, #0, ne
	b.ne	LBB0_2
; %bb.5:
	mov	w0, #0
	add	w9, w9, #1
	stp	w9, w8, [x19]
	str	wzr, [x19, #8]
	b	LBB0_7
LBB0_6:
	ldr	w0, [x20]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to find a queue for KIQ\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_amdgpu_gfx_kiq_acquire
.subsections_via_symbols
