	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_uvd_v1_0_ib_test               ## -- Begin function uvd_v1_0_ib_test
	.p2align	4, 0x90
_uvd_v1_0_ib_test:                      ## @uvd_v1_0_ib_test
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	$0, -32(%rbp)
	movq	(%rdi), %rax
	movq	_CHIP_RV740@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	movl	$10000, %esi                    ## imm = 0x2710
	movl	$10000, %edx                    ## imm = 0x2710
	jmp	LBB0_3
LBB0_2:
	movq	%r14, %rdi
	movl	$53300, %esi                    ## imm = 0xD034
	movl	$40000, %edx                    ## imm = 0x9C40
LBB0_3:
	callq	_radeon_set_uvd_clocks
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_16
LBB0_5:
	movl	(%r15), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_radeon_uvd_get_create_msg
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_7
LBB0_8:
	movl	(%r15), %esi
	leaq	-32(%rbp), %rcx
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_radeon_uvd_get_destroy_msg
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rdi
LBB0_7:
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_15:
	leaq	-32(%rbp), %rdi
	callq	_radeon_fence_unref
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_radeon_set_uvd_clocks
LBB0_16:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	-32(%rbp), %rbx
	movq	_RADEON_USEC_IB_TEST_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_usecs_to_jiffies
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	%eax, %edx
	callq	_radeon_fence_wait_timeout
	testl	%eax, %eax
	js	LBB0_11
## %bb.12:
	je	LBB0_13
## %bb.14:
	movl	(%r15), %esi
	leaq	L_.str.5(%rip), %rdi
	callq	_DRM_INFO
	xorl	%ebx, %ebx
	jmp	LBB0_15
LBB0_11:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_7
LBB0_13:
	leaq	L_.str.4(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_CHIP_RV740,8,3                 ## @CHIP_RV740
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"radeon: failed to raise UVD clocks (%d).\n"

L_.str.1:                               ## @.str.1
	.asciz	"radeon: failed to get create msg (%d).\n"

L_.str.2:                               ## @.str.2
	.asciz	"radeon: failed to get destroy ib (%d).\n"

	.comm	_RADEON_USEC_IB_TEST_TIMEOUT,4,2 ## @RADEON_USEC_IB_TEST_TIMEOUT
L_.str.3:                               ## @.str.3
	.asciz	"radeon: fence wait failed (%d).\n"

L_.str.4:                               ## @.str.4
	.asciz	"radeon: fence wait timed out.\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
L_.str.5:                               ## @.str.5
	.asciz	"ib test on ring %d succeeded\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_uvd_v1_0_ib_test               ; -- Begin function uvd_v1_0_ib_test
	.p2align	2
_uvd_v1_0_ib_test:                      ; @uvd_v1_0_ib_test
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x1
	mov	x19, x0
	str	xzr, [sp, #8]
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _CHIP_RV740@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CHIP_RV740@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_2
; %bb.1:
	mov	w1, #10000
	mov	w2, #10000
	b	LBB0_3
LBB0_2:
	mov	w1, #53300
	mov	w2, #40000
LBB0_3:
	bl	_radeon_set_uvd_clocks
	mov	x21, x0
	cbz	w0, LBB0_5
; %bb.4:
	str	x21, [sp]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_11
LBB0_5:
	ldr	w1, [x20]
	mov	x0, x19
	mov	w2, #1
	mov	x3, #0
	bl	_radeon_uvd_get_create_msg
	cbz	w0, LBB0_7
; %bb.6:
	mov	x21, x0
	str	x21, [sp]
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_9
LBB0_7:
	ldr	w1, [x20]
	add	x3, sp, #8
	mov	x0, x19
	mov	w2, #1
	bl	_radeon_uvd_get_destroy_msg
	cbz	w0, LBB0_12
; %bb.8:
	mov	x21, x0
	str	x21, [sp]
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_9:
	bl	_DRM_ERROR
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
LBB0_10:
	add	x0, sp, #8
	bl	_radeon_fence_unref
	mov	x0, x19
	mov	w1, #0
	mov	w2, #0
	bl	_radeon_set_uvd_clocks
LBB0_11:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_12:
	ldr	x21, [sp, #8]
Lloh9:
	adrp	x8, _RADEON_USEC_IB_TEST_TIMEOUT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RADEON_USEC_IB_TEST_TIMEOUT@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	bl	_usecs_to_jiffies
	mov	x2, x0
	mov	x0, x21
	mov	w1, #0
	bl	_radeon_fence_wait_timeout
	mov	x21, x0
	tbnz	w0, #31, LBB0_15
; %bb.13:
	cbz	w21, LBB0_16
; %bb.14:
	ldr	w1, [x20]
Lloh12:
	adrp	x0, l_.str.5@PAGE
Lloh13:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_DRM_INFO
	mov	w21, #0
	b	LBB0_10
LBB0_15:
	mov	x8, x21
	str	x8, [sp]
Lloh14:
	adrp	x0, l_.str.3@PAGE
Lloh15:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_10
LBB0_16:
Lloh16:
	adrp	x0, l_.str.4@PAGE
Lloh17:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DRM_ERROR
Lloh18:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_CHIP_RV740,8,3                 ; @CHIP_RV740
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"radeon: failed to raise UVD clocks (%d).\n"

l_.str.1:                               ; @.str.1
	.asciz	"radeon: failed to get create msg (%d).\n"

l_.str.2:                               ; @.str.2
	.asciz	"radeon: failed to get destroy ib (%d).\n"

	.comm	_RADEON_USEC_IB_TEST_TIMEOUT,4,2 ; @RADEON_USEC_IB_TEST_TIMEOUT
l_.str.3:                               ; @.str.3
	.asciz	"radeon: fence wait failed (%d).\n"

l_.str.4:                               ; @.str.4
	.asciz	"radeon: fence wait timed out.\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
l_.str.5:                               ; @.str.5
	.asciz	"ib test on ring %d succeeded\n"

.subsections_via_symbols
