	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_r600_semaphore_ring_emit       ## -- Begin function r600_semaphore_ring_emit
	.p2align	4, 0x90
_r600_semaphore_ring_emit:              ## @r600_semaphore_ring_emit
	.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
	movl	%ecx, %r15d
	movq	%rsi, %r12
	movq	%rdi, %r14
	testl	%ecx, %ecx
	jne	LBB0_1
## %bb.2:
	movq	_PACKET3_SEM_SEL_SIGNAL@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_PACKET3_SEM_SEL_WAIT@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rdx), %r13d
	movq	(%r14), %rcx
	movq	_CHIP_CAYMAN@GOTPCREL(%rip), %rdx
	xorl	%ebx, %ebx
	cmpq	(%rdx), %rcx
	jge	LBB0_5
## %bb.4:
	movq	_PACKET3_SEM_WAIT_ON_SIGNAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
LBB0_5:
	orl	(%rax), %ebx
	movq	_PACKET3_MEM_SEMAPHORE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %esi
	callq	_PACKET3
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_radeon_ring_write
	movl	%r13d, %edi
	callq	_lower_32_bits
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_radeon_ring_write
	movl	%r13d, %edi
	callq	_upper_32_bits
	movzbl	%al, %esi
	orl	%ebx, %esi
	movq	%r12, %rdi
	callq	_radeon_ring_write
	testl	%r15d, %r15d
	je	LBB0_8
## %bb.6:
	movq	(%r14), %rax
	movq	_CHIP_CEDAR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_8
## %bb.7:
	movq	_PACKET3_PFP_SYNC_ME@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_PACKET3
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_radeon_ring_write
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_radeon_ring_write
LBB0_8:
	movl	$1, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PACKET3_SEM_SEL_WAIT,4,2       ## @PACKET3_SEM_SEL_WAIT
	.comm	_PACKET3_SEM_SEL_SIGNAL,4,2     ## @PACKET3_SEM_SEL_SIGNAL
	.comm	_CHIP_CAYMAN,8,3                ## @CHIP_CAYMAN
	.comm	_PACKET3_SEM_WAIT_ON_SIGNAL,4,2 ## @PACKET3_SEM_WAIT_ON_SIGNAL
	.comm	_PACKET3_MEM_SEMAPHORE,4,2      ## @PACKET3_MEM_SEMAPHORE
	.comm	_CHIP_CEDAR,8,3                 ## @CHIP_CEDAR
	.comm	_PACKET3_PFP_SYNC_ME,4,2        ## @PACKET3_PFP_SYNC_ME
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_r600_semaphore_ring_emit       ; -- Begin function r600_semaphore_ring_emit
	.p2align	2
_r600_semaphore_ring_emit:              ; @r600_semaphore_ring_emit
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x3
	mov	x19, x1
	mov	x20, x0
	ldr	w22, [x2]
Lloh0:
	adrp	x8, _PACKET3_SEM_SEL_WAIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PACKET3_SEM_SEL_WAIT@GOTPAGEOFF]
Lloh2:
	adrp	x9, _PACKET3_SEM_SEL_SIGNAL@GOTPAGE
Lloh3:
	ldr	x9, [x9, _PACKET3_SEM_SEL_SIGNAL@GOTPAGEOFF]
	cmp	w3, #0
	csel	x8, x9, x8, eq
	ldr	w8, [x8]
	ldr	x9, [x0]
Lloh4:
	adrp	x10, _CHIP_CAYMAN@GOTPAGE
Lloh5:
	ldr	x10, [x10, _CHIP_CAYMAN@GOTPAGEOFF]
Lloh6:
	ldr	x10, [x10]
Lloh7:
	adrp	x11, _PACKET3_SEM_WAIT_ON_SIGNAL@GOTPAGE
Lloh8:
	ldr	x11, [x11, _PACKET3_SEM_WAIT_ON_SIGNAL@GOTPAGEOFF]
Lloh9:
	ldr	w11, [x11]
	cmp	x9, x10
	csel	w9, w11, wzr, lt
	orr	w23, w9, w8
Lloh10:
	adrp	x8, _PACKET3_MEM_SEMAPHORE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PACKET3_MEM_SEMAPHORE@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	mov	w1, #1
	bl	_PACKET3
	mov	x1, x0
	mov	x0, x19
	bl	_radeon_ring_write
	mov	x0, x22
	bl	_lower_32_bits
	mov	x1, x0
	mov	x0, x19
	bl	_radeon_ring_write
	mov	x0, x22
	bl	_upper_32_bits
	and	w8, w0, #0xff
	orr	w1, w23, w8
	mov	x0, x19
	bl	_radeon_ring_write
	cbz	w21, LBB0_3
; %bb.1:
	ldr	x8, [x20]
Lloh13:
	adrp	x9, _CHIP_CEDAR@GOTPAGE
Lloh14:
	ldr	x9, [x9, _CHIP_CEDAR@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lt	LBB0_3
; %bb.2:
Lloh16:
	adrp	x8, _PACKET3_PFP_SYNC_ME@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PACKET3_PFP_SYNC_ME@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	mov	w1, #0
	bl	_PACKET3
	mov	x1, x0
	mov	x0, x19
	bl	_radeon_ring_write
	mov	x0, x19
	mov	w1, #0
	bl	_radeon_ring_write
LBB0_3:
	mov	w0, #1
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_PACKET3_SEM_SEL_WAIT,4,2       ; @PACKET3_SEM_SEL_WAIT
	.comm	_PACKET3_SEM_SEL_SIGNAL,4,2     ; @PACKET3_SEM_SEL_SIGNAL
	.comm	_CHIP_CAYMAN,8,3                ; @CHIP_CAYMAN
	.comm	_PACKET3_SEM_WAIT_ON_SIGNAL,4,2 ; @PACKET3_SEM_WAIT_ON_SIGNAL
	.comm	_PACKET3_MEM_SEMAPHORE,4,2      ; @PACKET3_MEM_SEMAPHORE
	.comm	_CHIP_CEDAR,8,3                 ; @CHIP_CEDAR
	.comm	_PACKET3_PFP_SYNC_ME,4,2        ; @PACKET3_PFP_SYNC_ME
.subsections_via_symbols
