	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_uvd_cs_reloc
_radeon_uvd_cs_reloc:                   ## @radeon_uvd_cs_reloc
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -80(%rbp)                  ## 8-byte Spill
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%edx, %ebx
	movl	%esi, %r14d
	movq	%rdi, %r12
	movq	32(%rdi), %r15
	callq	_radeon_get_ib_value
	movl	%eax, %r13d
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_radeon_get_ib_value
	movl	%eax, %esi
	movl	(%r15), %edx
	cmpl	%edx, %eax
	jae	LBB0_1
## %bb.4:
	movq	24(%r12), %rax
	shrl	$2, %esi
	movl	%r13d, %ebx
	movl	(%rax,%rsi,8), %r13d
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movl	4(%rax,%rsi,8), %edi
	callq	_radeon_bo_size
	movl	%eax, %r15d
	addl	%r13d, %r15d
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	addl	%ebx, %r13d
	movq	16(%r12), %rax
	movslq	%r14d, %rcx
	movl	%r13d, (%rax,%rcx,4)
	movl	(%r12), %esi
	movq	%r12, %rdi
	callq	_radeon_get_ib_value
	movl	%eax, %esi
	sarl	%esi
	cmpl	$7, %eax
	ja	LBB0_9
## %bb.5:
	movl	%r15d, %edx
	subl	%r13d, %edx
	jbe	LBB0_6
## %bb.7:
	movl	%esi, %ecx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	(%rdi,%rcx,4), %ecx
	cmpl	%ecx, %edx
	jae	LBB0_12
## %bb.8:
	leaq	L_.str.2(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_3
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%r14d, %r14d
                                        ## kill: def $esi killed $esi killed $rsi
LBB0_2:
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_3
LBB0_9:
	cmpl	$256, %esi                      ## imm = 0x100
	jne	LBB0_10
LBB0_12:
	movl	%r13d, %ecx
	shrl	$28, %ecx
	leal	-1(%r15), %edx
	shrl	$28, %edx
	cmpl	%edx, %ecx
	jne	LBB0_13
## %bb.15:
	cmpl	$2, %eax
	jb	LBB0_17
## %bb.16:
	cmpl	$3, %esi
	jne	LBB0_19
LBB0_17:
	movq	8(%r12), %rdx
	movl	(%rdx), %edx
	sarl	$28, %edx
	cmpl	%edx, %ecx
	jne	LBB0_18
LBB0_19:
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movl	(%rdx), %ecx
	cmpl	$1, %eax
	ja	LBB0_23
## %bb.20:
	testl	%ecx, %ecx
	je	LBB0_25
## %bb.21:
	leaq	L_.str.6(%rip), %rdi
	jmp	LBB0_22
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r14d, %r14d
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	jmp	LBB0_11
LBB0_10:
	leaq	L_.str.3(%rip), %rdi
	xorl	%r14d, %r14d
LBB0_11:
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
LBB0_27:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_14
LBB0_23:
	testl	%ecx, %ecx
	jne	LBB0_26
## %bb.24:
	leaq	L_.str.7(%rip), %rdi
LBB0_22:
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_3
LBB0_18:
	leaq	L_.str.5(%rip), %rdi
LBB0_14:
	xorl	%r14d, %r14d
	movl	%r13d, %esi
	movl	%r15d, %edx
	jmp	LBB0_2
LBB0_25:
	movl	$1, (%rdx)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	4(%rax,%rcx,8), %esi
	movq	%r12, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	callq	_radeon_uvd_cs_msg
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_27
LBB0_26:
	xorl	%r14d, %r14d
	jmp	LBB0_27
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Relocs at %d after relocations chunk end %d !\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"invalid reloc offset %X!\n"

L_.str.2:                               ## @.str.2
	.asciz	"buffer (%d) to small (%d / %d)!\n"

L_.str.3:                               ## @.str.3
	.asciz	"invalid UVD command %X!\n"

L_.str.4:                               ## @.str.4
	.asciz	"reloc %LX-%LX crossing 256MB boundary!\n"

L_.str.5:                               ## @.str.5
	.asciz	"msg/fb buffer %LX-%LX out of 256MB segment!\n"

L_.str.6:                               ## @.str.6
	.asciz	"More than one message in a UVD-IB!\n"

L_.str.7:                               ## @.str.7
	.asciz	"Message needed before other commands are send!\n"

	.no_dead_strip	_radeon_uvd_cs_reloc
.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_reloc
_radeon_uvd_cs_reloc:                   ; @radeon_uvd_cs_reloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x20, x4
	mov	x19, x3
	mov	x24, x2
	mov	x23, x1
	mov	x21, x0
	ldr	x25, [x0, #32]
	bl	_radeon_get_ib_value
	mov	x22, x0
	mov	x0, x21
	mov	x1, x24
	bl	_radeon_get_ib_value
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	w8, [x25]
	cmp	w0, w8
	b.hs	LBB0_5
; %bb.1:
	ldr	x8, [x21, #24]
	lsr	w9, w0, #2
	lsl	x9, x9, #3
	add	x24, x8, x9
	ldr	w25, [x8, x9]
	ldr	w0, [x24, #4]!
	bl	_radeon_bo_size
	add	w26, w0, w25
	add	w25, w25, w22
	ldr	x8, [x21, #16]
	str	w25, [x8, w23, sxtw #2]
	ldr	w1, [x21]
	mov	x0, x21
	bl	_radeon_get_ib_value
	asr	w8, w0, #1
	cmp	w0, #7
	b.hi	LBB0_8
; %bb.2:
	subs	w9, w26, w25
	b.ls	LBB0_16
; %bb.3:
	ldr	w10, [x19, w8, uxtw #2]
	cmp	w9, w10
	b.hs	LBB0_9
; %bb.4:
	stp	x9, x10, [sp, #8]
	str	x8, [sp]
Lloh0:
	adrp	x0, l_.str.2@PAGE
Lloh1:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_6
LBB0_5:
	stp	x0, x8, [sp]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
LBB0_6:
	bl	_DRM_ERROR
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_8:
	cmp	w8, #256
	b.ne	LBB0_17
LBB0_9:
	lsr	w9, w25, #28
	sub	w10, w26, #1
	cmp	w9, w10, lsr #28
	b.ne	LBB0_18
; %bb.10:
	cmp	w0, #2
	b.lo	LBB0_12
; %bb.11:
	cmp	w8, #3
	b.ne	LBB0_13
LBB0_12:
	ldr	x8, [x21, #8]
	ldr	w8, [x8]
	cmp	w9, w8, asr #28
	b.ne	LBB0_21
LBB0_13:
	ldr	w8, [x20]
	cmp	w0, #1
	b.hi	LBB0_19
; %bb.14:
	cbz	w8, LBB0_22
; %bb.15:
Lloh7:
	adrp	x0, l_.str.6@PAGE
Lloh8:
	add	x0, x0, l_.str.6@PAGEOFF
	b	LBB0_6
LBB0_16:
	str	x22, [sp]
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_17:
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
	str	x8, [sp]
Lloh11:
	adrp	x0, l_.str.3@PAGE
Lloh12:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_6
LBB0_18:
	stp	x25, x26, [sp]
Lloh13:
	adrp	x0, l_.str.4@PAGE
Lloh14:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_6
LBB0_19:
	cbnz	w8, LBB0_23
; %bb.20:
Lloh15:
	adrp	x0, l_.str.7@PAGE
Lloh16:
	add	x0, x0, l_.str.7@PAGEOFF
	b	LBB0_6
LBB0_21:
                                        ; kill: def $w26 killed $w26 killed $x26 def $x26
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	stp	x25, x26, [sp]
Lloh17:
	adrp	x0, l_.str.5@PAGE
Lloh18:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_6
LBB0_22:
	mov	w8, #1
	str	w8, [x20]
	ldr	w1, [x24]
	mov	x0, x21
	mov	x2, x22
	mov	x3, x19
	bl	_radeon_uvd_cs_msg
	cbnz	w0, LBB0_7
LBB0_23:
	mov	w0, #0
	b	LBB0_7
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Relocs at %d after relocations chunk end %d !\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"invalid reloc offset %X!\n"

l_.str.2:                               ; @.str.2
	.asciz	"buffer (%d) to small (%d / %d)!\n"

l_.str.3:                               ; @.str.3
	.asciz	"invalid UVD command %X!\n"

l_.str.4:                               ; @.str.4
	.asciz	"reloc %LX-%LX crossing 256MB boundary!\n"

l_.str.5:                               ; @.str.5
	.asciz	"msg/fb buffer %LX-%LX out of 256MB segment!\n"

l_.str.6:                               ; @.str.6
	.asciz	"More than one message in a UVD-IB!\n"

l_.str.7:                               ; @.str.7
	.asciz	"Message needed before other commands are send!\n"

	.no_dead_strip	_radeon_uvd_cs_reloc
.subsections_via_symbols
