	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gfx_v8_0_pipe_reserve_resources
_gfx_v8_0_pipe_reserve_resources:       ## @gfx_v8_0_pipe_reserve_resources
	.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
	movl	%edx, %r15d
	movq	%rsi, %r12
	movq	%rdi, %r13
	leaq	8(%rdi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	(%r12), %edx
	movl	4(%r12), %esi
	movq	%r13, %rdi
	xorl	%ecx, %ecx
	callq	_amdgpu_gfx_mec_queue_to_bit
	movl	12(%r13), %esi
	movl	%eax, %edi
	testl	%r15d, %r15d
	je	LBB0_2
## %bb.1:
	callq	_set_bit
	jmp	LBB0_3
LBB0_2:
	callq	_clear_bit
LBB0_3:
	movl	12(%r13), %edi
	movq	_AMDGPU_MAX_COMPUTE_QUEUES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_bitmap_weight
	movl	(%r13), %ecx
	testl	%eax, %eax
	je	LBB0_10
## %bb.4:
	testl	%ecx, %ecx
	jle	LBB0_7
## %bb.5:
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%r13), %rax
	leaq	(%rax,%rbx), %r15
	movl	(%rax,%rbx), %edx
	movl	4(%rax,%rbx), %esi
	movq	%r13, %rdi
	xorl	%ecx, %ecx
	callq	_amdgpu_gfx_mec_queue_to_bit
	movl	12(%r13), %esi
	movl	%eax, %edi
	callq	_test_bit
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_gfx_v8_0_ring_set_pipe_percent
	incq	%r12
	movslq	(%r13), %rax
	addq	$8, %rbx
	cmpq	%rax, %r12
	jl	LBB0_6
LBB0_7:
	cmpl	$0, 4(%r13)
	jle	LBB0_16
## %bb.8:
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r13), %rax
	leaq	(%rax,%rbx), %r15
	movl	(%rax,%rbx), %edx
	movl	4(%rax,%rbx), %esi
	movq	%r13, %rdi
	xorl	%ecx, %ecx
	callq	_amdgpu_gfx_mec_queue_to_bit
	movl	12(%r13), %esi
	movl	%eax, %edi
	callq	_test_bit
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_gfx_v8_0_ring_set_pipe_percent
	incq	%r12
	movslq	4(%r13), %rax
	addq	$8, %rbx
	cmpq	%rax, %r12
	jl	LBB0_9
	jmp	LBB0_16
LBB0_10:
	testl	%ecx, %ecx
	jle	LBB0_13
## %bb.11:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	24(%r13), %rdi
	addq	%r15, %rdi
	movl	$1, %esi
	callq	_gfx_v8_0_ring_set_pipe_percent
	incq	%rbx
	movslq	(%r13), %rax
	addq	$8, %r15
	cmpq	%rax, %rbx
	jl	LBB0_12
LBB0_13:
	cmpl	$0, 4(%r13)
	jle	LBB0_16
## %bb.14:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r13), %rdi
	addq	%r15, %rdi
	movl	$1, %esi
	callq	_gfx_v8_0_ring_set_pipe_percent
	incq	%rbx
	movslq	4(%r13), %rax
	addq	$8, %r15
	cmpq	%rax, %rbx
	jl	LBB0_15
LBB0_16:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AMDGPU_MAX_COMPUTE_QUEUES,4,2  ## @AMDGPU_MAX_COMPUTE_QUEUES
	.no_dead_strip	_gfx_v8_0_pipe_reserve_resources
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gfx_v8_0_pipe_reserve_resources
_gfx_v8_0_pipe_reserve_resources:       ; @gfx_v8_0_pipe_reserve_resources
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock
	ldp	w2, w1, [x22]
	mov	x0, x20
	mov	w3, #0
	bl	_amdgpu_gfx_mec_queue_to_bit
	ldr	w1, [x20, #12]
	cbz	w21, LBB0_2
; %bb.1:
	bl	_set_bit
	b	LBB0_3
LBB0_2:
	bl	_clear_bit
LBB0_3:
	ldr	w0, [x20, #12]
Lloh0:
	adrp	x8, _AMDGPU_MAX_COMPUTE_QUEUES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AMDGPU_MAX_COMPUTE_QUEUES@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_bitmap_weight
	ldr	w8, [x20]
	cmp	w8, #1
	cbz	w0, LBB0_10
; %bb.4:
	b.lt	LBB0_7
; %bb.5:
	mov	x22, #0
	mov	x23, #0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #24]
	add	x21, x8, x22
	ldp	w2, w1, [x21]
	mov	x0, x20
	mov	w3, #0
	bl	_amdgpu_gfx_mec_queue_to_bit
	ldr	w1, [x20, #12]
	bl	_test_bit
	mov	x1, x0
	mov	x0, x21
	bl	_gfx_v8_0_ring_set_pipe_percent
	add	x23, x23, #1
	ldrsw	x8, [x20]
	add	x22, x22, #8
	cmp	x23, x8
	b.lt	LBB0_6
LBB0_7:
	ldr	w8, [x20, #4]
	cmp	w8, #1
	b.lt	LBB0_16
; %bb.8:
	mov	x22, #0
	mov	x23, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #16]
	add	x21, x8, x22
	ldp	w2, w1, [x21]
	mov	x0, x20
	mov	w3, #0
	bl	_amdgpu_gfx_mec_queue_to_bit
	ldr	w1, [x20, #12]
	bl	_test_bit
	mov	x1, x0
	mov	x0, x21
	bl	_gfx_v8_0_ring_set_pipe_percent
	add	x23, x23, #1
	ldrsw	x8, [x20, #4]
	add	x22, x22, #8
	cmp	x23, x8
	b.lt	LBB0_9
	b	LBB0_16
LBB0_10:
	b.lt	LBB0_13
; %bb.11:
	mov	x21, #0
	mov	x22, #0
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #24]
	add	x0, x8, x21
	mov	w1, #1
	bl	_gfx_v8_0_ring_set_pipe_percent
	add	x22, x22, #1
	ldrsw	x8, [x20]
	add	x21, x21, #8
	cmp	x22, x8
	b.lt	LBB0_12
LBB0_13:
	ldr	w8, [x20, #4]
	cmp	w8, #1
	b.lt	LBB0_16
; %bb.14:
	mov	x21, #0
	mov	x22, #0
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #16]
	add	x0, x8, x21
	mov	w1, #1
	bl	_gfx_v8_0_ring_set_pipe_percent
	add	x22, x22, #1
	ldrsw	x8, [x20, #4]
	add	x21, x21, #8
	cmp	x22, x8
	b.lt	LBB0_15
LBB0_16:
	mov	x0, x19
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_mutex_unlock
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_AMDGPU_MAX_COMPUTE_QUEUES,4,2  ; @AMDGPU_MAX_COMPUTE_QUEUES
	.no_dead_strip	_gfx_v8_0_pipe_reserve_resources
.subsections_via_symbols
