	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_cs_packet_parse         ## -- Begin function radeon_cs_packet_parse
	.p2align	4, 0x90
_radeon_cs_packet_parse:                ## @radeon_cs_packet_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	movq	16(%rdi), %r13
	movq	(%rdi), %rbx
	movl	(%r13,%rbx,4), %edx
	cmpl	%r12d, %edx
	jbe	LBB0_1
## %bb.3:
	movq	%rsi, %r14
	movq	8(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	%r12d, %esi
	callq	_radeon_get_ib_value
	movl	%eax, %r15d
	movl	%r12d, (%r14)
	movl	%eax, %edi
	callq	_RADEON_CP_PACKET_GET_TYPE
	movl	%eax, 8(%r14)
	movl	%r15d, %edi
	callq	_RADEON_CP_PACKET_GET_COUNT
	movl	%eax, 4(%r14)
	movq	$0, 24(%r14)
	movslq	8(%r14), %rsi
	cmpq	$128, %rsi
	je	LBB0_8
## %bb.4:
	cmpl	$129, %esi
	je	LBB0_9
## %bb.5:
	cmpl	$130, %esi
	jne	LBB0_10
## %bb.6:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	movq	_CHIP_R600@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jge	LBB0_11
## %bb.7:
	movl	%r15d, %edi
	callq	_R100_CP_PACKET0_GET_REG
	movl	%eax, 16(%r14)
	movl	%r15d, %edi
	callq	_RADEON_CP_PACKET0_GET_ONE_REG_WR
	movq	%rax, 24(%r14)
	jmp	LBB0_12
LBB0_1:
	movl	%r12d, %esi
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
LBB0_2:
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_14
LBB0_8:
	movl	%r15d, %edi
	callq	_RADEON_CP_PACKET3_GET_OPCODE
	movl	%eax, 12(%r14)
	jmp	LBB0_12
LBB0_9:
	movl	$-1, 4(%r14)
	jmp	LBB0_12
LBB0_10:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%r12d, %edx
	jmp	LBB0_2
LBB0_11:
	movl	%r15d, %edi
	callq	_R600_CP_PACKET0_GET_REG
	movl	%eax, 16(%r14)
LBB0_12:
	movl	(%r14), %esi
	movl	4(%r14), %ecx
	leal	(%rcx,%rsi), %eax
	incl	%eax
	movl	(%r13,%rbx,4), %r8d
	xorl	%ebx, %ebx
	cmpl	%r8d, %eax
	jb	LBB0_15
## %bb.13:
	movl	8(%r14), %edx
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
                                        ## kill: def $ecx killed $ecx killed $rcx
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_14:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_15:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can not parse packet at %d after CS end %d !\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CHIP_R600,4,2                  ## @CHIP_R600
L_.str.1:                               ## @.str.1
	.asciz	"Unknown packet type %d at %d !\n"

L_.str.2:                               ## @.str.2
	.asciz	"Packet (%d:%d:%d) end after CS buffer (%d) !\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_cs_packet_parse         ; -- Begin function radeon_cs_packet_parse
	.p2align	2
_radeon_cs_packet_parse:                ; @radeon_cs_packet_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	x20, x2
	ldr	x22, [x0, #16]
	ldr	x23, [x0]
	ldr	w2, [x22, x23, lsl #2]
	cmp	w2, w20
	b.ls	LBB0_6
; %bb.1:
	mov	x19, x1
	ldr	x24, [x0, #8]
	mov	x1, x20
	bl	_radeon_get_ib_value
	mov	x21, x0
	str	w20, [x19]
	bl	_RADEON_CP_PACKET_GET_TYPE
	str	w0, [x19, #8]
	mov	x0, x21
	bl	_RADEON_CP_PACKET_GET_COUNT
	str	w0, [x19, #4]
	str	xzr, [x19, #24]
	ldr	w8, [x19, #8]
	cmp	w8, #128
	b.eq	LBB0_7
; %bb.2:
	cmp	w8, #129
	b.eq	LBB0_8
; %bb.3:
	cmp	w8, #130
	b.ne	LBB0_9
; %bb.4:
	ldr	w8, [x24]
Lloh0:
	adrp	x9, _CHIP_R600@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CHIP_R600@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ge	LBB0_10
; %bb.5:
	mov	x0, x21
	bl	_R100_CP_PACKET0_GET_REG
	str	w0, [x19, #16]
	mov	x0, x21
	bl	_RADEON_CP_PACKET0_GET_ONE_REG_WR
	str	x0, [x19, #24]
	b	LBB0_11
LBB0_6:
	mov	w1, w20
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_14
LBB0_7:
	mov	x0, x21
	bl	_RADEON_CP_PACKET3_GET_OPCODE
	str	w0, [x19, #12]
	b	LBB0_11
LBB0_8:
	mov	w8, #-1
	str	w8, [x19, #4]
	b	LBB0_11
LBB0_9:
	sxtw	x1, w8
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x2, x20
	b	LBB0_14
LBB0_10:
	mov	x0, x21
	bl	_R600_CP_PACKET0_GET_REG
	str	w0, [x19, #16]
LBB0_11:
	ldp	w1, w8, [x19]
	add	w9, w8, w1
	add	w10, w9, #1
	ldr	w9, [x22, x23, lsl #2]
	cmp	w10, w9
	b.hs	LBB0_13
; %bb.12:
	mov	w0, #0
	b	LBB0_15
LBB0_13:
	ldr	w2, [x19, #8]
	stp	x8, x9, [sp]
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_14:
	bl	_DRM_ERROR
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_15:
	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 AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can not parse packet at %d after CS end %d !\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CHIP_R600,4,2                  ; @CHIP_R600
l_.str.1:                               ; @.str.1
	.asciz	"Unknown packet type %d at %d !\n"

l_.str.2:                               ; @.str.2
	.asciz	"Packet (%d:%d:%d) end after CS buffer (%d) !\n"

.subsections_via_symbols
