	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdma_v5_0_ring_test_ring
_sdma_v5_0_ring_test_ring:              ## @sdma_v5_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
	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	8(%rdi), %r15
	leaq	-44(%rbp), %rsi
	movq	%r15, %rdi
	callq	_amdgpu_device_wb_get
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	movl	24(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
	jmp	LBB0_19
LBB0_2:
	movq	16(%r15), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	-44(%rbp), %r13d
	movl	$-889266515, %r12d              ## imm = 0xCAFEDEAD
	movl	$-889266515, %edi               ## imm = 0xCAFEDEAD
	callq	_cpu_to_le32
	movq	8(%r15), %rcx
	movl	-44(%rbp), %edx
	movl	%eax, (%rcx,%rdx,4)
	movq	%r14, %rdi
	movl	$5, %esi
	callq	_amdgpu_ring_alloc
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	movl	(%r14), %esi
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %edx
	callq	_DRM_ERROR
	jmp	LBB0_18
LBB0_4:
	shll	$2, %r13d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addq	%r13, %rax
	movq	%rax, %r13
	movq	_SDMA_OP_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SDMA_PKT_HEADER_OP
	movl	%eax, %ebx
	movq	_SDMA_SUBOP_WRITE_LINEAR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SDMA_PKT_HEADER_SUB_OP
	orl	%eax, %ebx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_amdgpu_ring_write
	movq	%r13, %rdi
	callq	_lower_32_bits
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_amdgpu_ring_write
	movq	%r13, %rdi
	callq	_upper_32_bits
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_amdgpu_ring_write
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	_SDMA_PKT_WRITE_UNTILED_DW_3_COUNT
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_amdgpu_ring_write
	movq	%r14, %rdi
	movl	$-559038737, %esi               ## imm = 0xDEADBEEF
	callq	_amdgpu_ring_write
	movq	%r14, %rdi
	callq	_amdgpu_ring_commit
	cmpl	$0, (%r15)
	je	LBB0_17
## %bb.5:
	movq	_amdgpu_emu_mode@GOTPCREL(%rip), %r13
	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	(%r15), %eax
	cmpl	%eax, %ebx
	jae	LBB0_12
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rax
	movl	-44(%rbp), %ecx
	movl	(%rax,%rcx,4), %edi
	callq	_le32_to_cpu
	movl	%eax, %r12d
	cmpl	$-559038737, %eax               ## imm = 0xDEADBEEF
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	cmpl	$1, (%r13)
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	$1, %edi
	callq	_msleep
	jmp	LBB0_11
LBB0_7:
	movl	(%r15), %eax
LBB0_12:
	cmpl	%eax, %ebx
	jae	LBB0_17
## %bb.13:
	cmpl	$1, (%r13)
	movl	(%r14), %esi
	jne	LBB0_16
## %bb.14:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_15
LBB0_17:
	movl	(%r14), %esi
	leaq	L_.str.4(%rip), %rdi
	movl	%r12d, %edx
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_18
LBB0_16:
	leaq	L_.str.3(%rip), %rdi
LBB0_15:
	movl	%ebx, %edx
	callq	_DRM_INFO
	xorl	%ebx, %ebx
LBB0_18:
	movl	-44(%rbp), %esi
	movq	%r15, %rdi
	callq	_amdgpu_device_wb_free
LBB0_19:
	movl	%ebx, %eax
	addq	$24, %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	"(%d) failed to allocate wb slot\n"

L_.str.1:                               ## @.str.1
	.asciz	"amdgpu: dma failed to lock ring %d (%d).\n"

	.comm	_SDMA_OP_WRITE,4,2              ## @SDMA_OP_WRITE
	.comm	_SDMA_SUBOP_WRITE_LINEAR,4,2    ## @SDMA_SUBOP_WRITE_LINEAR
	.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 (0x%08X)\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_sdma_v5_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 sdma_v5_0_ring_test_ring
_sdma_v5_0_ring_test_ring:              ; @sdma_v5_0_ring_test_ring
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x0
	ldr	x19, [x0, #8]
	add	x1, sp, #12
	mov	x0, x19
	bl	_amdgpu_device_wb_get
	cbz	w0, LBB0_2
; %bb.1:
	mov	x22, x0
	ldr	w0, [x19, #24]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x22
	bl	_dev_err
	b	LBB0_19
LBB0_2:
	mov	w21, #57005
	movk	w21, #51966, lsl #16
	ldr	x23, [x19, #16]
	ldr	w25, [sp, #12]
	mov	w0, #57005
	movk	w0, #51966, lsl #16
	bl	_cpu_to_le32
	ldr	x8, [x19, #8]
	ldr	w9, [sp, #12]
	str	w0, [x8, x9, lsl #2]
	mov	x0, x20
	mov	w1, #5
	bl	_amdgpu_ring_alloc
	cbz	w0, LBB0_4
; %bb.3:
	mov	x22, x0
	ldr	w1, [x20]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x2, x22
	bl	_DRM_ERROR
	b	LBB0_18
LBB0_4:
	mov	w24, #48879
	movk	w24, #57005, lsl #16
	lsl	w8, w25, #2
	add	x22, x23, x8
Lloh4:
	adrp	x8, _SDMA_OP_WRITE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SDMA_OP_WRITE@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	bl	_SDMA_PKT_HEADER_OP
	mov	x23, x0
Lloh7:
	adrp	x8, _SDMA_SUBOP_WRITE_LINEAR@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SDMA_SUBOP_WRITE_LINEAR@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	bl	_SDMA_PKT_HEADER_SUB_OP
	orr	w1, w0, w23
	mov	x0, x20
	bl	_amdgpu_ring_write
	mov	x0, x22
	bl	_lower_32_bits
	mov	x1, x0
	mov	x0, x20
	bl	_amdgpu_ring_write
	mov	x0, x22
	bl	_upper_32_bits
	mov	x1, x0
	mov	x0, x20
	bl	_amdgpu_ring_write
	mov	w0, #0
	bl	_SDMA_PKT_WRITE_UNTILED_DW_3_COUNT
	mov	x1, x0
	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_15
; %bb.5:
	mov	w22, #0
Lloh10:
	adrp	x23, _amdgpu_emu_mode@GOTPAGE
Lloh11:
	ldr	x23, [x23, _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	w22, w22, #1
	ldr	w8, [x19]
	cmp	w22, w8
	b.hs	LBB0_12
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	w9, [sp, #12]
	ldr	w0, [x8, x9, lsl #2]
	bl	_le32_to_cpu
	mov	x21, x0
	cmp	w0, w24
	b.eq	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x23]
	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:
	ldr	w8, [x19]
LBB0_12:
	cmp	w22, w8
	b.hs	LBB0_15
; %bb.13:
	ldr	w8, [x23]
	ldr	w1, [x20]
	cmp	w8, #1
	b.ne	LBB0_16
; %bb.14:
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_17
LBB0_15:
	ldr	w1, [x20]
Lloh14:
	adrp	x0, l_.str.4@PAGE
Lloh15:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x2, x21
	bl	_DRM_ERROR
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_18
LBB0_16:
Lloh19:
	adrp	x0, l_.str.3@PAGE
Lloh20:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_17:
	mov	x2, x22
	bl	_DRM_INFO
	mov	w22, #0
LBB0_18:
	ldr	w1, [sp, #12]
	mov	x0, x19
	bl	_amdgpu_device_wb_free
LBB0_19:
	mov	x0, x22
	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
	ldp	x26, x25, [sp, #16]             ; 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	"(%d) failed to allocate wb slot\n"

l_.str.1:                               ; @.str.1
	.asciz	"amdgpu: dma failed to lock ring %d (%d).\n"

	.comm	_SDMA_OP_WRITE,4,2              ; @SDMA_OP_WRITE
	.comm	_SDMA_SUBOP_WRITE_LINEAR,4,2    ; @SDMA_SUBOP_WRITE_LINEAR
	.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 (0x%08X)\n"

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