	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function drm_sched_select_entity
_drm_sched_select_entity:               ## @drm_sched_select_entity
	.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	%rdi, %r15
	callq	_drm_sched_ready
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	_DRM_SCHED_PRIORITY_MAX@GOTPCREL(%rip), %rax
	movslq	(%rax), %rbx
	leaq	-4(,%rbx,4), %rdi
	incq	%rbx
	movq	_DRM_SCHED_PRIORITY_MIN@GOTPCREL(%rip), %r12
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movslq	(%r12), %rax
	decq	%rbx
	cmpq	%rax, %rbx
	jle	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	leaq	-4(%rdi), %r13
	addq	(%r15), %rdi
	callq	_drm_sched_rq_select_entity
	movq	%r13, %rdi
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movq	%rax, %r14
	jmp	LBB0_6
LBB0_1:
	xorl	%r14d, %r14d
LBB0_6:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_SCHED_PRIORITY_MAX,4,2     ## @DRM_SCHED_PRIORITY_MAX
	.comm	_DRM_SCHED_PRIORITY_MIN,4,2     ## @DRM_SCHED_PRIORITY_MIN
	.no_dead_strip	_drm_sched_select_entity
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function drm_sched_select_entity
_drm_sched_select_entity:               ; @drm_sched_select_entity
	.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
	bl	_drm_sched_ready
	cbz	w0, LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _DRM_SCHED_PRIORITY_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DRM_SCHED_PRIORITY_MAX@GOTPAGEOFF]
Lloh2:
	ldrsw	x8, [x8]
	add	x20, x8, #1
	lsl	x8, x8, #2
	sub	x8, x8, #4
Lloh3:
	adrp	x21, _DRM_SCHED_PRIORITY_MIN@GOTPAGE
Lloh4:
	ldr	x21, [x21, _DRM_SCHED_PRIORITY_MIN@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldrsw	x9, [x21]
	sub	x20, x20, #1
	cmp	x20, x9
	b.le	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	sub	x22, x8, #4
	ldr	x9, [x19]
	add	x0, x9, x8
	bl	_drm_sched_rq_select_entity
	mov	x8, x22
	cbz	x0, LBB0_2
	b	LBB0_5
LBB0_4:
	mov	x0, #0
LBB0_5:
	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
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_SCHED_PRIORITY_MAX,4,2     ; @DRM_SCHED_PRIORITY_MAX
	.comm	_DRM_SCHED_PRIORITY_MIN,4,2     ; @DRM_SCHED_PRIORITY_MIN
	.no_dead_strip	_drm_sched_select_entity
.subsections_via_symbols
