	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_r100_ib_test                   ## -- Begin function r100_ib_test
	.p2align	4, 0x90
_r100_ib_test:                          ## @r100_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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	leaq	-36(%rbp), %rsi
	callq	_radeon_scratch_get
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_21
LBB0_2:
	movl	-36(%rbp), %edi
	movl	$-889266515, %esi               ## imm = 0xCAFEDEAD
	callq	_WREG32
	movq	_RADEON_RING_TYPE_GFX_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdx
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	movl	$256, %r8d                      ## imm = 0x100
	callq	_radeon_ib_get
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_20
LBB0_4:
	movl	-36(%rbp), %edi
	xorl	%esi, %esi
	callq	_PACKET0
	movq	-56(%rbp), %rcx
	movl	%eax, (%rcx)
	movl	$-559038737, 4(%rcx)            ## imm = 0xDEADBEEF
	xorl	%edi, %edi
	callq	_PACKET2
	movq	-56(%rbp), %rcx
	movl	%eax, 8(%rcx)
	xorl	%edi, %edi
	callq	_PACKET2
	movq	-56(%rbp), %rcx
	movl	%eax, 12(%rcx)
	xorl	%edi, %edi
	callq	_PACKET2
	movq	-56(%rbp), %rcx
	movl	%eax, 16(%rcx)
	xorl	%edi, %edi
	callq	_PACKET2
	movq	-56(%rbp), %rcx
	movl	%eax, 20(%rcx)
	xorl	%edi, %edi
	callq	_PACKET2
	movq	-56(%rbp), %rcx
	movl	%eax, 24(%rcx)
	xorl	%edi, %edi
	callq	_PACKET2
	movq	-56(%rbp), %rcx
	movl	%eax, 28(%rcx)
	movl	$8, -48(%rbp)
	leaq	-56(%rbp), %rsi
	movq	%r14, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_radeon_ib_schedule
	testl	%eax, %eax
	je	LBB0_7
## %bb.5:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rdi
LBB0_6:
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_19:
	leaq	-56(%rbp), %rsi
	movq	%r14, %rdi
	callq	_radeon_ib_free
LBB0_20:
	movl	-36(%rbp), %esi
	movq	%r14, %rdi
	callq	_radeon_scratch_free
LBB0_21:
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	-44(%rbp), %ebx
	movq	_RADEON_USEC_IB_TEST_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_usecs_to_jiffies
	movl	%ebx, %edi
	xorl	%esi, %esi
	movl	%eax, %edx
	callq	_radeon_fence_wait_timeout
	testl	%eax, %eax
	js	LBB0_8
## %bb.9:
	je	LBB0_22
## %bb.10:
	xorl	%ebx, %ebx
	cmpl	$0, (%r14)
	movl	$0, %r12d
	je	LBB0_17
## %bb.11:
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movl	-36(%rbp), %edi
	callq	_RREG32
	movl	%eax, %r12d
	cmpl	$-559038737, %eax               ## imm = 0xDEADBEEF
	je	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	$1, %edi
	callq	_udelay
	incl	%r15d
	movl	(%r14), %eax
	cmpl	%eax, %r15d
	jb	LBB0_12
	jmp	LBB0_15
LBB0_8:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_6
LBB0_22:
	leaq	L_.str.4(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_13:
	movl	(%r14), %eax
LBB0_15:
	cmpl	%eax, %r15d
	jae	LBB0_17
## %bb.16:
	leaq	L_.str.5(%rip), %rdi
	movl	%r15d, %esi
	callq	_DRM_INFO
	xorl	%ebx, %ebx
	jmp	LBB0_19
LBB0_17:
	movl	-36(%rbp), %esi
	leaq	L_.str.6(%rip), %rdi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_18:
	subl	(%rax), %ebx
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"radeon: failed to get scratch reg (%d).\n"

	.comm	_RADEON_RING_TYPE_GFX_INDEX,4,2 ## @RADEON_RING_TYPE_GFX_INDEX
L_.str.1:                               ## @.str.1
	.asciz	"radeon: failed to get ib (%d).\n"

L_.str.2:                               ## @.str.2
	.asciz	"radeon: failed to schedule ib (%d).\n"

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

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

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

L_.str.6:                               ## @.str.6
	.asciz	"radeon: ib test failed (scratch(0x%04X)=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	_r100_ib_test                   ; -- Begin function r100_ib_test
	.p2align	2
_r100_ib_test:                          ; @r100_ib_test
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x0
	add	x1, sp, #28
	bl	_radeon_scratch_get
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
	str	x20, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_22
LBB0_2:
	ldr	w0, [sp, #28]
	mov	w1, #57005
	movk	w1, #51966, lsl #16
	bl	_WREG32
Lloh2:
	adrp	x8, _RADEON_RING_TYPE_GFX_INDEX@GOTPAGE
Lloh3:
	ldr	x8, [x8, _RADEON_RING_TYPE_GFX_INDEX@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	add	x2, sp, #32
	mov	x0, x19
	mov	x3, #0
	mov	w4, #256
	bl	_radeon_ib_get
	cbz	w0, LBB0_4
; %bb.3:
	mov	x20, x0
	str	x20, [sp]
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	b	LBB0_21
LBB0_4:
	mov	w22, #48879
	movk	w22, #57005, lsl #16
	ldr	w0, [sp, #28]
	mov	w1, #0
	bl	_PACKET0
	ldr	x8, [sp, #32]
	stp	w0, w22, [x8]
	mov	w0, #0
	bl	_PACKET2
	ldr	x8, [sp, #32]
	str	w0, [x8, #8]
	mov	w0, #0
	bl	_PACKET2
	ldr	x8, [sp, #32]
	str	w0, [x8, #12]
	mov	w0, #0
	bl	_PACKET2
	ldr	x8, [sp, #32]
	str	w0, [x8, #16]
	mov	w0, #0
	bl	_PACKET2
	ldr	x8, [sp, #32]
	str	w0, [x8, #20]
	mov	w0, #0
	bl	_PACKET2
	ldr	x8, [sp, #32]
	str	w0, [x8, #24]
	mov	w0, #0
	bl	_PACKET2
	ldr	x8, [sp, #32]
	str	w0, [x8, #28]
	mov	w8, #8
	str	w8, [sp, #40]
	add	x1, sp, #32
	mov	x0, x19
	mov	x2, #0
	mov	w3, #0
	bl	_radeon_ib_schedule
	cbz	w0, LBB0_6
; %bb.5:
	mov	x20, x0
	str	x20, [sp]
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_ERROR
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	b	LBB0_20
LBB0_6:
	ldr	w20, [sp, #44]
Lloh9:
	adrp	x8, _RADEON_USEC_IB_TEST_TIMEOUT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RADEON_USEC_IB_TEST_TIMEOUT@GOTPAGEOFF]
Lloh11:
	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_12
; %bb.7:
	cbz	w20, LBB0_13
; %bb.8:
	ldr	w8, [x19]
	cbz	w8, LBB0_14
; %bb.9:
	mov	w20, #0
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [sp, #28]
	bl	_RREG32
	mov	x21, x0
	cmp	w0, w22
	b.eq	LBB0_15
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	w0, #1
	bl	_udelay
	add	w20, w20, #1
	ldr	w8, [x19]
	cmp	w20, w8
	b.lo	LBB0_10
	b	LBB0_16
LBB0_12:
	mov	x8, x20
	str	x8, [sp]
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_20
LBB0_13:
Lloh14:
	adrp	x0, l_.str.4@PAGE
Lloh15:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DRM_ERROR
Lloh16:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_19
LBB0_14:
	mov	w21, #0
	b	LBB0_18
LBB0_15:
	ldr	w8, [x19]
LBB0_16:
	cmp	w20, w8
	b.hs	LBB0_18
; %bb.17:
Lloh18:
	adrp	x0, l_.str.5@PAGE
Lloh19:
	add	x0, x0, l_.str.5@PAGEOFF
	mov	x1, x20
	bl	_DRM_INFO
	mov	w20, #0
	b	LBB0_20
LBB0_18:
	ldr	w8, [sp, #28]
	stp	x8, x21, [sp]
Lloh20:
	adrp	x0, l_.str.6@PAGE
Lloh21:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_DRM_ERROR
Lloh22:
	adrp	x8, _EINVAL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_19:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_20:
	add	x1, sp, #32
	mov	x0, x19
	bl	_radeon_ib_free
LBB0_21:
	ldr	w1, [sp, #28]
	mov	x0, x19
	bl	_radeon_scratch_free
LBB0_22:
	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
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"radeon: failed to get scratch reg (%d).\n"

	.comm	_RADEON_RING_TYPE_GFX_INDEX,4,2 ; @RADEON_RING_TYPE_GFX_INDEX
l_.str.1:                               ; @.str.1
	.asciz	"radeon: failed to get ib (%d).\n"

l_.str.2:                               ; @.str.2
	.asciz	"radeon: failed to schedule ib (%d).\n"

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

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

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

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

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