	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function eb_select_legacy_ring
_eb_select_legacy_ring:                 ## @eb_select_legacy_ring
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movl	(%rdx), %esi
	movq	_I915_EXEC_RING_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	andl	%esi, %ebx
	movq	_I915_EXEC_BSD@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_1
## %bb.4:
	movq	%rdx, %r15
	movq	(%rdi), %r12
	movq	%r12, %rdi
	callq	_num_vcs_engines
	cmpl	$2, %eax
	jl	LBB0_11
## %bb.5:
	movq	_I915_EXEC_BSD_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%r15), %eax
	movq	_I915_EXEC_BSD_DEFAULT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_7
## %bb.6:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_gen8_dispatch_bsd_engine
	jmp	LBB0_10
LBB0_1:
	movq	_I915_EXEC_BSD_MASK@GOTPCREL(%rip), %rax
	testl	%esi, (%rax)
	je	LBB0_11
## %bb.2:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_3
LBB0_11:
	movq	_user_ring_map@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	callq	_ARRAY_SIZE
	cmpl	%eax, %ebx
	jae	LBB0_12
## %bb.13:
	movq	(%r14), %rax
	movl	(%rax,%rbx,4), %eax
	jmp	LBB0_14
LBB0_12:
	leaq	L_.str.2(%rip), %rdi
	movl	%ebx, %esi
	jmp	LBB0_3
LBB0_7:
	movq	_I915_EXEC_BSD_RING1@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jb	LBB0_15
## %bb.8:
	movq	_I915_EXEC_BSD_RING2@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	ja	LBB0_15
## %bb.9:
	movq	_I915_EXEC_BSD_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shrl	%cl, %eax
	decl	%eax
LBB0_10:
	movl	%eax, %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	__VCS                           ## TAILCALL
LBB0_15:
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
LBB0_3:
	callq	_DRM_DEBUG
	movl	$-1, %eax
LBB0_14:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I915_EXEC_RING_MASK,4,2        ## @I915_EXEC_RING_MASK
	.comm	_I915_EXEC_BSD,4,2              ## @I915_EXEC_BSD
	.comm	_I915_EXEC_BSD_MASK,4,2         ## @I915_EXEC_BSD_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"execbuf with non bsd ring but with invalid bsd dispatch flags: %d\n"

	.comm	_I915_EXEC_BSD_DEFAULT,4,2      ## @I915_EXEC_BSD_DEFAULT
	.comm	_I915_EXEC_BSD_RING1,4,2        ## @I915_EXEC_BSD_RING1
	.comm	_I915_EXEC_BSD_RING2,4,2        ## @I915_EXEC_BSD_RING2
	.comm	_I915_EXEC_BSD_SHIFT,4,2        ## @I915_EXEC_BSD_SHIFT
L_.str.1:                               ## @.str.1
	.asciz	"execbuf with unknown bsd ring: %u\n"

	.comm	_user_ring_map,8,3              ## @user_ring_map
L_.str.2:                               ## @.str.2
	.asciz	"execbuf with unknown ring: %u\n"

	.no_dead_strip	_eb_select_legacy_ring
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function eb_select_legacy_ring
_eb_select_legacy_ring:                 ; @eb_select_legacy_ring
	.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	x20, x1
	ldr	w1, [x2]
Lloh0:
	adrp	x8, _I915_EXEC_RING_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I915_EXEC_RING_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w19, w8, w1
Lloh3:
	adrp	x8, _I915_EXEC_BSD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _I915_EXEC_BSD@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w19, w8
	b.ne	LBB0_4
; %bb.1:
	mov	x21, x2
	ldr	x22, [x0]
	mov	x0, x22
	bl	_num_vcs_engines
	cmp	w0, #2
	b.lt	LBB0_6
; %bb.2:
	ldr	w8, [x21]
Lloh6:
	adrp	x9, _I915_EXEC_BSD_MASK@GOTPAGE
Lloh7:
	ldr	x9, [x9, _I915_EXEC_BSD_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	and	w1, w9, w8
Lloh9:
	adrp	x8, _I915_EXEC_BSD_DEFAULT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _I915_EXEC_BSD_DEFAULT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w1, w8
	b.ne	LBB0_9
; %bb.3:
	mov	x0, x22
	mov	x1, x20
	bl	_gen8_dispatch_bsd_engine
	b	LBB0_14
LBB0_4:
Lloh12:
	adrp	x8, _I915_EXEC_BSD_MASK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _I915_EXEC_BSD_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	tst	w8, w1
	b.eq	LBB0_6
; %bb.5:
Lloh15:
	adrp	x0, l_.str@PAGE
Lloh16:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_11
LBB0_6:
Lloh17:
	adrp	x20, _user_ring_map@GOTPAGE
Lloh18:
	ldr	x20, [x20, _user_ring_map@GOTPAGEOFF]
	ldr	x0, [x20]
	bl	_ARRAY_SIZE
	cmp	w19, w0
	b.hs	LBB0_8
; %bb.7:
	ldr	x8, [x20]
	ldr	w0, [x8, x19, lsl #2]
	b	LBB0_12
LBB0_8:
Lloh19:
	adrp	x0, l_.str.2@PAGE
Lloh20:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x19
	b	LBB0_11
LBB0_9:
Lloh21:
	adrp	x8, _I915_EXEC_BSD_RING1@GOTPAGE
Lloh22:
	ldr	x8, [x8, _I915_EXEC_BSD_RING1@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, _I915_EXEC_BSD_RING2@GOTPAGE
Lloh25:
	ldr	x9, [x9, _I915_EXEC_BSD_RING2@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	cmp	w1, w8
	ccmp	w1, w9, #2, hs
	b.ls	LBB0_13
; %bb.10:
Lloh27:
	adrp	x0, l_.str.1@PAGE
Lloh28:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_11:
	bl	_DRM_DEBUG
	mov	w0, #-1
LBB0_12:
	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
LBB0_13:
Lloh29:
	adrp	x8, _I915_EXEC_BSD_SHIFT@GOTPAGE
Lloh30:
	ldr	x8, [x8, _I915_EXEC_BSD_SHIFT@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	lsr	w8, w1, w8
	sub	w0, w8, #1
LBB0_14:
	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	__VCS
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_I915_EXEC_RING_MASK,4,2        ; @I915_EXEC_RING_MASK
	.comm	_I915_EXEC_BSD,4,2              ; @I915_EXEC_BSD
	.comm	_I915_EXEC_BSD_MASK,4,2         ; @I915_EXEC_BSD_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"execbuf with non bsd ring but with invalid bsd dispatch flags: %d\n"

	.comm	_I915_EXEC_BSD_DEFAULT,4,2      ; @I915_EXEC_BSD_DEFAULT
	.comm	_I915_EXEC_BSD_RING1,4,2        ; @I915_EXEC_BSD_RING1
	.comm	_I915_EXEC_BSD_RING2,4,2        ; @I915_EXEC_BSD_RING2
	.comm	_I915_EXEC_BSD_SHIFT,4,2        ; @I915_EXEC_BSD_SHIFT
l_.str.1:                               ; @.str.1
	.asciz	"execbuf with unknown bsd ring: %u\n"

	.comm	_user_ring_map,8,3              ; @user_ring_map
l_.str.2:                               ; @.str.2
	.asciz	"execbuf with unknown ring: %u\n"

	.no_dead_strip	_eb_select_legacy_ring
.subsections_via_symbols
