	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function r600_test_writeback
_r600_test_writeback:                   ## @r600_test_writeback
	.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	%rdi, %r14
	movl	$0, (%rdi)
	movl	$1, %edi
	callq	_R600_SCRATCHOFF
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_radeon_write_ring_rptr
	movq	_R600_SCRATCH_REG1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$-559038737, %esi               ## imm = 0xDEADBEEF
	callq	_RADEON_WRITE
	movq	8(%r14), %rax
	testq	%rax, %rax
	jle	LBB0_5
## %bb.1:
	xorl	%ebx, %ebx
	movl	$3735928559, %r15d              ## imm = 0xDEADBEEF
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1, %edi
	callq	_R600_SCRATCHOFF
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_radeon_read_ring_rptr
	cmpq	%r15, %rax
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, %edi
	callq	_DRM_UDELAY
	incq	%rbx
	movq	8(%r14), %rax
	cmpq	%rax, %rbx
	jl	LBB0_2
LBB0_5:
	cmpq	%rax, %rbx
	jge	LBB0_7
LBB0_6:
	movl	$1, (%r14)
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_DRM_INFO
	jmp	LBB0_8
LBB0_3:
	movq	8(%r14), %rax
	cmpq	%rax, %rbx
	jl	LBB0_6
LBB0_7:
	movl	$0, (%r14)
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_INFO
LBB0_8:
	movq	_radeon_no_wb@GOTPCREL(%rip), %rax
	cmpl	$1, (%rax)
	jne	LBB0_10
## %bb.9:
	movl	$0, (%r14)
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_INFO
LBB0_10:
	cmpl	$0, (%r14)
	je	LBB0_12
## %bb.11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	_R600_CP_RB_CNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%ebx, %edi
	callq	_RADEON_READ
	movq	_R600_RB_NO_UPDATE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_RADEON_WRITE
	movq	_R600_SCRATCH_UMSK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_RADEON_WRITE                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_R600_SCRATCH_REG1,4,2          ## @R600_SCRATCH_REG1
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"writeback test succeeded in %d usecs\n"

L_.str.1:                               ## @.str.1
	.asciz	"writeback test failed\n"

	.comm	_radeon_no_wb,4,2               ## @radeon_no_wb
L_.str.2:                               ## @.str.2
	.asciz	"writeback forced off\n"

	.comm	_R600_CP_RB_CNTL,4,2            ## @R600_CP_RB_CNTL
	.comm	_R600_RB_NO_UPDATE,4,2          ## @R600_RB_NO_UPDATE
	.comm	_R600_SCRATCH_UMSK,4,2          ## @R600_SCRATCH_UMSK
	.comm	_R600_BUF_SWAP_32BIT,4,2        ## @R600_BUF_SWAP_32BIT
	.no_dead_strip	_r600_test_writeback
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function r600_test_writeback
_r600_test_writeback:                   ; @r600_test_writeback
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	str	wzr, [x0]
	mov	w0, #1
	bl	_R600_SCRATCHOFF
	mov	x1, x0
	mov	x0, x19
	mov	w2, #0
	bl	_radeon_write_ring_rptr
Lloh0:
	adrp	x8, _R600_SCRATCH_REG1@GOTPAGE
Lloh1:
	ldr	x8, [x8, _R600_SCRATCH_REG1@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	mov	w1, #48879
	movk	w1, #57005, lsl #16
	bl	_RADEON_WRITE
	ldr	x8, [x19, #8]
	cmp	x8, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x20, #0
	mov	w21, #48879
	movk	w21, #57005, lsl #16
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #1
	bl	_R600_SCRATCHOFF
	mov	x1, x0
	mov	x0, x19
	bl	_radeon_read_ring_rptr
	cmp	x0, x21
	b.eq	LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #1
	bl	_DRM_UDELAY
	add	x20, x20, #1
	ldr	x8, [x19, #8]
	cmp	x20, x8
	b.lt	LBB0_2
	b	LBB0_5
LBB0_4:
	mov	x20, #0
LBB0_5:
	cmp	x20, x8
	b.ge	LBB0_8
LBB0_6:
	mov	w8, #1
	str	w8, [x19]
	str	x20, [sp]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_9
LBB0_7:
	ldr	x8, [x19, #8]
	cmp	x20, x8
	b.lt	LBB0_6
LBB0_8:
	str	wzr, [x19]
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_9:
	bl	_DRM_INFO
Lloh7:
	adrp	x8, _radeon_no_wb@GOTPAGE
Lloh8:
	ldr	x8, [x8, _radeon_no_wb@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	cmp	w8, #1
	b.ne	LBB0_11
; %bb.10:
	str	wzr, [x19]
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_INFO
LBB0_11:
	ldr	w8, [x19]
	cbz	w8, LBB0_13
; %bb.12:
	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
	add	sp, sp, #64
	ret
LBB0_13:
Lloh12:
	adrp	x8, _R600_CP_RB_CNTL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _R600_CP_RB_CNTL@GOTPAGEOFF]
Lloh14:
	ldr	w19, [x8]
	mov	x0, x19
	bl	_RADEON_READ
Lloh15:
	adrp	x8, _R600_RB_NO_UPDATE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _R600_RB_NO_UPDATE@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	orr	w1, w8, w0
	mov	x0, x19
	bl	_RADEON_WRITE
Lloh18:
	adrp	x8, _R600_SCRATCH_UMSK@GOTPAGE
Lloh19:
	ldr	x8, [x8, _R600_SCRATCH_UMSK@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	mov	w1, #0
	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
	add	sp, sp, #64
	b	_RADEON_WRITE
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_R600_SCRATCH_REG1,4,2          ; @R600_SCRATCH_REG1
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"writeback test succeeded in %d usecs\n"

l_.str.1:                               ; @.str.1
	.asciz	"writeback test failed\n"

	.comm	_radeon_no_wb,4,2               ; @radeon_no_wb
l_.str.2:                               ; @.str.2
	.asciz	"writeback forced off\n"

	.comm	_R600_CP_RB_CNTL,4,2            ; @R600_CP_RB_CNTL
	.comm	_R600_RB_NO_UPDATE,4,2          ; @R600_RB_NO_UPDATE
	.comm	_R600_SCRATCH_UMSK,4,2          ; @R600_SCRATCH_UMSK
	.comm	_R600_BUF_SWAP_32BIT,4,2        ; @R600_BUF_SWAP_32BIT
	.no_dead_strip	_r600_test_writeback
.subsections_via_symbols
