	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_uvd_cs_parse            ## -- Begin function radeon_uvd_cs_parse
	.p2align	4, 0x90
_radeon_uvd_cs_parse:                   ## @radeon_uvd_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	$0, -76(%rbp)
	movl	$0, -72(%rbp)
	movl	$0, -68(%rbp)
	movaps	L___const.radeon_uvd_cs_parse.buf_sizes(%rip), %xmm0
	movaps	%xmm0, -64(%rbp)
	movq	8(%rdi), %rax
	movl	(%rax), %esi
	testb	$15, %sil
	je	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rdi
LBB0_2:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_14
LBB0_3:
	movq	%rdi, %r14
	cmpq	$0, 16(%rdi)
	je	LBB0_12
## %bb.4:
	movl	(%r14), %edx
	leaq	-88(%rbp), %r15
	leaq	-64(%rbp), %r12
	leaq	-68(%rbp), %r13
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_7 Depth=1
	movl	-84(%rbp), %eax
	movl	(%r14), %ecx
	leal	(%rax,%rcx), %edx
	addl	$2, %edx
	movl	%edx, (%r14)
LBB0_6:                                 ##   in Loop: Header=BB0_7 Depth=1
	movq	8(%r14), %rax
	cmpl	(%rax), %edx
	jge	LBB0_18
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_radeon_cs_packet_parse
	testl	%eax, %eax
	jne	LBB0_17
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	-88(%rbp), %esi
	cmpl	$128, %esi
	je	LBB0_5
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	cmpl	$129, %esi
	jne	LBB0_20
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%r14, %rdi
	movq	%r15, %rsi
	leaq	-76(%rbp), %rdx
	leaq	-72(%rbp), %rcx
	movq	%r12, %r8
	movq	%r13, %r9
	callq	_radeon_uvd_cs_reg
	testl	%eax, %eax
	jne	LBB0_17
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	(%r14), %edx
	jmp	LBB0_6
LBB0_12:
	leaq	L_.str.1(%rip), %rdi
LBB0_13:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_14:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_15:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_22
## %bb.16:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movl	%eax, %ebx
	jmp	LBB0_15
LBB0_18:
	xorl	%ebx, %ebx
	cmpl	$0, -68(%rbp)
	jne	LBB0_15
## %bb.19:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_13
LBB0_20:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_2
LBB0_22:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## @__const.radeon_uvd_cs_parse.buf_sizes
L___const.radeon_uvd_cs_parse.buf_sizes:
	.long	2048                            ## 0x800
	.long	33554432                        ## 0x2000000
	.long	7077888                         ## 0x6c0000
	.long	2048                            ## 0x800

	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"UVD IB length (%d) not 16 dwords aligned!\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"No relocation chunk !\n"

L_.str.2:                               ## @.str.2
	.asciz	"Unknown packet type %d !\n"

L_.str.3:                               ## @.str.3
	.asciz	"UVD-IBs need a msg command!\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_uvd_cs_parse            ; -- Begin function radeon_uvd_cs_parse
	.p2align	2
_radeon_uvd_cs_parse:                   ; @radeon_uvd_cs_parse
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
	str	xzr, [sp, #16]
	adrp	x8, l___const.radeon_uvd_cs_parse.buf_sizes@PAGE
	add	x8, x8, l___const.radeon_uvd_cs_parse.buf_sizes@PAGEOFF
	str	wzr, [sp, #12]
	ldr	q0, [x8]
	str	q0, [sp, #32]
	ldr	x8, [x0, #8]
	ldr	w8, [x8]
	tst	w8, #0xf
	b.eq	LBB0_5
; %bb.1:
	str	x8, [sp]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
LBB0_2:
	bl	_DRM_ERROR
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldur	x8, [x29, #-24]
Lloh8:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh9:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_19
; %bb.4:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_5:
	mov	x19, x0
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_14
; %bb.6:
	ldr	w2, [x19]
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	w8, [sp, #28]
	ldr	w9, [x19]
	add	w8, w8, w9
	add	w2, w8, #2
	str	w2, [x19]
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
	cmp	w2, w8
	b.ge	LBB0_15
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, sp, #24
	mov	x0, x19
	bl	_radeon_cs_packet_parse
	cbnz	w0, LBB0_3
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w8, [sp, #24]
	cmp	w8, #128
	b.eq	LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	cmp	w8, #129
	b.ne	LBB0_17
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x1, sp, #24
	add	x2, sp, #20
	add	x3, sp, #16
	add	x4, sp, #32
	add	x5, sp, #12
	mov	x0, x19
	bl	_radeon_uvd_cs_reg
	cbnz	w0, LBB0_3
; %bb.13:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w2, [x19]
	b	LBB0_8
LBB0_14:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_2
LBB0_15:
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_18
; %bb.16:
	mov	w0, #0
	b	LBB0_3
LBB0_17:
	str	x8, [sp]
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_2
LBB0_18:
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_2
LBB0_19:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__literal16,16byte_literals
	.p2align	2                               ; @__const.radeon_uvd_cs_parse.buf_sizes
l___const.radeon_uvd_cs_parse.buf_sizes:
	.long	2048                            ; 0x800
	.long	33554432                        ; 0x2000000
	.long	7077888                         ; 0x6c0000
	.long	2048                            ; 0x800

	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"UVD IB length (%d) not 16 dwords aligned!\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"No relocation chunk !\n"

l_.str.2:                               ; @.str.2
	.asciz	"Unknown packet type %d !\n"

l_.str.3:                               ; @.str.3
	.asciz	"UVD-IBs need a msg command!\n"

.subsections_via_symbols
