	.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_ring
_gfx_v10_0_ring_test_ring:              ## @gfx_v10_0_ring_test_ring
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	8(%rdi), %r14
	leaq	-44(%rbp), %rsi
	movq	%r14, %rdi
	callq	_amdgpu_gfx_scratch_get
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r12d
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_19
LBB0_2:
	movl	-44(%rbp), %edi
	movl	$-889266515, %esi               ## imm = 0xCAFEDEAD
	callq	_WREG32
	movq	%r15, %rdi
	movl	$3, %esi
	callq	_amdgpu_ring_alloc
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r12d
	movl	(%r15), %esi
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_18
LBB0_4:
	movq	_PACKET3_SET_UCONFIG_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %esi
	callq	_PACKET3
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_amdgpu_ring_write
	movl	-44(%rbp), %esi
	movq	_PACKET3_SET_UCONFIG_REG_START@GOTPCREL(%rip), %rax
	subl	(%rax), %esi
	movq	%r15, %rdi
	callq	_amdgpu_ring_write
	movq	%r15, %rdi
	movl	$-559038737, %esi               ## imm = 0xDEADBEEF
	callq	_amdgpu_ring_write
	movq	%r15, %rdi
	callq	_amdgpu_ring_commit
	xorl	%r12d, %r12d
	cmpl	$0, (%r14)
	movl	$0, %r13d
	je	LBB0_17
## %bb.5:
	xorl	%ebx, %ebx
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=1
	movl	$1, %edi
	callq	_udelay
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=1
	incl	%ebx
	movl	(%r14), %eax
	cmpl	%eax, %ebx
	jae	LBB0_12
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	-44(%rbp), %edi
	callq	_RREG32
	movl	%eax, %r13d
	cmpl	$-559038737, %eax               ## imm = 0xDEADBEEF
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	_amdgpu_emu_mode@GOTPCREL(%rip), %rax
	cmpl	$1, (%rax)
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	$1, %edi
	callq	_msleep
	jmp	LBB0_11
LBB0_7:
	movl	(%r14), %eax
LBB0_12:
	cmpl	%eax, %ebx
	jae	LBB0_17
## %bb.13:
	movq	_amdgpu_emu_mode@GOTPCREL(%rip), %rax
	cmpl	$1, (%rax)
	movl	(%r15), %esi
	jne	LBB0_16
## %bb.14:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_15
LBB0_17:
	movl	(%r15), %esi
	movl	-44(%rbp), %edx
	leaq	L_.str.4(%rip), %rdi
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_18
LBB0_16:
	leaq	L_.str.3(%rip), %rdi
LBB0_15:
	movl	%ebx, %edx
	callq	_DRM_INFO
	xorl	%r12d, %r12d
LBB0_18:
	movl	-44(%rbp), %esi
	movq	%r14, %rdi
	callq	_amdgpu_gfx_scratch_free
LBB0_19:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"amdgpu: cp failed to get scratch reg (%d).\n"

L_.str.1:                               ## @.str.1
	.asciz	"amdgpu: cp failed to lock ring %d (%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
	.comm	_amdgpu_emu_mode,4,2            ## @amdgpu_emu_mode
L_.str.2:                               ## @.str.2
	.asciz	"ring test on %d succeeded in %d msecs\n"

L_.str.3:                               ## @.str.3
	.asciz	"ring test on %d succeeded in %d usecs\n"

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

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_gfx_v10_0_ring_test_ring
.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_ring
_gfx_v10_0_ring_test_ring:              ; @gfx_v10_0_ring_test_ring
	.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	x20, x0
	ldr	x19, [x0, #8]
	add	x1, sp, #28
	mov	x0, x19
	bl	_amdgpu_gfx_scratch_get
	cbz	w0, LBB0_2
; %bb.1:
	mov	x21, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_DRM_ERROR
	b	LBB0_20
LBB0_2:
	ldr	w0, [sp, #28]
	mov	w1, #57005
	movk	w1, #51966, lsl #16
	bl	_WREG32
	mov	x0, x20
	mov	w1, #3
	bl	_amdgpu_ring_alloc
	cbz	w0, LBB0_4
; %bb.3:
	mov	x21, x0
	ldr	w1, [x20]
	str	x21, [sp]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_19
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
	mov	x1, x0
	mov	x0, x20
	bl	_amdgpu_ring_write
	ldr	w8, [sp, #28]
Lloh7:
	adrp	x9, _PACKET3_SET_UCONFIG_REG_START@GOTPAGE
Lloh8:
	ldr	x9, [x9, _PACKET3_SET_UCONFIG_REG_START@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	sub	w1, w8, w9
	mov	x0, x20
	bl	_amdgpu_ring_write
	mov	x0, x20
	mov	w1, #48879
	movk	w1, #57005, lsl #16
	bl	_amdgpu_ring_write
	mov	x0, x20
	bl	_amdgpu_ring_commit
	ldr	w8, [x19]
	cbz	w8, LBB0_11
; %bb.5:
	mov	w21, #0
Lloh10:
	adrp	x24, _amdgpu_emu_mode@GOTPAGE
Lloh11:
	ldr	x24, [x24, _amdgpu_emu_mode@GOTPAGEOFF]
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=1
	bl	_udelay
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	w21, w21, #1
	ldr	w8, [x19]
	cmp	w21, w8
	b.hs	LBB0_13
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [sp, #28]
	bl	_RREG32
	mov	x22, x0
	cmp	w0, w23
	b.eq	LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x24]
	mov	w0, #1
	cmp	w8, #1
	b.ne	LBB0_6
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	bl	_msleep
	b	LBB0_7
LBB0_11:
	mov	w22, #0
	b	LBB0_16
LBB0_12:
	ldr	w8, [x19]
LBB0_13:
	cmp	w21, w8
	b.hs	LBB0_16
; %bb.14:
	ldr	w8, [x24]
	ldr	w1, [x20]
	cmp	w8, #1
	b.ne	LBB0_17
; %bb.15:
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_18
LBB0_16:
	ldr	w1, [x20]
	ldr	w8, [sp, #28]
	stp	x8, x22, [sp]
Lloh14:
	adrp	x0, l_.str.4@PAGE
Lloh15:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DRM_ERROR
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_19
LBB0_17:
Lloh19:
	adrp	x0, l_.str.3@PAGE
Lloh20:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_18:
	mov	x2, x21
	bl	_DRM_INFO
	mov	w21, #0
LBB0_19:
	ldr	w1, [sp, #28]
	mov	x0, x19
	bl	_amdgpu_gfx_scratch_free
LBB0_20:
	mov	x0, x21
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"amdgpu: cp failed to get scratch reg (%d).\n"

l_.str.1:                               ; @.str.1
	.asciz	"amdgpu: cp failed to lock ring %d (%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
	.comm	_amdgpu_emu_mode,4,2            ; @amdgpu_emu_mode
l_.str.2:                               ; @.str.2
	.asciz	"ring test on %d succeeded in %d msecs\n"

l_.str.3:                               ; @.str.3
	.asciz	"ring test on %d succeeded in %d usecs\n"

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

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