	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_test_ring_sync2
_radeon_test_ring_sync2:                ## @radeon_test_ring_sync2
	.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
	movq	%rcx, %r14
	movq	%rdx, %r12
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	$0, -64(%rbp)
	movq	$0, -56(%rbp)
	movq	$0, -48(%rbp)
	leaq	-48(%rbp), %rsi
	callq	_radeon_semaphore_create
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r13d
	leaq	L_.str(%rip), %rdi
LBB0_12:
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_32
LBB0_2:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	$64, %edx
	callq	_radeon_ring_lock
	movl	(%rbx), %esi
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	movl	%eax, %r13d
	leaq	L_.str.1(%rip), %rdi
LBB0_4:
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_32
LBB0_5:
	movq	-48(%rbp), %rdx
	movq	%r15, %rdi
	callq	_radeon_semaphore_emit_wait
	movq	%r15, %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	callq	_radeon_ring_unlock_commit
	leaq	-64(%rbp), %rdx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_radeon_test_create_and_emit_fence
	movl	%eax, %r13d
	testl	%eax, %eax
	je	LBB0_6
LBB0_32:
	leaq	-48(%rbp), %rsi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_radeon_semaphore_free
	cmpq	$0, -64(%rbp)
	je	LBB0_34
## %bb.33:
	leaq	-64(%rbp), %rdi
	callq	_radeon_fence_unref
LBB0_34:
	cmpq	$0, -56(%rbp)
	je	LBB0_36
## %bb.35:
	leaq	-56(%rbp), %rdi
	callq	_radeon_fence_unref
LBB0_36:
	testl	%r13d, %r13d
	je	LBB0_38
## %bb.37:
	leaq	L_.str.11(%rip), %rdi
	movl	%r13d, %esi
	callq	_pr_warn
LBB0_38:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	$64, %edx
	callq	_radeon_ring_lock
	movl	(%r12), %esi
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %r13d
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_4
LBB0_8:
	movq	-48(%rbp), %rdx
	movq	%r15, %rdi
	callq	_radeon_semaphore_emit_wait
	movq	%r15, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_radeon_ring_unlock_commit
	leaq	-56(%rbp), %rdx
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_radeon_test_create_and_emit_fence
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_32
## %bb.9:
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_msleep
	movq	-64(%rbp), %rdi
	callq	_radeon_fence_signaled
	testl	%eax, %eax
	je	LBB0_13
## %bb.10:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_11
LBB0_13:
	movq	-56(%rbp), %rdi
	callq	_radeon_fence_signaled
	testl	%eax, %eax
	je	LBB0_15
## %bb.14:
	leaq	L_.str.4(%rip), %rdi
LBB0_11:
	xorl	%r13d, %r13d
	jmp	LBB0_12
LBB0_15:
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	$64, %edx
	callq	_radeon_ring_lock
	testl	%eax, %eax
	je	LBB0_19
LBB0_16:
	movl	%eax, %r13d
	leaq	L_.str.5(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_32
LBB0_19:
	movl	(%r14), %esi
	movq	-48(%rbp), %rdx
	movq	%r15, %rdi
	callq	_radeon_semaphore_emit_signal
	movq	%r15, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_radeon_ring_unlock_commit
	movl	$30, %ebx
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movl	$100, %edi
	callq	_msleep
	movq	-64(%rbp), %rdi
	callq	_radeon_fence_signaled
	movl	%eax, %r12d
	movq	-56(%rbp), %rdi
	callq	_radeon_fence_signaled
	movl	%r12d, %ecx
	orl	%eax, %ecx
	jne	LBB0_21
## %bb.17:                              ##   in Loop: Header=BB0_20 Depth=1
	decl	%ebx
	jne	LBB0_20
## %bb.18:
	xorl	%r12d, %r12d
	xorl	%eax, %eax
LBB0_21:
	movl	%r12d, %ecx
	orl	%eax, %ecx
	je	LBB0_22
## %bb.23:
	testl	%r12d, %r12d
	je	LBB0_26
## %bb.24:
	testl	%eax, %eax
	je	LBB0_26
## %bb.25:
	leaq	L_.str.7(%rip), %rdi
	jmp	LBB0_11
LBB0_22:
	leaq	L_.str.6(%rip), %rdi
	jmp	LBB0_11
LBB0_26:
	xorl	%esi, %esi
	cmpl	$1, %r12d
	adcl	$65, %esi
	leaq	L_.str.8(%rip), %rdi
	callq	_DRM_INFO
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	$64, %edx
	callq	_radeon_ring_lock
	testl	%eax, %eax
	jne	LBB0_16
## %bb.27:
	movl	(%r14), %esi
	movq	-48(%rbp), %rdx
	movq	%r15, %rdi
	callq	_radeon_semaphore_emit_signal
	xorl	%r13d, %r13d
	movq	%r15, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_radeon_ring_unlock_commit
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_msleep
	movq	-64(%rbp), %rdi
	xorl	%esi, %esi
	callq	_radeon_fence_wait
	testl	%eax, %eax
	je	LBB0_29
## %bb.28:
	movl	%eax, %ebx
	leaq	L_.str.9(%rip), %rdi
	jmp	LBB0_31
LBB0_29:
	movq	-56(%rbp), %rdi
	xorl	%esi, %esi
	callq	_radeon_fence_wait
	testl	%eax, %eax
	je	LBB0_32
## %bb.30:
	movl	%eax, %ebx
	leaq	L_.str.10(%rip), %rdi
LBB0_31:
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movl	%ebx, %r13d
	jmp	LBB0_32
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to create semaphore\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to lock ring A %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to lock ring B %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"Fence A signaled without waiting for semaphore.\n"

L_.str.4:                               ## @.str.4
	.asciz	"Fence B signaled without waiting for semaphore.\n"

L_.str.5:                               ## @.str.5
	.asciz	"Failed to lock ring B %p\n"

L_.str.6:                               ## @.str.6
	.asciz	"Neither fence A nor B has been signaled\n"

L_.str.7:                               ## @.str.7
	.asciz	"Both fence A and B has been signaled\n"

L_.str.8:                               ## @.str.8
	.asciz	"Fence %c was first signaled\n"

L_.str.9:                               ## @.str.9
	.asciz	"Failed to wait for sync fence A\n"

L_.str.10:                              ## @.str.10
	.asciz	"Failed to wait for sync fence B\n"

L_.str.11:                              ## @.str.11
	.asciz	"Error while testing ring sync (%d)\n"

	.no_dead_strip	_radeon_test_ring_sync2
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radeon_test_ring_sync2
_radeon_test_ring_sync2:                ; @radeon_test_ring_sync2
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x20, x3
	mov	x22, x2
	mov	x23, x1
	mov	x19, x0
	stp	xzr, xzr, [sp, #16]
	str	xzr, [sp, #8]
	add	x1, sp, #8
	bl	_radeon_semaphore_create
	cbz	w0, LBB0_2
; %bb.1:
	mov	x21, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:
	mov	x0, x19
	mov	x1, x23
	mov	w2, #64
	bl	_radeon_ring_lock
	ldr	w1, [x23]
	cbz	w0, LBB0_12
; %bb.3:
	mov	x21, x0
	str	x1, [sp]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_4:
	bl	_DRM_ERROR
LBB0_5:
	add	x1, sp, #8
	mov	x0, x19
	mov	x2, #0
	bl	_radeon_semaphore_free
	ldr	x8, [sp, #24]
	cbz	x8, LBB0_7
; %bb.6:
	add	x0, sp, #24
	bl	_radeon_fence_unref
LBB0_7:
	ldr	x8, [sp, #16]
	cbz	x8, LBB0_9
; %bb.8:
	add	x0, sp, #16
	bl	_radeon_fence_unref
LBB0_9:
	cbz	w21, LBB0_11
; %bb.10:
Lloh4:
	adrp	x0, l_.str.11@PAGE
Lloh5:
	add	x0, x0, l_.str.11@PAGEOFF
	mov	x1, x21
	bl	_pr_warn
LBB0_11:
	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
	add	sp, sp, #96
	ret
LBB0_12:
	ldr	x2, [sp, #8]
	mov	x0, x19
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_radeon_semaphore_emit_wait
	mov	x0, x19
	mov	x1, x23
	mov	w2, #0
	bl	_radeon_ring_unlock_commit
	add	x2, sp, #24
	mov	x0, x19
	mov	x1, x23
	bl	_radeon_test_create_and_emit_fence
	mov	x21, x0
	cbnz	w0, LBB0_5
; %bb.13:
	mov	x0, x19
	mov	x1, x22
	mov	w2, #64
	bl	_radeon_ring_lock
	ldr	w1, [x22]
	cbz	w0, LBB0_15
; %bb.14:
	mov	x21, x0
	str	x1, [sp]
Lloh6:
	adrp	x0, l_.str.2@PAGE
Lloh7:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_4
LBB0_15:
	ldr	x2, [sp, #8]
	mov	x0, x19
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_radeon_semaphore_emit_wait
	mov	x0, x19
	mov	x1, x22
	mov	w2, #0
	bl	_radeon_ring_unlock_commit
	add	x2, sp, #16
	mov	x0, x19
	mov	x1, x22
	bl	_radeon_test_create_and_emit_fence
	mov	x21, x0
	cbnz	w0, LBB0_5
; %bb.16:
	mov	w0, #1000
	bl	_msleep
	ldr	x0, [sp, #24]
	bl	_radeon_fence_signaled
	cbz	w0, LBB0_18
; %bb.17:
Lloh8:
	adrp	x0, l_.str.3@PAGE
Lloh9:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_20
LBB0_18:
	ldr	x0, [sp, #16]
	bl	_radeon_fence_signaled
	cbz	w0, LBB0_21
; %bb.19:
Lloh10:
	adrp	x0, l_.str.4@PAGE
Lloh11:
	add	x0, x0, l_.str.4@PAGEOFF
LBB0_20:
	bl	_DRM_ERROR
	mov	w21, #0
	b	LBB0_5
LBB0_21:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #64
	bl	_radeon_ring_lock
	cbz	w0, LBB0_23
LBB0_22:
	mov	x21, x0
	str	x20, [sp]
Lloh12:
	adrp	x0, l_.str.5@PAGE
Lloh13:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_4
LBB0_23:
	ldr	w1, [x20]
	ldr	x2, [sp, #8]
	mov	x0, x19
	bl	_radeon_semaphore_emit_signal
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	bl	_radeon_ring_unlock_commit
	mov	w22, #30
LBB0_24:                                ; =>This Inner Loop Header: Depth=1
	mov	w0, #100
	bl	_msleep
	ldr	x0, [sp, #24]
	bl	_radeon_fence_signaled
	mov	x21, x0
	ldr	x0, [sp, #16]
	bl	_radeon_fence_signaled
	orr	w8, w21, w0
	cbnz	w8, LBB0_27
; %bb.25:                               ;   in Loop: Header=BB0_24 Depth=1
	subs	w22, w22, #1
	b.ne	LBB0_24
; %bb.26:
	mov	w21, #0
	mov	w0, #0
LBB0_27:
	orr	w8, w21, w0
	cbz	w8, LBB0_31
; %bb.28:
	cbz	w21, LBB0_32
; %bb.29:
	cbz	w0, LBB0_32
; %bb.30:
Lloh14:
	adrp	x0, l_.str.7@PAGE
Lloh15:
	add	x0, x0, l_.str.7@PAGEOFF
	b	LBB0_20
LBB0_31:
Lloh16:
	adrp	x0, l_.str.6@PAGE
Lloh17:
	add	x0, x0, l_.str.6@PAGEOFF
	b	LBB0_20
LBB0_32:
	cmp	w21, #0
	mov	w8, #65
	cinc	w1, w8, eq
Lloh18:
	adrp	x0, l_.str.8@PAGE
Lloh19:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_DRM_INFO
	mov	x0, x19
	mov	x1, x20
	mov	w2, #64
	bl	_radeon_ring_lock
	cbnz	w0, LBB0_22
; %bb.33:
	ldr	w1, [x20]
	ldr	x2, [sp, #8]
	mov	x0, x19
	bl	_radeon_semaphore_emit_signal
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	bl	_radeon_ring_unlock_commit
	mov	w0, #1000
	bl	_msleep
	ldr	x0, [sp, #24]
	mov	w1, #0
	bl	_radeon_fence_wait
	cbz	w0, LBB0_35
; %bb.34:
	mov	x21, x0
Lloh20:
	adrp	x0, l_.str.9@PAGE
Lloh21:
	add	x0, x0, l_.str.9@PAGEOFF
	b	LBB0_4
LBB0_35:
	ldr	x0, [sp, #16]
	mov	w1, #0
	bl	_radeon_fence_wait
	mov	x21, x0
	cbz	w0, LBB0_5
; %bb.36:
Lloh22:
	adrp	x0, l_.str.10@PAGE
Lloh23:
	add	x0, x0, l_.str.10@PAGEOFF
	b	LBB0_4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to create semaphore\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to lock ring A %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to lock ring B %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"Fence A signaled without waiting for semaphore.\n"

l_.str.4:                               ; @.str.4
	.asciz	"Fence B signaled without waiting for semaphore.\n"

l_.str.5:                               ; @.str.5
	.asciz	"Failed to lock ring B %p\n"

l_.str.6:                               ; @.str.6
	.asciz	"Neither fence A nor B has been signaled\n"

l_.str.7:                               ; @.str.7
	.asciz	"Both fence A and B has been signaled\n"

l_.str.8:                               ; @.str.8
	.asciz	"Fence %c was first signaled\n"

l_.str.9:                               ; @.str.9
	.asciz	"Failed to wait for sync fence A\n"

l_.str.10:                              ; @.str.10
	.asciz	"Failed to wait for sync fence B\n"

l_.str.11:                              ; @.str.11
	.asciz	"Error while testing ring sync (%d)\n"

	.no_dead_strip	_radeon_test_ring_sync2
.subsections_via_symbols
