	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cik_ib_test                    ## -- Begin function cik_ib_test
	.p2align	4, 0x90
_cik_ib_test:                           ## @cik_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	leaq	-44(%rbp), %rsi
	callq	_radeon_scratch_get
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movl	%eax, %r13d
	leaq	L_.str(%rip), %rdi
LBB0_2:
	movl	%r13d, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_19
LBB0_3:
	movl	-44(%rbp), %edi
	movl	$-889266515, %esi               ## imm = 0xCAFEDEAD
	callq	_WREG32
	movl	(%rbx), %esi
	leaq	-72(%rbp), %rdx
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	movl	$256, %r8d                      ## imm = 0x100
	callq	_radeon_ib_get
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %r13d
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movl	-44(%rbp), %esi
	movq	%r14, %rdi
	callq	_radeon_scratch_free
LBB0_19:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_PACKET3_SET_UCONFIG_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %esi
	callq	_PACKET3
	movq	-72(%rbp), %rcx
	movl	%eax, (%rcx)
	movl	-44(%rbp), %eax
	movq	_PACKET3_SET_UCONFIG_REG_START@GOTPCREL(%rip), %rdx
	subl	(%rdx), %eax
	sarl	$2, %eax
	movl	%eax, 4(%rcx)
	movl	$-559038737, 8(%rcx)            ## imm = 0xDEADBEEF
	movl	$3, -64(%rbp)
	leaq	-72(%rbp), %rsi
	movq	%r14, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_radeon_ib_schedule
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %r13d
	movl	-44(%rbp), %esi
	movq	%r14, %rdi
	callq	_radeon_scratch_free
	leaq	-72(%rbp), %rsi
	movq	%r14, %rdi
	callq	_radeon_ib_free
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_2
LBB0_7:
	movq	-56(%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_8
## %bb.9:
	je	LBB0_20
## %bb.10:
	xorl	%r13d, %r13d
	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	-44(%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, %r13d
	leaq	L_.str.3(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_18
LBB0_20:
	leaq	L_.str.4(%rip), %rdi
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movl	-44(%rbp), %esi
	movq	%r14, %rdi
	callq	_radeon_scratch_free
	leaq	-72(%rbp), %rsi
	movq	%r14, %rdi
	callq	_radeon_ib_free
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	jmp	LBB0_19
LBB0_13:
	movl	(%r14), %eax
LBB0_15:
	cmpl	%eax, %r15d
	jae	LBB0_17
## %bb.16:
	movq	-56(%rbp), %rax
	movl	(%rax), %esi
	leaq	L_.str.5(%rip), %rdi
	movl	%r15d, %edx
	callq	_DRM_INFO
	xorl	%r13d, %r13d
	jmp	LBB0_18
LBB0_17:
	movl	-44(%rbp), %esi
	leaq	L_.str.6(%rip), %rdi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
LBB0_18:
	movl	-44(%rbp), %esi
	movq	%r14, %rdi
	callq	_radeon_scratch_free
	leaq	-72(%rbp), %rsi
	movq	%r14, %rdi
	callq	_radeon_ib_free
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"radeon: failed to get scratch reg (%d).\n"

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

	.comm	_PACKET3_SET_UCONFIG_REG,4,2    ## @PACKET3_SET_UCONFIG_REG
	.comm	_PACKET3_SET_UCONFIG_REG_START,4,2 ## @PACKET3_SET_UCONFIG_REG_START
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 on ring %d 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	_cik_ib_test                    ; -- Begin function cik_ib_test
	.p2align	2
_cik_ib_test:                           ; @cik_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	x21, x1
	mov	x19, x0
	add	x1, sp, #20
	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_20
LBB0_2:
	ldr	w0, [sp, #20]
	mov	w1, #57005
	movk	w1, #51966, lsl #16
	bl	_WREG32
	ldr	w1, [x21]
	add	x2, sp, #24
	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]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
	ldr	w1, [sp, #20]
	mov	x0, x19
	bl	_radeon_scratch_free
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	b	LBB0_20
LBB0_4:
	mov	w22, #48879
	movk	w22, #57005, lsl #16
Lloh4:
	adrp	x8, _PACKET3_SET_UCONFIG_REG@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PACKET3_SET_UCONFIG_REG@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	mov	w1, #1
	bl	_PACKET3
	ldr	x8, [sp, #24]
	str	w0, [x8]
	ldr	w9, [sp, #20]
Lloh7:
	adrp	x10, _PACKET3_SET_UCONFIG_REG_START@GOTPAGE
Lloh8:
	ldr	x10, [x10, _PACKET3_SET_UCONFIG_REG_START@GOTPAGEOFF]
Lloh9:
	ldr	w10, [x10]
	sub	w9, w9, w10
	asr	w9, w9, #2
	stp	w9, w22, [x8, #4]
	mov	w8, #3
	str	w8, [sp, #32]
	add	x1, sp, #24
	mov	x0, x19
	mov	x2, #0
	mov	w3, #0
	bl	_radeon_ib_schedule
	cbz	w0, LBB0_6
; %bb.5:
	mov	x20, x0
	ldr	w1, [sp, #20]
	mov	x0, x19
	bl	_radeon_scratch_free
	add	x1, sp, #24
	mov	x0, x19
	bl	_radeon_ib_free
	str	x20, [sp]
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	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	x20, [sp, #40]
Lloh12:
	adrp	x8, _RADEON_USEC_IB_TEST_TIMEOUT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _RADEON_USEC_IB_TEST_TIMEOUT@GOTPAGEOFF]
Lloh14:
	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, #20]
	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]
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_19
LBB0_13:
Lloh17:
	adrp	x0, l_.str.4@PAGE
Lloh18:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DRM_ERROR
	ldr	w1, [sp, #20]
	mov	x0, x19
	bl	_radeon_scratch_free
	add	x1, sp, #24
	mov	x0, x19
	bl	_radeon_ib_free
Lloh19:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_20
LBB0_14:
	mov	w21, #0
	b	LBB0_18
LBB0_15:
	ldr	w8, [x19]
LBB0_16:
	cmp	w20, w8
	b.hs	LBB0_18
; %bb.17:
	ldr	x8, [sp, #40]
	ldr	w1, [x8]
Lloh22:
	adrp	x0, l_.str.5@PAGE
Lloh23:
	add	x0, x0, l_.str.5@PAGEOFF
	mov	x2, x20
	bl	_DRM_INFO
	mov	w20, #0
	b	LBB0_19
LBB0_18:
	ldr	w8, [sp, #20]
	stp	x8, x21, [sp]
Lloh24:
	adrp	x0, l_.str.6@PAGE
Lloh25:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_DRM_ERROR
Lloh26:
	adrp	x8, _EINVAL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_19:
	ldr	w1, [sp, #20]
	mov	x0, x19
	bl	_radeon_scratch_free
	add	x1, sp, #24
	mov	x0, x19
	bl	_radeon_ib_free
LBB0_20:
	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 AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"radeon: failed to get scratch reg (%d).\n"

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

	.comm	_PACKET3_SET_UCONFIG_REG,4,2    ; @PACKET3_SET_UCONFIG_REG
	.comm	_PACKET3_SET_UCONFIG_REG_START,4,2 ; @PACKET3_SET_UCONFIG_REG_START
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 on ring %d 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
