	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_evergreen_cs_parse             ## -- Begin function evergreen_cs_parse
	.p2align	4, 0x90
_evergreen_cs_parse:                    ## @evergreen_cs_parse
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	cmpq	$0, (%rdi)
	jne	LBB0_9
## %bb.1:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_evergreen_cs_track_init
	movq	40(%r15), %rax
	movq	(%rax), %rsi
	movq	_CHIP_CAYMAN@GOTPCREL(%rip), %rbx
	xorl	%ecx, %ecx
	movq	_evergreen_reg_safe_bm@GOTPCREL(%rip), %r12
	movq	_cayman_reg_safe_bm@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdi
	movq	%rdi, %rdx
	cmpq	(%rbx), %rsi
	setge	%bl
	jge	LBB0_6
## %bb.5:
	movq	(%r12), %rdx
LBB0_6:
	movb	%bl, %cl
	movl	8(%rax,%rcx,4), %ebx
	movq	%rdx, 16(%r14)
	callq	_ARRAY_SIZE
	movq	_REG_SAFE_BM_SIZE@GOTPCREL(%rip), %r13
	xorl	%edi, %edi
	cmpq	(%r13), %rax
	setne	%dil
	callq	_BUILD_BUG_ON
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	xorl	%edi, %edi
	cmpq	(%r13), %rax
	setne	%dil
	callq	_BUILD_BUG_ON
	movl	%ebx, %ecx
	andl	$15, %ecx
	movl	$2, %eax
	cmpl	$3, %ecx
	ja	LBB0_8
## %bb.7:
	leaq	L_switch.table.evergreen_cs_parse(%rip), %rax
	movl	(%rax,%rcx,4), %eax
LBB0_8:
	movl	%ebx, %ecx
	shrl	$4, %ecx
	andl	$15, %ecx
	xorl	%edx, %edx
	cmpl	$2, %ecx
	sete	%dl
	leal	8(,%rdx,8), %edx
	testl	%ecx, %ecx
	movl	$4, %ecx
	cmovnel	%edx, %ecx
	movl	%eax, (%r14)
	movl	%ecx, 4(%r14)
	xorl	%eax, %eax
	testl	$3840, %ebx                     ## imm = 0xF00
	setne	%al
	shll	$8, %eax
	addl	$256, %eax                      ## imm = 0x100
	movl	%eax, 8(%r14)
	shrl	$12, %ebx
	andl	$15, %ebx
	xorl	%eax, %eax
	cmpl	$2, %ebx
	sete	%al
	addl	%eax, %eax
	addl	$2, %eax
	testl	%ebx, %ebx
	movl	$1, %ecx
	cmovnel	%eax, %ecx
	movl	%ecx, 12(%r14)
	movq	%r14, (%r15)
LBB0_9:
	movl	24(%r15), %edx
	leaq	-56(%rbp), %r14
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_evergreen_packet3_check
LBB0_19:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.20:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	24(%r15), %edx
LBB0_21:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	32(%r15), %rax
	cmpl	(%rax), %edx
	jge	LBB0_22
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_radeon_cs_packet_parse
	testl	%eax, %eax
	jne	LBB0_11
## %bb.13:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	-48(%rbp), %eax
	movl	24(%r15), %ecx
	leal	(%rax,%rcx), %edx
	addl	$2, %edx
	movl	%edx, 24(%r15)
	movl	-56(%rbp), %esi
	cmpl	$128, %esi
	je	LBB0_18
## %bb.14:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpl	$129, %esi
	je	LBB0_21
## %bb.15:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpl	$130, %esi
	jne	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_evergreen_cs_parse_packet0
	jmp	LBB0_19
LBB0_11:
	movl	%eax, %ebx
LBB0_12:
	movq	(%r15), %rdi
	callq	_kfree
	movq	$0, (%r15)
	jmp	LBB0_23
LBB0_22:
	movq	(%r15), %rdi
	callq	_kfree
	movq	$0, (%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_23
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_17:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	movq	(%r15), %rdi
	callq	_kfree
	movq	$0, (%r15)
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_23:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_CHIP_CAYMAN,8,3                ## @CHIP_CAYMAN
	.comm	_cayman_reg_safe_bm,8,3         ## @cayman_reg_safe_bm
	.comm	_evergreen_reg_safe_bm,8,3      ## @evergreen_reg_safe_bm
	.comm	_REG_SAFE_BM_SIZE,8,3           ## @REG_SAFE_BM_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unknown packet type %d !\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__literal16,16byte_literals
	.p2align	2                               ## @switch.table.evergreen_cs_parse
L_switch.table.evergreen_cs_parse:
	.long	1                               ## 0x1
	.long	2                               ## 0x2
	.long	4                               ## 0x4
	.long	8                               ## 0x8

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function evergreen_cs_parse
lCPI0_0:
	.long	15                              ; 0xf
	.long	3840                            ; 0xf00
lCPI0_1:
	.long	4                               ; 0x4
	.long	256                             ; 0x100
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_evergreen_cs_parse
	.p2align	2
_evergreen_cs_parse:                    ; @evergreen_cs_parse
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x0
	ldr	x8, [x0]
	cbnz	x8, LBB0_5
; %bb.1:
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_kzalloc
	cbz	x0, LBB0_18
; %bb.2:
	mov	x20, x0
	bl	_evergreen_cs_track_init
	ldr	x8, [x19, #40]
	ldr	x9, [x8]
Lloh3:
	adrp	x10, _CHIP_CAYMAN@GOTPAGE
Lloh4:
	ldr	x10, [x10, _CHIP_CAYMAN@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
Lloh6:
	adrp	x23, _evergreen_reg_safe_bm@GOTPAGE
Lloh7:
	ldr	x23, [x23, _evergreen_reg_safe_bm@GOTPAGEOFF]
	ldr	x11, [x23]
Lloh8:
	adrp	x12, _cayman_reg_safe_bm@GOTPAGE
Lloh9:
	ldr	x12, [x12, _cayman_reg_safe_bm@GOTPAGEOFF]
Lloh10:
	ldr	x0, [x12]
	cmp	x9, x10
	csel	x9, x11, x0, lt
	mov	w10, #12
	mov	w21, #8
	csel	x10, x21, x10, lt
	ldr	w22, [x8, x10]
	str	x9, [x20, #16]
	bl	_ARRAY_SIZE
Lloh11:
	adrp	x24, _REG_SAFE_BM_SIZE@GOTPAGE
Lloh12:
	ldr	x24, [x24, _REG_SAFE_BM_SIZE@GOTPAGEOFF]
	ldr	x8, [x24]
	cmp	x0, x8
	cset	w0, ne
	bl	_BUILD_BUG_ON
	ldr	x0, [x23]
	bl	_ARRAY_SIZE
	ldr	x8, [x24]
	cmp	x0, x8
	cset	w0, ne
	bl	_BUILD_BUG_ON
	and	x10, x22, #0xf
	mov	w8, #2
	mov	w9, #2
	cmp	w10, #3
	b.hi	LBB0_4
; %bb.3:
Lloh13:
	adrp	x9, l_switch.table.evergreen_cs_parse@PAGE
Lloh14:
	add	x9, x9, l_switch.table.evergreen_cs_parse@PAGEOFF
	ldr	w9, [x9, x10, lsl #2]
LBB0_4:
	mov	w10, #15
	ands	w11, w10, w22, lsr #12
	mov	w12, #4
	cmp	w11, #2
	csel	w8, w12, w8, eq
	tst	w10, w22, lsr #12
	str	w9, [x20]
	lsr	w9, w22, #4
	fmov	s0, w9
	mov.s	v0[1], w22
Lloh15:
	adrp	x9, lCPI0_0@PAGE
Lloh16:
	ldr	d1, [x9, lCPI0_0@PAGEOFF]
	and.8b	v0, v0, v1
	cmeq.2s	v1, v0, #0
	fmov	w9, s0
	csinc	w8, w8, wzr, ne
	mov	w10, #16
	cmp	w9, #2
	csel	w9, w10, w21, eq
	movi.2s	v0, #2, lsl #8
	mov.s	v0[0], w9
Lloh17:
	adrp	x9, lCPI0_1@PAGE
Lloh18:
	ldr	d2, [x9, lCPI0_1@PAGEOFF]
	bit.8b	v0, v2, v1
	stur	d0, [x20, #4]
	str	w8, [x20, #12]
	str	x20, [x19]
LBB0_5:
	ldr	w2, [x19, #24]
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x1, sp
	mov	x0, x19
	bl	_evergreen_packet3_check
	mov	x20, x0
	cbz	w0, LBB0_12
	b	LBB0_16
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x1, sp
	mov	x0, x19
	bl	_radeon_cs_packet_parse
	cbnz	w0, LBB0_15
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [x19, #24]
	ldr	w9, [sp, #8]
	ldr	w1, [sp]
	add	w8, w9, w8
	add	w2, w8, #2
	str	w2, [x19, #24]
	cmp	w1, #128
	b.eq	LBB0_6
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	cmp	w1, #129
	b.eq	LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	cmp	w1, #130
	b.ne	LBB0_19
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x1, sp
	mov	x0, x19
	bl	_evergreen_cs_parse_packet0
	mov	x20, x0
	cbnz	w0, LBB0_16
LBB0_12:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w2, [x19, #24]
LBB0_13:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x19, #32]
	ldr	w8, [x8]
	cmp	w2, w8
	b.lt	LBB0_7
; %bb.14:
	ldr	x0, [x19]
	bl	_kfree
	mov	w20, #0
	b	LBB0_17
LBB0_15:
	mov	x20, x0
LBB0_16:
	ldr	x0, [x19]
	bl	_kfree
LBB0_17:
	str	xzr, [x19]
	b	LBB0_21
LBB0_18:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_20
LBB0_19:
Lloh21:
	adrp	x0, l_.str@PAGE
Lloh22:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	ldr	x0, [x19]
	bl	_kfree
	str	xzr, [x19]
Lloh23:
	adrp	x8, _EINVAL@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_20:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_21:
	mov	x0, x20
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdr	Lloh17, Lloh18
	.loh AdrpLdr	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_CHIP_CAYMAN,8,3                ; @CHIP_CAYMAN
	.comm	_cayman_reg_safe_bm,8,3         ; @cayman_reg_safe_bm
	.comm	_evergreen_reg_safe_bm,8,3      ; @evergreen_reg_safe_bm
	.comm	_REG_SAFE_BM_SIZE,8,3           ; @REG_SAFE_BM_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unknown packet type %d !\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__literal16,16byte_literals
	.p2align	2                               ; @switch.table.evergreen_cs_parse
l_switch.table.evergreen_cs_parse:
	.long	1                               ; 0x1
	.long	2                               ; 0x2
	.long	4                               ; 0x4
	.long	8                               ; 0x8

.subsections_via_symbols
