	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_sched_entity_select_rq     ## -- Begin function drm_sched_entity_select_rq
	.p2align	4, 0x90
_drm_sched_entity_select_rq:            ## @drm_sched_entity_select_rq
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	addq	$20, %rdi
	callq	_spsc_queue_count
	testq	%rax, %rax
	jne	LBB0_5
## %bb.1:
	cmpl	$2, (%rbx)
	jl	LBB0_5
## %bb.2:
	movl	16(%rbx), %edi
	callq	_READ_ONCE
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%rax, %rdi
	callq	_dma_fence_is_signaled
	testl	%eax, %eax
	je	LBB0_5
LBB0_4:
	movq	%rbx, %rdi
	callq	_drm_sched_entity_get_free_sched
	cmpq	8(%rbx), %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %r14
	leaq	4(%rbx), %r15
	movq	%r15, %rdi
	callq	_spin_lock
	movq	8(%rbx), %rdi
	movq	%rbx, %rsi
	callq	_drm_sched_rq_remove_entity
	movq	%r14, 8(%rbx)
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock                    ## TAILCALL
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_sched_entity_select_rq     ; -- Begin function drm_sched_entity_select_rq
	.p2align	2
_drm_sched_entity_select_rq:            ; @drm_sched_entity_select_rq
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x19, x0
	add	x0, x0, #20
	bl	_spsc_queue_count
	cbnz	x0, LBB0_6
; %bb.1:
	ldr	w8, [x19]
	cmp	w8, #2
	b.lt	LBB0_6
; %bb.2:
	ldr	w0, [x19, #16]
	bl	_READ_ONCE
	cbz	x0, LBB0_4
; %bb.3:
	bl	_dma_fence_is_signaled
	cbz	w0, LBB0_6
LBB0_4:
	mov	x0, x19
	bl	_drm_sched_entity_get_free_sched
	ldr	x8, [x19, #8]
	cmp	x0, x8
	b.eq	LBB0_6
; %bb.5:
	mov	x20, x0
	add	x21, x19, #4
	mov	x0, x21
	bl	_spin_lock
	ldr	x0, [x19, #8]
	mov	x1, x19
	bl	_drm_sched_rq_remove_entity
	str	x20, [x19, #8]
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_spin_unlock
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
