	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_cs_get_ring
_radeon_cs_get_ring:                    ## @radeon_cs_get_ring
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
                                        ## kill: def $esi killed $esi def $rsi
	movl	%edx, 16(%rdi)
	leal	-128(%rsi), %eax
	cmpl	$4, %eax
	ja	LBB0_12
## %bb.1:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_15:
	movq	_TN_RING_TYPE_VCE1_INDEX@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_12:
	leaq	L_.str(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_DRM_ERROR
LBB0_13:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	popq	%rbp
	retq
LBB0_14:
	movq	_R600_RING_TYPE_UVD_INDEX@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_7:
	movq	8(%rdi), %rax
	movl	(%rax), %eax
	movq	_CHIP_CAYMAN@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jge	LBB0_8
## %bb.11:
	movq	_CHIP_RV770@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jl	LBB0_13
	jmp	LBB0_9
LBB0_2:
	movq	8(%rdi), %rax
	movl	(%rax), %eax
	movq	_CHIP_TAHITI@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jge	LBB0_3
LBB0_6:
	movq	_RADEON_RING_TYPE_GFX_INDEX@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_8:
	testl	%edx, %edx
	jle	LBB0_10
LBB0_9:
	movq	_R600_RING_TYPE_DMA_INDEX@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_3:
	testl	%edx, %edx
	jle	LBB0_5
## %bb.4:
	movq	_CAYMAN_RING_TYPE_CP1_INDEX@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_10:
	movq	_CAYMAN_RING_TYPE_DMA1_INDEX@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_5:
	movq	_CAYMAN_RING_TYPE_CP2_INDEX@GOTPCREL(%rip), %rax
LBB0_16:
	movq	(%rax), %rax
	movq	%rax, (%rdi)
	xorl	%eax, %eax
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_15, LBB0_15-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_2, LBB0_2-LJTI0_0
LJTI0_0:
	.long	L0_0_set_15
	.long	L0_0_set_14
	.long	L0_0_set_6
	.long	L0_0_set_7
	.long	L0_0_set_2
	.end_data_region
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknown ring id: %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_RADEON_RING_TYPE_GFX_INDEX,8,3 ## @RADEON_RING_TYPE_GFX_INDEX
	.comm	_CHIP_TAHITI,4,2                ## @CHIP_TAHITI
	.comm	_CAYMAN_RING_TYPE_CP1_INDEX,8,3 ## @CAYMAN_RING_TYPE_CP1_INDEX
	.comm	_CAYMAN_RING_TYPE_CP2_INDEX,8,3 ## @CAYMAN_RING_TYPE_CP2_INDEX
	.comm	_CHIP_CAYMAN,4,2                ## @CHIP_CAYMAN
	.comm	_R600_RING_TYPE_DMA_INDEX,8,3   ## @R600_RING_TYPE_DMA_INDEX
	.comm	_CAYMAN_RING_TYPE_DMA1_INDEX,8,3 ## @CAYMAN_RING_TYPE_DMA1_INDEX
	.comm	_CHIP_RV770,4,2                 ## @CHIP_RV770
	.comm	_R600_RING_TYPE_UVD_INDEX,8,3   ## @R600_RING_TYPE_UVD_INDEX
	.comm	_TN_RING_TYPE_VCE1_INDEX,8,3    ## @TN_RING_TYPE_VCE1_INDEX
	.no_dead_strip	_radeon_cs_get_ring
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radeon_cs_get_ring
_radeon_cs_get_ring:                    ; @radeon_cs_get_ring
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	str	w2, [x0, #16]
	sub	w9, w1, #128
	cmp	w9, #4
	b.hi	LBB0_3
; %bb.1:
	mov	x8, x0
Lloh0:
	adrp	x10, lJTI0_0@PAGE
Lloh1:
	add	x10, x10, lJTI0_0@PAGEOFF
	adr	x11, LBB0_2
	ldrb	w12, [x10, x9]
	add	x11, x11, x12, lsl #2
	br	x11
LBB0_2:
	mov	w0, #0
Lloh2:
	adrp	x9, _TN_RING_TYPE_VCE1_INDEX@GOTPAGE
Lloh3:
	ldr	x9, [x9, _TN_RING_TYPE_VCE1_INDEX@GOTPAGEOFF]
	b	LBB0_16
LBB0_3:
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
LBB0_4:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_5:
	mov	w0, #0
Lloh9:
	adrp	x9, _R600_RING_TYPE_UVD_INDEX@GOTPAGE
Lloh10:
	ldr	x9, [x9, _R600_RING_TYPE_UVD_INDEX@GOTPAGEOFF]
	b	LBB0_16
LBB0_6:
	ldr	x9, [x8, #8]
	ldr	w9, [x9]
Lloh11:
	adrp	x10, _CHIP_CAYMAN@GOTPAGE
Lloh12:
	ldr	x10, [x10, _CHIP_CAYMAN@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	cmp	w9, w10
	b.ge	LBB0_10
; %bb.7:
Lloh14:
	adrp	x10, _CHIP_RV770@GOTPAGE
Lloh15:
	ldr	x10, [x10, _CHIP_RV770@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
	cmp	w9, w10
	b.lt	LBB0_4
	b	LBB0_11
LBB0_8:
	ldr	x9, [x8, #8]
	ldr	w9, [x9]
Lloh17:
	adrp	x10, _CHIP_TAHITI@GOTPAGE
Lloh18:
	ldr	x10, [x10, _CHIP_TAHITI@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
	cmp	w9, w10
	b.ge	LBB0_12
LBB0_9:
	mov	w0, #0
Lloh20:
	adrp	x9, _RADEON_RING_TYPE_GFX_INDEX@GOTPAGE
Lloh21:
	ldr	x9, [x9, _RADEON_RING_TYPE_GFX_INDEX@GOTPAGEOFF]
	b	LBB0_16
LBB0_10:
	cmp	w2, #1
	b.lt	LBB0_14
LBB0_11:
	mov	w0, #0
Lloh22:
	adrp	x9, _R600_RING_TYPE_DMA_INDEX@GOTPAGE
Lloh23:
	ldr	x9, [x9, _R600_RING_TYPE_DMA_INDEX@GOTPAGEOFF]
	b	LBB0_16
LBB0_12:
	cmp	w2, #1
	b.lt	LBB0_15
; %bb.13:
	mov	w0, #0
Lloh24:
	adrp	x9, _CAYMAN_RING_TYPE_CP1_INDEX@GOTPAGE
Lloh25:
	ldr	x9, [x9, _CAYMAN_RING_TYPE_CP1_INDEX@GOTPAGEOFF]
	b	LBB0_16
LBB0_14:
	mov	w0, #0
Lloh26:
	adrp	x9, _CAYMAN_RING_TYPE_DMA1_INDEX@GOTPAGE
Lloh27:
	ldr	x9, [x9, _CAYMAN_RING_TYPE_DMA1_INDEX@GOTPAGEOFF]
	b	LBB0_16
LBB0_15:
	mov	w0, #0
Lloh28:
	adrp	x9, _CAYMAN_RING_TYPE_CP2_INDEX@GOTPAGE
Lloh29:
	ldr	x9, [x9, _CAYMAN_RING_TYPE_CP2_INDEX@GOTPAGEOFF]
LBB0_16:
	ldr	x9, [x9]
	str	x9, [x8]
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_9-LBB0_2)>>2
	.byte	(LBB0_6-LBB0_2)>>2
	.byte	(LBB0_8-LBB0_2)>>2
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown ring id: %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_RADEON_RING_TYPE_GFX_INDEX,8,3 ; @RADEON_RING_TYPE_GFX_INDEX
	.comm	_CHIP_TAHITI,4,2                ; @CHIP_TAHITI
	.comm	_CAYMAN_RING_TYPE_CP1_INDEX,8,3 ; @CAYMAN_RING_TYPE_CP1_INDEX
	.comm	_CAYMAN_RING_TYPE_CP2_INDEX,8,3 ; @CAYMAN_RING_TYPE_CP2_INDEX
	.comm	_CHIP_CAYMAN,4,2                ; @CHIP_CAYMAN
	.comm	_R600_RING_TYPE_DMA_INDEX,8,3   ; @R600_RING_TYPE_DMA_INDEX
	.comm	_CAYMAN_RING_TYPE_DMA1_INDEX,8,3 ; @CAYMAN_RING_TYPE_DMA1_INDEX
	.comm	_CHIP_RV770,4,2                 ; @CHIP_RV770
	.comm	_R600_RING_TYPE_UVD_INDEX,8,3   ; @R600_RING_TYPE_UVD_INDEX
	.comm	_TN_RING_TYPE_VCE1_INDEX,8,3    ; @TN_RING_TYPE_VCE1_INDEX
	.no_dead_strip	_radeon_cs_get_ring
.subsections_via_symbols
