	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_uvd_cs_msg
_radeon_uvd_cs_msg:                     ## @radeon_uvd_cs_msg
	.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
	movl	%edx, %ebx
	testb	$63, %bl
	je	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rdi
LBB0_2:
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_39:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_40:
	subl	(%rax), %r14d
	jmp	LBB0_41
LBB0_3:
	movq	%rcx, %r13
	movq	%rsi, %r12
	movq	%rdi, %r15
	movl	(%rsi), %edi
	callq	_dma_resv_get_excl
	testq	%rax, %rax
	je	LBB0_7
## %bb.4:
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_radeon_fence_wait
	testl	%eax, %eax
	je	LBB0_7
## %bb.5:
	movl	%eax, %r14d
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_6
LBB0_7:
	leaq	-56(%rbp), %rsi
	movq	%r12, %rdi
	callq	_radeon_bo_kmap
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	%eax, %r14d
	leaq	L_.str.2(%rip), %rdi
LBB0_6:
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_41:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	-56(%rbp), %rax
	movl	%ebx, %ecx
	movq	16(%rax,%rcx), %rdx
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	testq	%rdx, %rdx
	je	LBB0_10
## %bb.11:
	leaq	(%rax,%rcx), %rbx
	movq	8(%rax,%rcx), %rsi
	testq	%rsi, %rsi
	je	LBB0_18
## %bb.12:
	cmpq	$1, %rsi
	je	LBB0_27
## %bb.13:
	cmpq	$2, %rsi
	jne	LBB0_37
## %bb.14:
	movq	(%r15), %rax
	cmpl	$0, (%rax)
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	jle	LBB0_17
## %bb.15:
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%rax), %rdi
	addq	%r14, %rdi
	movq	%r13, %rsi
	xorl	%edx, %edx
	callq	_atomic_cmpxchg
	incq	%rbx
	movq	(%r15), %rax
	movslq	(%rax), %rcx
	addq	$4, %r14
	cmpq	%rcx, %rbx
	jl	LBB0_16
LBB0_17:
	movq	%r12, %rdi
	callq	_radeon_bo_kunmap
	xorl	%r14d, %r14d
	jmp	LBB0_41
LBB0_10:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_2
LBB0_18:
	movl	64(%rbx), %r13d
	imull	56(%rbx), %r13d
	movq	32(%rbx), %rsi
	movq	%r15, %rdi
	callq	_radeon_uvd_validate_codec
	movl	%eax, %r14d
	movq	%r12, %rdi
	callq	_radeon_bo_kunmap
	testl	%r14d, %r14d
	jne	LBB0_41
## %bb.19:
	movq	(%r15), %rax
	cmpl	$0, (%rax)
	jle	LBB0_26
## %bb.20:
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%rax), %rdi
	addq	%rbx, %rdi
	callq	_atomic_read
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	cmpq	%rdx, %rax
	je	LBB0_22
## %bb.23:                              ##   in Loop: Header=BB0_21 Depth=1
	movq	(%r15), %rax
	movq	16(%rax), %rdi
	addq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_atomic_cmpxchg
	testl	%eax, %eax
	je	LBB0_24
## %bb.25:                              ##   in Loop: Header=BB0_21 Depth=1
	incq	%r14
	movq	(%r15), %rax
	movslq	(%rax), %rcx
	addq	$4, %rbx
	cmpq	%rcx, %r14
	jl	LBB0_21
LBB0_26:
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_2
LBB0_27:
	movq	32(%rbx), %rsi
	movq	%r15, %rdi
	callq	_radeon_uvd_validate_codec
	testl	%eax, %eax
	je	LBB0_29
## %bb.28:
	movl	%eax, %r14d
	movq	%r12, %rdi
	callq	_radeon_bo_kunmap
	jmp	LBB0_41
LBB0_37:
	leaq	L_.str.8(%rip), %rdi
	xorl	%r14d, %r14d
LBB0_38:
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_39
LBB0_29:
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_radeon_uvd_cs_msg_decode
	movl	%eax, %r14d
	movq	%r12, %rdi
	callq	_radeon_bo_kunmap
	testl	%r14d, %r14d
	jne	LBB0_41
## %bb.30:
	movq	(%r15), %rax
	cmpl	$0, (%rax)
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	jle	LBB0_36
## %bb.31:
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
LBB0_32:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%rax), %rdi
	addq	%r14, %rdi
	callq	_atomic_read
	cmpq	%r12, %rax
	je	LBB0_33
## %bb.35:                              ##   in Loop: Header=BB0_32 Depth=1
	incq	%rbx
	movq	(%r15), %rax
	movslq	(%rax), %rcx
	addq	$4, %r14
	cmpq	%rcx, %rbx
	jl	LBB0_32
LBB0_36:
	leaq	L_.str.7(%rip), %rdi
	xorl	%r14d, %r14d
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_ENOENT@GOTPCREL(%rip), %rax
	jmp	LBB0_40
LBB0_22:
	leaq	L_.str.4(%rip), %rdi
	xorl	%r14d, %r14d
	movq	%rdx, %rsi
	jmp	LBB0_38
LBB0_24:
	movl	8(%r15), %eax
	movq	(%r15), %rcx
	movq	24(%rcx), %rdx
	movl	%eax, (%rdx,%rbx)
	movq	8(%rcx), %rax
	movl	%r13d, (%rax,%rbx)
	xorl	%r14d, %r14d
	jmp	LBB0_41
LBB0_33:
	movq	(%r15), %rax
	movq	24(%rax), %rax
	movl	(%rax,%r14), %eax
	xorl	%r14d, %r14d
	cmpl	8(%r15), %eax
	je	LBB0_41
## %bb.34:
	leaq	L_.str.6(%rip), %rdi
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"UVD messages must be 64 byte aligned!\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Failed waiting for UVD message (%d)!\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed mapping the UVD message (%d)!\n"

L_.str.3:                               ## @.str.3
	.asciz	"Invalid UVD handle!\n"

L_.str.4:                               ## @.str.4
	.asciz	"Handle 0x%x already in use!\n"

L_.str.5:                               ## @.str.5
	.asciz	"No more free UVD handles!\n"

L_.str.6:                               ## @.str.6
	.asciz	"UVD handle collision detected!\n"

L_.str.7:                               ## @.str.7
	.asciz	"Invalid UVD handle 0x%x!\n"

	.comm	_ENOENT,4,2                     ## @ENOENT
L_.str.8:                               ## @.str.8
	.asciz	"Illegal UVD message type (%d)!\n"

	.no_dead_strip	_radeon_uvd_cs_msg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radeon_uvd_cs_msg
_radeon_uvd_cs_msg:                     ; @radeon_uvd_cs_msg
	.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
	tst	w2, #0x3f
	b.eq	LBB0_5
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
LBB0_2:
	bl	_DRM_ERROR
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_4:
	mov	x0, x22
	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
LBB0_5:
	mov	x23, x3
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	w0, [x1]
	bl	_dma_resv_get_excl
	cbz	x0, LBB0_8
; %bb.6:
	mov	w1, #0
	bl	_radeon_fence_wait
	cbz	w0, LBB0_8
; %bb.7:
	mov	x22, x0
	str	x22, [sp]
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_4
LBB0_8:
	add	x1, sp, #8
	mov	x0, x21
	bl	_radeon_bo_kmap
	cbz	w0, LBB0_10
; %bb.9:
	mov	x22, x0
	str	x22, [sp]
Lloh6:
	adrp	x0, l_.str.2@PAGE
Lloh7:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_ERROR
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	b	LBB0_4
LBB0_10:
	ldr	x8, [sp, #8]
	add	x24, x8, w20, uxtw
	ldr	x20, [x24, #16]
	cbz	x20, LBB0_18
; %bb.11:
	ldr	x8, [x24, #8]
	cbz	x8, LBB0_19
; %bb.12:
	cmp	x8, #1
	b.eq	LBB0_26
; %bb.13:
	cmp	x8, #2
	b.ne	LBB0_28
; %bb.14:
	ldr	x8, [x19]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_17
; %bb.15:
	mov	x22, #0
	mov	x23, #0
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x8, #16]
	add	x0, x8, x22
	mov	x1, x20
	mov	x2, #0
	bl	_atomic_cmpxchg
	add	x23, x23, #1
	ldr	x8, [x19]
	ldrsw	x9, [x8]
	add	x22, x22, #4
	cmp	x23, x9
	b.lt	LBB0_16
LBB0_17:
	mov	x0, x21
	bl	_radeon_bo_kunmap
	mov	w22, #0
	b	LBB0_4
LBB0_18:
Lloh8:
	adrp	x0, l_.str.3@PAGE
Lloh9:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_2
LBB0_19:
	ldr	w23, [x24, #56]
	ldr	w25, [x24, #64]
	ldr	x1, [x24, #32]
	mov	x0, x19
	bl	_radeon_uvd_validate_codec
	mov	x22, x0
	mov	x0, x21
	bl	_radeon_bo_kunmap
	cbnz	w22, LBB0_4
; %bb.20:
	ldr	x8, [x19]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_25
; %bb.21:
	mov	x21, #0
	mov	x22, #0
	mul	w23, w25, w23
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x8, #16]
	add	x0, x8, x21
	bl	_atomic_read
	cmp	x0, x20
	b.eq	LBB0_35
; %bb.23:                               ;   in Loop: Header=BB0_22 Depth=1
	ldr	x8, [x19]
	ldr	x8, [x8, #16]
	add	x0, x8, x21
	mov	x1, #0
	mov	x2, x20
	bl	_atomic_cmpxchg
	cbz	w0, LBB0_36
; %bb.24:                               ;   in Loop: Header=BB0_22 Depth=1
	add	x22, x22, #1
	ldr	x8, [x19]
	ldrsw	x9, [x8]
	add	x21, x21, #4
	cmp	x22, x9
	b.lt	LBB0_22
LBB0_25:
Lloh10:
	adrp	x0, l_.str.5@PAGE
Lloh11:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_2
LBB0_26:
	ldr	x1, [x24, #32]
	mov	x0, x19
	bl	_radeon_uvd_validate_codec
	cbz	w0, LBB0_29
; %bb.27:
	mov	x22, x0
	mov	x0, x21
	bl	_radeon_bo_kunmap
	b	LBB0_4
LBB0_28:
	str	x8, [sp]
Lloh12:
	adrp	x0, l_.str.8@PAGE
Lloh13:
	add	x0, x0, l_.str.8@PAGEOFF
	b	LBB0_2
LBB0_29:
	mov	x0, x24
	mov	x1, x23
	bl	_radeon_uvd_cs_msg_decode
	mov	x22, x0
	mov	x0, x21
	bl	_radeon_bo_kunmap
	cbnz	w22, LBB0_4
; %bb.30:
	ldr	x8, [x19]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_34
; %bb.31:
	mov	x21, #0
	mov	x22, #0
LBB0_32:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x8, #16]
	add	x0, x8, x21
	bl	_atomic_read
	cmp	x0, x20
	b.eq	LBB0_37
; %bb.33:                               ;   in Loop: Header=BB0_32 Depth=1
	add	x22, x22, #1
	ldr	x8, [x19]
	ldrsw	x9, [x8]
	add	x21, x21, #4
	cmp	x22, x9
	b.lt	LBB0_32
LBB0_34:
	str	x20, [sp]
Lloh14:
	adrp	x0, l_.str.7@PAGE
Lloh15:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_DRM_ERROR
Lloh16:
	adrp	x8, _ENOENT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_3
LBB0_35:
	str	x20, [sp]
Lloh18:
	adrp	x0, l_.str.4@PAGE
Lloh19:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_2
LBB0_36:
	mov	w22, #0
	ldr	w8, [x19, #8]
	ldr	x9, [x19]
	ldr	x10, [x9, #24]
	str	w8, [x10, x21]
	ldr	x8, [x9, #8]
	str	w23, [x8, x21]
	b	LBB0_4
LBB0_37:
	ldr	x8, [x19]
	ldr	x8, [x8, #24]
	ldr	w8, [x8, x21]
	ldr	w9, [x19, #8]
	cmp	w8, w9
	b.ne	LBB0_39
; %bb.38:
	mov	w22, #0
	b	LBB0_4
LBB0_39:
Lloh20:
	adrp	x0, l_.str.6@PAGE
Lloh21:
	add	x0, x0, l_.str.6@PAGEOFF
	b	LBB0_2
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"UVD messages must be 64 byte aligned!\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Failed waiting for UVD message (%d)!\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed mapping the UVD message (%d)!\n"

l_.str.3:                               ; @.str.3
	.asciz	"Invalid UVD handle!\n"

l_.str.4:                               ; @.str.4
	.asciz	"Handle 0x%x already in use!\n"

l_.str.5:                               ; @.str.5
	.asciz	"No more free UVD handles!\n"

l_.str.6:                               ; @.str.6
	.asciz	"UVD handle collision detected!\n"

l_.str.7:                               ; @.str.7
	.asciz	"Invalid UVD handle 0x%x!\n"

	.comm	_ENOENT,4,2                     ; @ENOENT
l_.str.8:                               ; @.str.8
	.asciz	"Illegal UVD message type (%d)!\n"

	.no_dead_strip	_radeon_uvd_cs_msg
.subsections_via_symbols
