	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gfx_v10_0_ring_test_ib
_gfx_v10_0_ring_test_ib:                ## @gfx_v10_0_ring_test_ib
	.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	%rsi, %r12
	movq	%rdi, %r15
	movq	8(%rdi), %r14
	movq	$0, -48(%rbp)
	leaq	-36(%rbp), %rsi
	movq	%r14, %rdi
	callq	_amdgpu_gfx_scratch_get
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%rax, %rbx
	leaq	L_.str(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_15
LBB0_2:
	movl	-36(%rbp), %edi
	movl	$-889266515, %esi               ## imm = 0xCAFEDEAD
	callq	_WREG32
	leaq	-64(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$256, %edx                      ## imm = 0x100
	movq	%rbx, %rcx
	callq	_amdgpu_ib_get
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%rax, %rbx
	leaq	L_.str.1(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_14
LBB0_4:
	movq	_PACKET3_SET_UCONFIG_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %esi
	callq	_PACKET3
	movq	-64(%rbp), %rcx
	movl	%eax, (%rcx)
	movl	-36(%rbp), %eax
	movq	_PACKET3_SET_UCONFIG_REG_START@GOTPCREL(%rip), %rdx
	subl	(%rdx), %eax
	movl	%eax, 4(%rcx)
	movl	$-559038737, 8(%rcx)            ## imm = 0xDEADBEEF
	movl	$3, -56(%rbp)
	leaq	-64(%rbp), %rdx
	leaq	-48(%rbp), %r8
	movq	%r15, %rdi
	movl	$1, %esi
	xorl	%ecx, %ecx
	callq	_amdgpu_ib_schedule
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_13
## %bb.5:
	movq	-48(%rbp), %rdi
	xorl	%esi, %esi
	movq	%r12, %rdx
	callq	_dma_fence_wait_timeout
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	js	LBB0_8
## %bb.9:
	movl	-36(%rbp), %edi
	callq	_RREG32
	cmpl	$-559038737, %eax               ## imm = 0xDEADBEEF
	jne	LBB0_11
## %bb.10:
	movl	(%r15), %esi
	leaq	L_.str.4(%rip), %rdi
	callq	_DRM_INFO
	xorl	%ebx, %ebx
	jmp	LBB0_13
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_8:
	movq	%rax, %rbx
	leaq	L_.str.3(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_13
LBB0_11:
	movl	-36(%rbp), %esi
	leaq	L_.str.5(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_12:
	subq	(%rax), %rbx
LBB0_13:
	leaq	-64(%rbp), %rsi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_amdgpu_ib_free
	movq	-48(%rbp), %rdi
	callq	_dma_fence_put
LBB0_14:
	movl	-36(%rbp), %esi
	movq	%r14, %rdi
	callq	_amdgpu_gfx_scratch_free
LBB0_15:
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"amdgpu: failed to get scratch reg (%ld).\n"

L_.str.1:                               ## @.str.1
	.asciz	"amdgpu: failed to get ib (%ld).\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	"amdgpu: IB test timed out.\n"

	.comm	_ETIMEDOUT,8,3                  ## @ETIMEDOUT
L_.str.3:                               ## @.str.3
	.asciz	"amdgpu: fence wait failed (%ld).\n"

L_.str.4:                               ## @.str.4
	.asciz	"ib test on ring %d succeeded\n"

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

	.comm	_EINVAL,8,3                     ## @EINVAL
	.no_dead_strip	_gfx_v10_0_ring_test_ib
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gfx_v10_0_ring_test_ib
_gfx_v10_0_ring_test_ib:                ; @gfx_v10_0_ring_test_ib
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x21, x1
	mov	x20, x0
	ldr	x19, [x0, #8]
	str	xzr, [sp, #24]
	add	x1, sp, #20
	mov	x0, x19
	bl	_amdgpu_gfx_scratch_get
	cbz	x0, LBB0_2
; %bb.1:
	mov	x22, x0
	str	x0, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_15
LBB0_2:
	ldr	w0, [sp, #20]
	mov	w1, #57005
	movk	w1, #51966, lsl #16
	bl	_WREG32
	add	x0, sp, #32
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	add	x3, sp, #32
	mov	x0, x19
	mov	x1, #0
	mov	w2, #256
	bl	_amdgpu_ib_get
	cbz	x0, LBB0_4
; %bb.3:
	mov	x22, x0
	str	x0, [sp]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_14
LBB0_4:
	mov	w23, #48879
	movk	w23, #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, #32]
	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
	stp	w9, w23, [x8, #4]
	mov	w8, #3
	str	w8, [sp, #40]
	add	x2, sp, #32
	add	x4, sp, #24
	mov	x0, x20
	mov	w1, #1
	mov	x3, #0
	bl	_amdgpu_ib_schedule
	mov	x22, x0
	cbnz	x0, LBB0_13
; %bb.5:
	ldr	x0, [sp, #24]
	mov	w1, #0
	mov	x2, x21
	bl	_dma_fence_wait_timeout
	cbz	x0, LBB0_9
; %bb.6:
	mov	x22, x0
	tbnz	x0, #63, LBB0_10
; %bb.7:
	ldr	w0, [sp, #20]
	bl	_RREG32
                                        ; kill: def $w0 killed $w0 def $x0
	cmp	w0, w23
	b.ne	LBB0_11
; %bb.8:
	ldr	w1, [x20]
Lloh10:
	adrp	x0, l_.str.4@PAGE
Lloh11:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DRM_INFO
	mov	x22, #0
	b	LBB0_13
LBB0_9:
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_ERROR
Lloh14:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:
	str	x22, [sp]
Lloh16:
	adrp	x0, l_.str.3@PAGE
Lloh17:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_13
LBB0_11:
	ldr	w8, [sp, #20]
	stp	x8, x0, [sp]
Lloh18:
	adrp	x0, l_.str.5@PAGE
Lloh19:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_DRM_ERROR
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_12:
	ldr	x8, [x8]
	neg	x22, x8
LBB0_13:
	add	x1, sp, #32
	mov	x0, x19
	mov	x2, #0
	bl	_amdgpu_ib_free
	ldr	x0, [sp, #24]
	bl	_dma_fence_put
LBB0_14:
	ldr	w1, [sp, #20]
	mov	x0, x19
	bl	_amdgpu_gfx_scratch_free
LBB0_15:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"amdgpu: failed to get scratch reg (%ld).\n"

l_.str.1:                               ; @.str.1
	.asciz	"amdgpu: failed to get ib (%ld).\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	"amdgpu: IB test timed out.\n"

	.comm	_ETIMEDOUT,8,3                  ; @ETIMEDOUT
l_.str.3:                               ; @.str.3
	.asciz	"amdgpu: fence wait failed (%ld).\n"

l_.str.4:                               ; @.str.4
	.asciz	"ib test on ring %d succeeded\n"

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

	.comm	_EINVAL,8,3                     ; @EINVAL
	.no_dead_strip	_gfx_v10_0_ring_test_ib
.subsections_via_symbols
