	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_sync_rings              ## -- Begin function radeon_sync_rings
	.p2align	4, 0x90
_radeon_sync_rings:                     ## @radeon_sync_rings
	.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	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	_RADEON_NUM_RINGS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_15
## %bb.1:
	movq	%rdi, %r13
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	jmp	LBB0_6
LBB0_2:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	(%r13), %rdi
	addq	%r14, %rdi
LBB0_3:                                 ##   in Loop: Header=BB0_6 Depth=1
	callq	_radeon_ring_undo
LBB0_4:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_radeon_fence_wait
	testl	%eax, %eax
	jne	LBB0_17
LBB0_5:                                 ##   in Loop: Header=BB0_6 Depth=1
	incq	%rbx
	movq	_RADEON_NUM_RINGS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$4, %r14
	cmpq	%rax, %rbx
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	jge	LBB0_15
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movq	(%rax,%r14,2), %r12
	movq	%r12, %rdi
	movl	%edx, %esi
	callq	_radeon_fence_need_sync
	testl	%eax, %eax
	je	LBB0_5
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	(%r13), %rax
	cmpl	$0, (%rax,%r14)
	je	LBB0_16
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	_RADEON_NUM_SYNCS@GOTPCREL(%rip), %rax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	cmpl	(%rax), %ecx
	jae	LBB0_4
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%r13, %rdi
	leaq	-56(%rbp), %rsi
	callq	_radeon_semaphore_create
	testl	%eax, %eax
	jne	LBB0_17
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	-56(%rbp), %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %edx
	movq	%rax, (%rcx,%rdx,8)
	movq	(%r13), %rsi
	addq	%r14, %rsi
	movq	%r13, %rdi
	movl	$16, %edx
	callq	_radeon_ring_alloc
	testl	%eax, %eax
	jne	LBB0_17
## %bb.11:                              ##   in Loop: Header=BB0_6 Depth=1
	incl	%r15d
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	-56(%rbp), %rdx
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_radeon_semaphore_emit_signal
	testl	%eax, %eax
	je	LBB0_2
## %bb.12:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	-56(%rbp), %rdx
	movq	%r13, %rdi
	movl	-48(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %esi
	callq	_radeon_semaphore_emit_wait
	movq	(%r13), %rsi
	addq	%r14, %rsi
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_radeon_ring_commit
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_radeon_fence_note_sync
	jmp	LBB0_5
LBB0_14:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	%rsi, %rdi
	jmp	LBB0_3
LBB0_15:
	xorl	%eax, %eax
	jmp	LBB0_17
LBB0_16:
	movl	8(%r13), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_17:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RADEON_NUM_RINGS,4,2           ## @RADEON_NUM_RINGS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Syncing to a disabled ring!"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_RADEON_NUM_SYNCS,4,2           ## @RADEON_NUM_SYNCS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_sync_rings              ; -- Begin function radeon_sync_rings
	.p2align	2
_radeon_sync_rings:                     ; @radeon_sync_rings
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x24, _RADEON_NUM_RINGS@GOTPAGE
Lloh1:
	ldr	x24, [x24, _RADEON_NUM_RINGS@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.1:
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	mov	x25, #0
	mov	x26, #0
	mov	x22, #0
	mov	w27, #0
Lloh2:
	adrp	x28, _RADEON_NUM_SYNCS@GOTPAGE
Lloh3:
	ldr	x28, [x28, _RADEON_NUM_SYNCS@GOTPAGEOFF]
	b	LBB0_6
LBB0_2:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x20]
	add	x0, x8, x26
LBB0_3:                                 ;   in Loop: Header=BB0_6 Depth=1
	bl	_radeon_ring_undo
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x23
	mov	w1, #0
	bl	_radeon_fence_wait
	cbnz	w0, LBB0_17
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x22, x22, #1
	ldrsw	x8, [x24]
	add	x26, x26, #4
	add	x25, x25, #8
	cmp	x22, x8
	b.ge	LBB0_15
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #8]
	ldr	x23, [x8, x25]
	mov	x0, x23
	mov	x1, x19
	bl	_radeon_fence_need_sync
	cbz	w0, LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x20]
	ldr	w8, [x8, x26]
	cbz	w8, LBB0_16
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x28]
	cmp	w27, w8
	b.hs	LBB0_4
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x1, sp, #8
	mov	x0, x20
	bl	_radeon_semaphore_create
	cbnz	w0, LBB0_17
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [sp, #8]
	ldr	x9, [x21]
	str	x8, [x9, w27, uxtw #3]
	ldr	x8, [x20]
	add	x1, x8, x26
	mov	x0, x20
	mov	w2, #16
	bl	_radeon_ring_alloc
	cbnz	w0, LBB0_17
; %bb.11:                               ;   in Loop: Header=BB0_6 Depth=1
	add	w27, w27, #1
	ldr	x2, [sp, #8]
	mov	x0, x20
	mov	x1, x22
	bl	_radeon_semaphore_emit_signal
	cbz	w0, LBB0_2
; %bb.12:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	x2, [sp, #8]
	mov	x0, x20
	mov	x1, x19
	bl	_radeon_semaphore_emit_wait
	ldr	x8, [x20]
	add	x1, x8, x26
	cbz	w0, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x20
	mov	w2, #0
	bl	_radeon_ring_commit
	mov	x0, x23
	mov	x1, x19
	bl	_radeon_fence_note_sync
	b	LBB0_5
LBB0_14:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x1
	b	LBB0_3
LBB0_15:
	mov	w0, #0
	b	LBB0_17
LBB0_16:
	ldr	w0, [x20, #8]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_17:
	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
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_RADEON_NUM_RINGS,4,2           ; @RADEON_NUM_RINGS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Syncing to a disabled ring!"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_RADEON_NUM_SYNCS,4,2           ; @RADEON_NUM_SYNCS
.subsections_via_symbols
