	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdgpu_uvd_cs_msg
_amdgpu_uvd_cs_msg:                     ## @amdgpu_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_32:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_33:
	subl	(%rax), %r14d
	jmp	LBB0_34
LBB0_3:
	movq	%rsi, %r13
	movq	%rdi, %r15
	movq	(%rdi), %rax
	movq	8(%rax), %r12
	leaq	-56(%rbp), %rsi
	movq	%r13, %rdi
	callq	_amdgpu_bo_kmap
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	%rax, %r14
	leaq	L_.str.1(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_34:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	-56(%rbp), %rsi
	movl	%ebx, %ecx
	movq	16(%rsi,%rcx), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	8(%rsi,%rcx), %rax
	testq	%rax, %rax
	je	LBB0_14
## %bb.8:
	cmpq	$1, %rax
	je	LBB0_22
## %bb.9:
	cmpq	$2, %rax
	jne	LBB0_30
## %bb.10:
	cmpl	$0, (%r12)
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	jle	LBB0_13
## %bb.11:
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rdi
	addq	%r14, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_atomic_cmpxchg
	incq	%rbx
	movslq	(%r12), %rax
	addq	$4, %r14
	cmpq	%rax, %rbx
	jl	LBB0_12
LBB0_13:
	movq	%r13, %rdi
	callq	_amdgpu_bo_kunmap
	xorl	%r14d, %r14d
	jmp	LBB0_34
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_2
LBB0_14:
	movq	%r13, %rdi
	callq	_amdgpu_bo_kunmap
	cmpl	$0, (%r12)
	jle	LBB0_21
## %bb.15:
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rdi
	addq	%rbx, %rdi
	callq	_atomic_read
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	cmpq	%rdx, %rax
	je	LBB0_17
## %bb.18:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	8(%r12), %rdi
	addq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_atomic_cmpxchg
	testl	%eax, %eax
	je	LBB0_19
## %bb.20:                              ##   in Loop: Header=BB0_16 Depth=1
	incq	%r14
	movslq	(%r12), %rax
	addq	$4, %rbx
	cmpq	%rax, %r14
	jl	LBB0_16
LBB0_21:
	leaq	L_.str.4(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	jmp	LBB0_33
LBB0_22:
	addq	%rcx, %rsi
	movl	8(%r15), %edx
	movq	%r12, %rdi
	callq	_amdgpu_uvd_cs_msg_decode
	movq	%rax, %r14
	movq	%r13, %rdi
	callq	_amdgpu_bo_kunmap
	testq	%r14, %r14
	jne	LBB0_34
## %bb.23:
	cmpl	$0, (%r12)
	jle	LBB0_29
## %bb.24:
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
LBB0_25:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rdi
	addq	%r14, %rdi
	callq	_atomic_read
	cmpq	-48(%rbp), %rax                 ## 8-byte Folded Reload
	je	LBB0_26
## %bb.28:                              ##   in Loop: Header=BB0_25 Depth=1
	incq	%rbx
	movslq	(%r12), %rax
	addq	$4, %r14
	cmpq	%rax, %rbx
	jl	LBB0_25
LBB0_29:
	leaq	L_.str.6(%rip), %rdi
	xorl	%r14d, %r14d
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_ENOENT@GOTPCREL(%rip), %rax
	jmp	LBB0_33
LBB0_30:
	leaq	L_.str.7(%rip), %rdi
	xorl	%r14d, %r14d
	movq	%rax, %rsi
LBB0_31:
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_32
LBB0_17:
	leaq	L_.str.3(%rip), %rdi
	xorl	%r14d, %r14d
	movq	%rdx, %rsi
	jmp	LBB0_31
LBB0_19:
	movq	(%r15), %rax
	movl	(%rax), %eax
	movq	16(%r12), %rcx
	movl	%eax, (%rcx,%rbx)
	xorl	%r14d, %r14d
	jmp	LBB0_34
LBB0_26:
	movq	16(%r12), %rax
	movl	(%rax,%r14), %eax
	movq	(%r15), %rcx
	xorl	%r14d, %r14d
	cmpl	(%rcx), %eax
	je	LBB0_34
## %bb.27:
	leaq	L_.str.5(%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 mapping the UVD) message (%ld)!\n"

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

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

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

	.comm	_ENOSPC,4,2                     ## @ENOSPC
L_.str.5:                               ## @.str.5
	.asciz	"UVD handle collision detected!\n"

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

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

	.no_dead_strip	_amdgpu_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 amdgpu_uvd_cs_msg
_amdgpu_uvd_cs_msg:                     ; @amdgpu_uvd_cs_msg
	.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
	tst	w2, #0x3f
	b.eq	LBB0_4
; %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	w20, w8
	b	LBB0_6
LBB0_4:
	mov	x23, x2
	mov	x22, x1
	mov	x21, x0
	ldr	x8, [x0]
	ldr	x19, [x8, #8]
	add	x1, sp, #8
	mov	x0, x22
	bl	_amdgpu_bo_kmap
	cbz	x0, LBB0_7
; %bb.5:
	mov	x20, x0
	str	x0, [sp]
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
LBB0_6:
	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
LBB0_7:
	ldr	x8, [sp, #8]
	add	x1, x8, w23, uxtw
	ldr	x20, [x1, #16]
	cbz	x20, LBB0_15
; %bb.8:
	ldr	x8, [x1, #8]
	cbz	x8, LBB0_16
; %bb.9:
	cmp	x8, #1
	b.eq	LBB0_22
; %bb.10:
	cmp	x8, #2
	b.ne	LBB0_24
; %bb.11:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.12:
	mov	x21, #0
	mov	x23, #0
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x0, x8, x21
	mov	x1, x20
	mov	x2, #0
	bl	_atomic_cmpxchg
	add	x23, x23, #1
	ldrsw	x8, [x19]
	add	x21, x21, #4
	cmp	x23, x8
	b.lt	LBB0_13
LBB0_14:
	mov	x0, x22
	bl	_amdgpu_bo_kunmap
	mov	w20, #0
	b	LBB0_6
LBB0_15:
Lloh6:
	adrp	x0, l_.str.2@PAGE
Lloh7:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_2
LBB0_16:
	mov	x0, x22
	bl	_amdgpu_bo_kunmap
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_21
; %bb.17:
	mov	x22, #0
	mov	x23, #0
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x0, x8, x22
	bl	_atomic_read
	cmp	x0, x20
	b.eq	LBB0_30
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	x8, [x19, #8]
	add	x0, x8, x22
	mov	x1, #0
	mov	x2, x20
	bl	_atomic_cmpxchg
	cbz	w0, LBB0_31
; %bb.20:                               ;   in Loop: Header=BB0_18 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x19]
	add	x22, x22, #4
	cmp	x23, x8
	b.lt	LBB0_18
LBB0_21:
Lloh8:
	adrp	x0, l_.str.4@PAGE
Lloh9:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DRM_ERROR
Lloh10:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
	b	LBB0_3
LBB0_22:
	ldr	w2, [x21, #8]
	mov	x0, x19
	bl	_amdgpu_uvd_cs_msg_decode
	mov	x23, x0
	mov	x0, x22
	bl	_amdgpu_bo_kunmap
	cbz	x23, LBB0_25
; %bb.23:
	mov	x20, x23
	b	LBB0_6
LBB0_24:
	str	x8, [sp]
Lloh12:
	adrp	x0, l_.str.7@PAGE
Lloh13:
	add	x0, x0, l_.str.7@PAGEOFF
	b	LBB0_2
LBB0_25:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_29
; %bb.26:
	mov	x22, #0
	mov	x23, #0
LBB0_27:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x0, x8, x22
	bl	_atomic_read
	cmp	x0, x20
	b.eq	LBB0_32
; %bb.28:                               ;   in Loop: Header=BB0_27 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x19]
	add	x22, x22, #4
	cmp	x23, x8
	b.lt	LBB0_27
LBB0_29:
	str	x20, [sp]
Lloh14:
	adrp	x0, l_.str.6@PAGE
Lloh15:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_DRM_ERROR
Lloh16:
	adrp	x8, _ENOENT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_3
LBB0_30:
	str	x20, [sp]
Lloh18:
	adrp	x0, l_.str.3@PAGE
Lloh19:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_2
LBB0_31:
	mov	w20, #0
	ldr	x8, [x21]
	ldr	w8, [x8]
	ldr	x9, [x19, #16]
	str	w8, [x9, x22]
	b	LBB0_6
LBB0_32:
	ldr	x8, [x19, #16]
	ldr	w8, [x8, x22]
	ldr	x9, [x21]
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_34
; %bb.33:
	mov	w20, #0
	b	LBB0_6
LBB0_34:
Lloh20:
	adrp	x0, l_.str.5@PAGE
Lloh21:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_2
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.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 mapping the UVD) message (%ld)!\n"

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

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

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

	.comm	_ENOSPC,4,2                     ; @ENOSPC
l_.str.5:                               ; @.str.5
	.asciz	"UVD handle collision detected!\n"

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

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

	.no_dead_strip	_amdgpu_uvd_cs_msg
.subsections_via_symbols
