	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_r600_dma_ib_test               ## -- Begin function r600_dma_ib_test
	.p2align	4, 0x90
_r600_dma_ib_test:                      ## @r600_dma_ib_test
	.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	%rdi, %r14
	movq	(%rsi), %rsi
	movq	_R600_RING_TYPE_DMA_INDEX@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	jne	LBB0_1
## %bb.2:
	movq	_R600_WB_DMA_RING_TEST_OFFSET@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_CAYMAN_WB_DMA1_RING_TEST_OFFSET@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %r13d
	movq	16(%r14), %rbx
	leaq	-64(%rbp), %rdx
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	movl	$256, %r8d                      ## imm = 0x100
	callq	_radeon_ib_get
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:
	movl	%eax, %r15d
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_5
LBB0_6:
	movl	%r13d, %eax
	addq	%rax, %rbx
	movq	_DMA_PACKET_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	$1, %ecx
	callq	_DMA_PACKET
	movq	-64(%rbp), %rcx
	movl	%eax, (%rcx)
	movq	%rbx, %rdi
	callq	_lower_32_bits
	movq	-64(%rbp), %rcx
	movl	%eax, 4(%rcx)
	movq	%rbx, %rdi
	callq	_upper_32_bits
	movzbl	%al, %eax
	movq	-64(%rbp), %rcx
	movl	%eax, 8(%rcx)
	movl	$-559038737, 12(%rcx)           ## imm = 0xDEADBEEF
	movl	$4, -56(%rbp)
	leaq	-64(%rbp), %rsi
	movq	%r14, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_radeon_ib_schedule
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %r15d
	leaq	-64(%rbp), %rsi
	movq	%r14, %rdi
	callq	_radeon_ib_free
	leaq	L_.str.1(%rip), %rdi
LBB0_5:
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_20:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	-48(%rbp), %rbx
	movq	_RADEON_USEC_IB_TEST_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_usecs_to_jiffies
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	%eax, %edx
	callq	_radeon_fence_wait_timeout
	testl	%eax, %eax
	js	LBB0_9
## %bb.10:
	je	LBB0_21
## %bb.11:
	xorl	%r15d, %r15d
	cmpl	$0, (%r14)
	movl	$0, %r12d
	je	LBB0_18
## %bb.12:
	shrl	$2, %r13d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rax
	movl	(%rax,%r13,4), %edi
	callq	_le32_to_cpu
	movl	%eax, %r12d
	cmpl	$-559038737, %eax               ## imm = 0xDEADBEEF
	je	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	$1, %edi
	callq	_udelay
	incl	%ebx
	movl	(%r14), %eax
	cmpl	%eax, %ebx
	jb	LBB0_13
	jmp	LBB0_16
LBB0_9:
	movl	%eax, %r15d
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_5
LBB0_21:
	leaq	L_.str.3(%rip), %rdi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_20
LBB0_14:
	movl	(%r14), %eax
LBB0_16:
	cmpl	%eax, %ebx
	jae	LBB0_18
## %bb.17:
	movq	-48(%rbp), %rax
	movl	(%rax), %esi
	leaq	L_.str.4(%rip), %rdi
	movl	%ebx, %edx
	callq	_DRM_INFO
	xorl	%r15d, %r15d
	jmp	LBB0_19
LBB0_18:
	leaq	L_.str.5(%rip), %rdi
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
LBB0_19:
	leaq	-64(%rbp), %rsi
	movq	%r14, %rdi
	callq	_radeon_ib_free
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_R600_RING_TYPE_DMA_INDEX,8,3   ## @R600_RING_TYPE_DMA_INDEX
	.comm	_R600_WB_DMA_RING_TEST_OFFSET,4,2 ## @R600_WB_DMA_RING_TEST_OFFSET
	.comm	_CAYMAN_WB_DMA1_RING_TEST_OFFSET,4,2 ## @CAYMAN_WB_DMA1_RING_TEST_OFFSET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"radeon: failed to get ib (%d).\n"

	.comm	_DMA_PACKET_WRITE,4,2           ## @DMA_PACKET_WRITE
L_.str.1:                               ## @.str.1
	.asciz	"radeon: failed to schedule ib (%d).\n"

	.comm	_RADEON_USEC_IB_TEST_TIMEOUT,4,2 ## @RADEON_USEC_IB_TEST_TIMEOUT
L_.str.2:                               ## @.str.2
	.asciz	"radeon: fence wait failed (%d).\n"

L_.str.3:                               ## @.str.3
	.asciz	"radeon: fence wait timed out.\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
L_.str.4:                               ## @.str.4
	.asciz	"ib test on ring %d succeeded in %u usecs\n"

L_.str.5:                               ## @.str.5
	.asciz	"radeon: ib test failed (0x%08X)\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_r600_dma_ib_test               ; -- Begin function r600_dma_ib_test
	.p2align	2
_r600_dma_ib_test:                      ; @r600_dma_ib_test
	.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	x19, x0
	ldr	x1, [x1]
Lloh0:
	adrp	x8, _R600_RING_TYPE_DMA_INDEX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _R600_RING_TYPE_DMA_INDEX@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _R600_WB_DMA_RING_TEST_OFFSET@GOTPAGE
Lloh4:
	ldr	x9, [x9, _R600_WB_DMA_RING_TEST_OFFSET@GOTPAGEOFF]
Lloh5:
	adrp	x10, _CAYMAN_WB_DMA1_RING_TEST_OFFSET@GOTPAGE
Lloh6:
	ldr	x10, [x10, _CAYMAN_WB_DMA1_RING_TEST_OFFSET@GOTPAGEOFF]
	cmp	x1, x8
	csel	x8, x9, x10, eq
	ldr	w21, [x8]
	ldr	x23, [x0, #16]
	add	x2, sp, #8
	mov	x3, #0
	mov	w4, #256
	bl	_radeon_ib_get
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
	str	x20, [sp]
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_4
LBB0_2:
	mov	w22, #48879
	movk	w22, #57005, lsl #16
	add	x20, x23, w21, uxtw
Lloh9:
	adrp	x8, _DMA_PACKET_WRITE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DMA_PACKET_WRITE@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	mov	w1, #0
	mov	w2, #0
	mov	w3, #1
	bl	_DMA_PACKET
	ldr	x8, [sp, #8]
	str	w0, [x8]
	mov	x0, x20
	bl	_lower_32_bits
	ldr	x8, [sp, #8]
	str	w0, [x8, #4]
	mov	x0, x20
	bl	_upper_32_bits
	and	w8, w0, #0xff
	ldr	x9, [sp, #8]
	stp	w8, w22, [x9, #8]
	mov	w8, #4
	str	w8, [sp, #16]
	add	x1, sp, #8
	mov	x0, x19
	mov	x2, #0
	mov	w3, #0
	bl	_radeon_ib_schedule
	cbz	w0, LBB0_5
; %bb.3:
	mov	x20, x0
	add	x1, sp, #8
	mov	x0, x19
	bl	_radeon_ib_free
	str	x20, [sp]
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
LBB0_4:
	mov	x0, x20
	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_5:
	ldr	x20, [sp, #24]
Lloh14:
	adrp	x8, _RADEON_USEC_IB_TEST_TIMEOUT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _RADEON_USEC_IB_TEST_TIMEOUT@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_usecs_to_jiffies
	mov	x2, x0
	mov	x0, x20
	mov	w1, #0
	bl	_radeon_fence_wait_timeout
	mov	x20, x0
	tbnz	w0, #31, LBB0_11
; %bb.6:
	cbz	w20, LBB0_12
; %bb.7:
	ldr	w8, [x19]
	cbz	w8, LBB0_13
; %bb.8:
	mov	w20, #0
	lsr	w23, w21, #2
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	w0, [x8, x23, lsl #2]
	bl	_le32_to_cpu
	mov	x21, x0
	cmp	w0, w22
	b.eq	LBB0_14
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	w0, #1
	bl	_udelay
	add	w20, w20, #1
	ldr	w8, [x19]
	cmp	w20, w8
	b.lo	LBB0_9
	b	LBB0_15
LBB0_11:
	mov	x8, x20
	str	x8, [sp]
Lloh17:
	adrp	x0, l_.str.2@PAGE
Lloh18:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_4
LBB0_12:
Lloh19:
	adrp	x0, l_.str.3@PAGE
Lloh20:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_ERROR
Lloh21:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_4
LBB0_13:
	mov	w21, #0
	b	LBB0_17
LBB0_14:
	ldr	w8, [x19]
LBB0_15:
	cmp	w20, w8
	b.hs	LBB0_17
; %bb.16:
	ldr	x8, [sp, #24]
	ldr	w1, [x8]
Lloh24:
	adrp	x0, l_.str.4@PAGE
Lloh25:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x2, x20
	bl	_DRM_INFO
	mov	w20, #0
	b	LBB0_18
LBB0_17:
	str	x21, [sp]
Lloh26:
	adrp	x0, l_.str.5@PAGE
Lloh27:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_DRM_ERROR
Lloh28:
	adrp	x8, _EINVAL@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_18:
	add	x1, sp, #8
	mov	x0, x19
	bl	_radeon_ib_free
	b	LBB0_4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_R600_RING_TYPE_DMA_INDEX,8,3   ; @R600_RING_TYPE_DMA_INDEX
	.comm	_R600_WB_DMA_RING_TEST_OFFSET,4,2 ; @R600_WB_DMA_RING_TEST_OFFSET
	.comm	_CAYMAN_WB_DMA1_RING_TEST_OFFSET,4,2 ; @CAYMAN_WB_DMA1_RING_TEST_OFFSET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"radeon: failed to get ib (%d).\n"

	.comm	_DMA_PACKET_WRITE,4,2           ; @DMA_PACKET_WRITE
l_.str.1:                               ; @.str.1
	.asciz	"radeon: failed to schedule ib (%d).\n"

	.comm	_RADEON_USEC_IB_TEST_TIMEOUT,4,2 ; @RADEON_USEC_IB_TEST_TIMEOUT
l_.str.2:                               ; @.str.2
	.asciz	"radeon: fence wait failed (%d).\n"

l_.str.3:                               ; @.str.3
	.asciz	"radeon: fence wait timed out.\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
l_.str.4:                               ; @.str.4
	.asciz	"ib test on ring %d succeeded in %u usecs\n"

l_.str.5:                               ; @.str.5
	.asciz	"radeon: ib test failed (0x%08X)\n"

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