	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_test_create_and_emit_fence
_radeon_test_create_and_emit_fence:     ## @radeon_test_create_and_emit_fence
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %r13
	movq	%rdi, %r14
	movl	(%rsi), %esi
	movl	%esi, %ebx
	xorl	$-558907665, %ebx               ## imm = 0xDEAFBEEF
	movq	_R600_RING_TYPE_UVD_INDEX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	jne	LBB0_6
## %bb.1:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	movl	%ebx, %edx
	xorl	%ecx, %ecx
	callq	_radeon_uvd_get_create_msg
	testl	%eax, %eax
	jne	LBB0_2
## %bb.3:
	movl	(%r13), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	callq	_radeon_uvd_get_destroy_msg
	testl	%eax, %eax
	jne	LBB0_5
	jmp	LBB0_15
LBB0_6:
	movq	_TN_RING_TYPE_VCE1_INDEX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	je	LBB0_8
## %bb.7:
	movq	_TN_RING_TYPE_VCE2_INDEX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	je	LBB0_8
## %bb.10:
	movq	%r14, %rdi
	movq	%r13, %rsi
	movl	$64, %edx
	callq	_radeon_ring_lock
	movl	(%r13), %edx
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movl	%eax, %r15d
	leaq	L_.str.2(%rip), %rdi
	movl	%edx, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_15
LBB0_8:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	movl	%ebx, %edx
	xorl	%ecx, %ecx
	callq	_radeon_vce_get_create_msg
	testl	%eax, %eax
	je	LBB0_9
LBB0_2:
	movl	%eax, %r12d
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movl	%r12d, %r15d
	jmp	LBB0_15
LBB0_12:
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_radeon_fence_emit
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	movl	%eax, %r15d
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_radeon_ring_unlock_undo
	jmp	LBB0_15
LBB0_9:
	movl	(%r13), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	callq	_radeon_vce_get_destroy_msg
	testl	%eax, %eax
	je	LBB0_15
LBB0_5:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movl	%ebx, %r15d
LBB0_15:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	movq	%r13, %rsi
	xorl	%edx, %edx
	callq	_radeon_ring_unlock_commit
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_R600_RING_TYPE_UVD_INDEX,4,2   ## @R600_RING_TYPE_UVD_INDEX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to get dummy create msg\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to get dummy destroy msg\n"

	.comm	_TN_RING_TYPE_VCE1_INDEX,4,2    ## @TN_RING_TYPE_VCE1_INDEX
	.comm	_TN_RING_TYPE_VCE2_INDEX,4,2    ## @TN_RING_TYPE_VCE2_INDEX
L_.str.2:                               ## @.str.2
	.asciz	"Failed to lock ring A %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"Failed to emit fence\n"

	.no_dead_strip	_radeon_test_create_and_emit_fence
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radeon_test_create_and_emit_fence
_radeon_test_create_and_emit_fence:     ; @radeon_test_create_and_emit_fence
	.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
	mov	x22, x2
	mov	x21, x1
	mov	x20, x0
	ldr	w1, [x1]
	mov	w8, #48879
	movk	w8, #57007, lsl #16
	eor	w23, w1, w8
Lloh0:
	adrp	x8, _R600_RING_TYPE_UVD_INDEX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _R600_RING_TYPE_UVD_INDEX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w1, w8
	b.ne	LBB0_3
; %bb.1:
	mov	x0, x20
	mov	x2, x23
	mov	x3, #0
	bl	_radeon_uvd_get_create_msg
	cbnz	w0, LBB0_5
; %bb.2:
	ldr	w1, [x21]
	mov	x0, x20
	mov	x2, x23
	mov	x3, x22
	bl	_radeon_uvd_get_destroy_msg
	mov	x19, x0
	cbnz	w0, LBB0_9
	b	LBB0_13
LBB0_3:
Lloh3:
	adrp	x8, _TN_RING_TYPE_VCE1_INDEX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TN_RING_TYPE_VCE1_INDEX@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _TN_RING_TYPE_VCE2_INDEX@GOTPAGE
Lloh7:
	ldr	x9, [x9, _TN_RING_TYPE_VCE2_INDEX@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w1, w8
	mov	x0, x20
	ccmp	w1, w9, #4, ne
	b.ne	LBB0_6
; %bb.4:
	mov	x2, x23
	mov	x3, #0
	bl	_radeon_vce_get_create_msg
	cbz	w0, LBB0_8
LBB0_5:
	mov	x19, x0
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_13
LBB0_6:
	mov	x1, x21
	mov	w2, #64
	bl	_radeon_ring_lock
	ldr	w2, [x21]
	cbz	w0, LBB0_10
; %bb.7:
	mov	x19, x0
	str	x2, [sp]
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_13
LBB0_8:
	ldr	w1, [x21]
	mov	x0, x20
	mov	x2, x23
	mov	x3, x22
	bl	_radeon_vce_get_destroy_msg
	mov	x19, x0
	cbz	w0, LBB0_13
LBB0_9:
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_13
LBB0_10:
	mov	x0, x20
	mov	x1, x22
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_radeon_fence_emit
	mov	x19, x0
	cbz	w0, LBB0_12
; %bb.11:
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_ERROR
	mov	x0, x20
	mov	x1, x21
	bl	_radeon_ring_unlock_undo
	b	LBB0_13
LBB0_12:
	mov	x0, x20
	mov	x1, x21
	mov	w2, #0
	bl	_radeon_ring_unlock_commit
LBB0_13:
	mov	x0, x19
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_R600_RING_TYPE_UVD_INDEX,4,2   ; @R600_RING_TYPE_UVD_INDEX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to get dummy create msg\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to get dummy destroy msg\n"

	.comm	_TN_RING_TYPE_VCE1_INDEX,4,2    ; @TN_RING_TYPE_VCE1_INDEX
	.comm	_TN_RING_TYPE_VCE2_INDEX,4,2    ; @TN_RING_TYPE_VCE2_INDEX
l_.str.2:                               ; @.str.2
	.asciz	"Failed to lock ring A %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"Failed to emit fence\n"

	.no_dead_strip	_radeon_test_create_and_emit_fence
.subsections_via_symbols
