	.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	8(%rdi), %r13
	movl	(%r13), %edx
	cmpl	%r12d, %edx
	jbe	LBB0_1
## %bb.2:
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	%r12d, %esi
	callq	_radeon_get_ib_value
	movl	%eax, %ebx
	movl	%r12d, (%r15)
	movl	%eax, %edi
	callq	_RADEON_CP_PACKET_GET_TYPE
	movl	%eax, 8(%r15)
	movl	%ebx, %edi
	callq	_RADEON_CP_PACKET_GET_COUNT
	movl	%eax, 4(%r15)
	movq	$0, 24(%r15)
	movl	8(%r15), %esi
	cmpl	$128, %esi
	je	LBB0_7
## %bb.3:
	cmpl	$129, %esi
	je	LBB0_8
## %bb.4:
	cmpl	$130, %esi
	jne	LBB0_9
## %bb.5:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	movq	_CHIP_R600@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jge	LBB0_10
## %bb.6:
	movl	%ebx, %edi
	callq	_R100_CP_PACKET0_GET_REG
	movl	%eax, 16(%r15)
	movl	%ebx, %edi
	callq	_RADEON_CP_PACKET0_GET_ONE_REG_WR
	movq	%rax, 24(%r15)
	jmp	LBB0_11
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_16
LBB0_7:
	movl	%ebx, %edi
	callq	_RADEON_CP_PACKET3_GET_OPCODE
	movl	%eax, 12(%r15)
	jmp	LBB0_11
LBB0_8:
	movl	$-1, 4(%r15)
	jmp	LBB0_11
LBB0_9:
	leaq	L_.str.1(%rip), %rdi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_13
LBB0_10:
	movl	%ebx, %edi
	callq	_R600_CP_PACKET0_GET_REG
	movl	%eax, 16(%r15)
LBB0_11:
	movl	(%r15), %esi
	movl	4(%r15), %ecx
	leal	(%rcx,%rsi), %eax
	incl	%eax
	movl	(%r13), %r8d
	xorl	%ebx, %ebx
	cmpl	%r8d, %eax
	jb	LBB0_16
## %bb.12:
	movl	8(%r15), %edx
	leaq	L_.str.2(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
                                        ## kill: def $ecx killed $ecx killed $rcx
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_13:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	cmpl	$0, (%r13)
	je	LBB0_15
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	cmpl	%ebx, %r12d
	leaq	L_.str.4(%rip), %r15
	leaq	L_.str.3(%rip), %rax
	cmoveq	%rax, %r15
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_radeon_get_ib_value
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_printk
	incl	%ebx
	cmpl	(%r13), %ebx
	jb	LBB0_14
LBB0_15:
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
LBB0_16:
	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"

L_.str.3:                               ## @.str.3
	.asciz	"\t0x%08x <---\n"

L_.str.4:                               ## @.str.4
	.asciz	"\t0x%08x\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, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x2
	ldr	x24, [x0, #8]
	ldr	w2, [x24]
	cmp	w2, w19
	b.ls	LBB0_6
; %bb.1:
	mov	x21, x1
	mov	x20, x0
	ldr	x23, [x0]
	mov	x1, x19
	bl	_radeon_get_ib_value
	mov	x22, x0
	str	w19, [x21]
	bl	_RADEON_CP_PACKET_GET_TYPE
	str	w0, [x21, #8]
	mov	x0, x22
	bl	_RADEON_CP_PACKET_GET_COUNT
	str	w0, [x21, #4]
	str	xzr, [x21, #24]
	ldr	w1, [x21, #8]
	cmp	w1, #128
	b.eq	LBB0_7
; %bb.2:
	cmp	w1, #129
	b.eq	LBB0_8
; %bb.3:
	cmp	w1, #130
	b.ne	LBB0_9
; %bb.4:
	ldr	w8, [x23]
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, x22
	bl	_R100_CP_PACKET0_GET_REG
	str	w0, [x21, #16]
	mov	x0, x22
	bl	_RADEON_CP_PACKET0_GET_ONE_REG_WR
	str	x0, [x21, #24]
	b	LBB0_11
LBB0_6:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_DRM_ERROR
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_17
LBB0_7:
	mov	x0, x22
	bl	_RADEON_CP_PACKET3_GET_OPCODE
	str	w0, [x21, #12]
	b	LBB0_11
LBB0_8:
	mov	w8, #-1
	str	w8, [x21, #4]
	b	LBB0_11
LBB0_9:
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x2, x19
	b	LBB0_14
LBB0_10:
	mov	x0, x22
	bl	_R600_CP_PACKET0_GET_REG
	str	w0, [x21, #16]
LBB0_11:
	ldp	w1, w8, [x21]
	add	w9, w8, w1
	add	w10, w9, #1
	ldr	w9, [x24]
	cmp	w10, w9
	b.hs	LBB0_13
; %bb.12:
	mov	w21, #0
	b	LBB0_17
LBB0_13:
	ldr	w2, [x21, #8]
	stp	x8, x9, [sp]
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_14:
	bl	_DRM_ERROR
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w21, w8
	ldr	w8, [x24]
	cbz	w8, LBB0_17
; %bb.15:
	mov	w22, #0
Lloh15:
	adrp	x25, l_.str.4@PAGE
Lloh16:
	add	x25, x25, l_.str.4@PAGEOFF
Lloh17:
	adrp	x26, l_.str.3@PAGE
Lloh18:
	add	x26, x26, l_.str.3@PAGEOFF
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	cmp	w19, w22
	csel	x23, x26, x25, eq
	mov	x0, x20
	mov	x1, x22
	bl	_radeon_get_ib_value
	mov	x1, x0
	mov	x0, x23
	bl	_printk
	add	w22, w22, #1
	ldr	w8, [x24]
	cmp	w22, w8
	b.lo	LBB0_16
LBB0_17:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.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"

l_.str.3:                               ; @.str.3
	.asciz	"\t0x%08x <---\n"

l_.str.4:                               ; @.str.4
	.asciz	"\t0x%08x\n"

.subsections_via_symbols
