	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cik_sdma_ring_test_ring
_cik_sdma_ring_test_ring:               ## @cik_sdma_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, %r14
	movq	(%rdi), %r12
	leaq	-44(%rbp), %rsi
	movq	%r12, %rdi
	callq	_amdgpu_device_wb_get
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_9
## %bb.1:
	movq	16(%r12), %r15
	movl	-44(%rbp), %ebx
	movl	$-889266515, %edi               ## imm = 0xCAFEDEAD
	callq	_cpu_to_le32
	movq	8(%r12), %rcx
	movl	-44(%rbp), %edx
	movl	%eax, (%rcx,%rdx,4)
	movq	%r14, %rdi
	movl	$5, %esi
	callq	_amdgpu_ring_alloc
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_8
## %bb.2:
	shll	$2, %ebx
	addq	%rbx, %r15
	movq	_SDMA_OPCODE_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SDMA_WRITE_SUB_OPCODE_LINEAR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	xorl	%edx, %edx
	callq	_SDMA_PACKET
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_amdgpu_ring_write
	movq	%r15, %rdi
	callq	_lower_32_bits
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_amdgpu_ring_write
	movq	%r15, %rdi
	callq	_upper_32_bits
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_amdgpu_ring_write
	movq	%r14, %rdi
	movl	$1, %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, (%r12)
	je	LBB0_7
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rax
	movl	-44(%rbp), %ecx
	movl	(%rax,%rcx,4), %edi
	callq	_le32_to_cpu
	cmpl	$-559038737, %eax               ## imm = 0xDEADBEEF
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$1, %edi
	callq	_udelay
	incl	%ebx
	movl	(%r12), %eax
	cmpl	%eax, %ebx
	jb	LBB0_3
	jmp	LBB0_6
LBB0_4:
	movl	(%r12), %eax
LBB0_6:
	xorl	%r13d, %r13d
	cmpl	%eax, %ebx
	jb	LBB0_8
LBB0_7:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_8:
	movl	-44(%rbp), %esi
	movq	%r12, %rdi
	callq	_amdgpu_device_wb_free
LBB0_9:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SDMA_OPCODE_WRITE,4,2          ## @SDMA_OPCODE_WRITE
	.comm	_SDMA_WRITE_SUB_OPCODE_LINEAR,4,2 ## @SDMA_WRITE_SUB_OPCODE_LINEAR
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_cik_sdma_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 cik_sdma_ring_test_ring
_cik_sdma_ring_test_ring:               ; @cik_sdma_ring_test_ring
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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]
	add	x1, sp, #12
	mov	x0, x19
	bl	_amdgpu_device_wb_get
	mov	x21, x0
	cbnz	w0, LBB0_11
; %bb.1:
	ldr	x23, [x19, #16]
	ldr	w24, [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
	mov	x21, x0
	cbnz	w0, LBB0_10
; %bb.2:
	mov	w22, #48879
	movk	w22, #57005, lsl #16
	lsl	w8, w24, #2
	add	x21, x23, x8
Lloh0:
	adrp	x8, _SDMA_OPCODE_WRITE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SDMA_OPCODE_WRITE@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _SDMA_WRITE_SUB_OPCODE_LINEAR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SDMA_WRITE_SUB_OPCODE_LINEAR@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_SDMA_PACKET
	mov	x1, x0
	mov	x0, x20
	bl	_amdgpu_ring_write
	mov	x0, x21
	bl	_lower_32_bits
	mov	x1, x0
	mov	x0, x20
	bl	_amdgpu_ring_write
	mov	x0, x21
	bl	_upper_32_bits
	mov	x1, x0
	mov	x0, x20
	bl	_amdgpu_ring_write
	mov	x0, x20
	mov	w1, #1
	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_9
; %bb.3:
	mov	w20, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	w9, [sp, #12]
	ldr	w0, [x8, x9, lsl #2]
	bl	_le32_to_cpu
	cmp	w0, w22
	b.eq	LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #1
	bl	_udelay
	add	w20, w20, #1
	ldr	w8, [x19]
	cmp	w20, w8
	b.lo	LBB0_4
; %bb.6:
	cmp	w20, w8
	b.hs	LBB0_9
LBB0_7:
	mov	w21, #0
	b	LBB0_10
LBB0_8:
	ldr	w8, [x19]
	cmp	w20, w8
	b.lo	LBB0_7
LBB0_9:
Lloh6:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_10:
	ldr	w1, [sp, #12]
	mov	x0, x19
	bl	_amdgpu_device_wb_free
LBB0_11:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_SDMA_OPCODE_WRITE,4,2          ; @SDMA_OPCODE_WRITE
	.comm	_SDMA_WRITE_SUB_OPCODE_LINEAR,4,2 ; @SDMA_WRITE_SUB_OPCODE_LINEAR
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_cik_sdma_ring_test_ring
.subsections_via_symbols
