	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %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), %r15d
	movq	(%rdi), %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	%r14, %rdi
	movl	%eax, %esi
	callq	_radeon_ring_write
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_radeon_ring_write
	movl	%r15d, %edi
	callq	_upper_32_bits
	movzbl	%al, %esi
	orl	%ebx, %esi
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_radeon_ring_write              ## TAILCALL
	.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
.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	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x19, x1
	ldr	w20, [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	w21, 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, x19
	mov	x1, x20
	bl	_radeon_ring_write
	mov	x0, x20
	bl	_upper_32_bits
	and	w8, w0, #0xff
	orr	w1, w21, w8
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_radeon_ring_write
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.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
.subsections_via_symbols
