	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_ring_priority_put       ## -- Begin function amdgpu_ring_priority_put
	.p2align	4, 0x90
_amdgpu_ring_priority_put:              ## @amdgpu_ring_priority_put
	.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	8(%rdi), %rax
	cmpq	$0, (%rax)
	je	LBB0_12
## %bb.1:
	movl	%esi, %ebx
	movq	%rdi, %r14
	movl	%esi, %edi
	shlq	$2, %rdi
	addq	16(%r14), %rdi
	callq	_atomic_dec_return
	testq	%rax, %rax
	jg	LBB0_12
## %bb.2:
	movq	_DRM_SCHED_PRIORITY_NORMAL@GOTPCREL(%rip), %r12
	cmpl	%ebx, (%r12)
	je	LBB0_12
## %bb.3:
	leaq	4(%r14), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	cmpl	%ebx, (%r14)
	ja	LBB0_11
## %bb.4:
	movq	_DRM_SCHED_PRIORITY_MIN@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jg	LBB0_11
## %bb.5:
	movslq	%ebx, %r15
	leaq	1(%r15), %r13
	shlq	$2, %r15
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %esi
	cmpl	%esi, %ebx
	je	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	16(%r14), %rdi
	addq	%r15, %rdi
	callq	_atomic_read
	testq	%rax, %rax
	jne	LBB0_8
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	_DRM_SCHED_PRIORITY_MIN@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	decl	%ebx
	decq	%r13
	addq	$-4, %r15
	cmpq	%rax, %r13
	jg	LBB0_6
	jmp	LBB0_11
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	%ebx, %esi
LBB0_9:
	movl	%esi, (%r14)
	movq	8(%r14), %rax
	movq	%r14, %rdi
	callq	*(%rax)
LBB0_11:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_SCHED_PRIORITY_NORMAL,4,2  ## @DRM_SCHED_PRIORITY_NORMAL
	.comm	_DRM_SCHED_PRIORITY_MIN,4,2     ## @DRM_SCHED_PRIORITY_MIN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_ring_priority_put       ; -- Begin function amdgpu_ring_priority_put
	.p2align	2
_amdgpu_ring_priority_put:              ; @amdgpu_ring_priority_put
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldr	x8, [x0, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x0, #16]
	add	x0, x8, w1, uxtw #2
	bl	_atomic_dec_return
Lloh0:
	adrp	x22, _DRM_SCHED_PRIORITY_NORMAL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _DRM_SCHED_PRIORITY_NORMAL@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	x0, #0
	ccmp	w8, w20, #4, le
	b.ne	LBB0_3
LBB0_2:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_3:
	add	x21, x19, #4
	mov	x0, x21
	bl	_mutex_lock
	ldr	w8, [x19]
Lloh2:
	adrp	x23, _DRM_SCHED_PRIORITY_MIN@GOTPAGE
Lloh3:
	ldr	x23, [x23, _DRM_SCHED_PRIORITY_MIN@GOTPAGEOFF]
	ldr	w9, [x23]
	cmp	w8, w20
	ccmp	w9, w20, #0, ls
	b.gt	LBB0_10
; %bb.4:
	sxtw	x8, w20
	add	x24, x8, #1
	sbfiz	x25, x20, #2, #32
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x22]
	cmp	w20, w8
	b.eq	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19, #16]
	add	x0, x8, x25
	bl	_atomic_read
	cbnz	x0, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldrsw	x8, [x23]
	sub	w20, w20, #1
	sub	x24, x24, #1
	sub	x25, x25, #4
	cmp	x24, x8
	b.gt	LBB0_5
	b	LBB0_10
LBB0_8:
	mov	x20, x8
LBB0_9:
	str	w20, [x19]
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	mov	x0, x19
	mov	x1, x20
	blr	x8
LBB0_10:
	mov	x0, x21
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_mutex_unlock
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_SCHED_PRIORITY_NORMAL,4,2  ; @DRM_SCHED_PRIORITY_NORMAL
	.comm	_DRM_SCHED_PRIORITY_MIN,4,2     ; @DRM_SCHED_PRIORITY_MIN
.subsections_via_symbols
