	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kgd_hqd_sdma_dump
_kgd_hqd_sdma_dump:                     ## @kgd_hqd_sdma_dump
	.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	%r8, -48(%rbp)                  ## 8-byte Spill
	movq	%rcx, %rbx
	movq	%rdx, %r13
	movq	%rsi, %r14
	callq	_get_amdgpu_device
	movq	%rax, %rdi
	movq	%r14, %rsi
	movq	%r13, %rdx
	callq	_get_sdma_base_addr
	movq	%rax, %r15
	leaq	L_.str(%rip), %rdi
	xorl	%r12d, %r12d
	movq	%r14, %rsi
	movq	%r13, %rdx
	xorl	%eax, %eax
	callq	_pr_debug
	leaq	L_.str.1(%rip), %rdi
	movq	%r15, %rsi
	xorl	%eax, %eax
	callq	_pr_debug
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$672, %edi                      ## imm = 0x2A0
	callq	_kmalloc
	movq	%rax, (%rbx)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	_mmSDMA0_RLC0_RB_CNTL@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	_mmSDMA0_RLC0_DOORBELL@GOTPCREL(%rip), %r14
	cmpq	(%r14), %rbx
	jg	LBB0_4
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	leaq	(%r15,%rbx), %rdi
	callq	_DUMP_REG
	leaq	1(%rbx), %rax
	cmpq	(%r14), %rbx
	movq	%rax, %rbx
	jl	LBB0_3
LBB0_4:
	movq	_mmSDMA0_RLC0_STATUS@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	_mmSDMA0_RLC0_CSA_ADDR_HI@GOTPCREL(%rip), %r14
	cmpq	(%r14), %rbx
	jg	LBB0_6
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	leaq	(%r15,%rbx), %rdi
	callq	_DUMP_REG
	leaq	1(%rbx), %rax
	cmpq	(%r14), %rbx
	movq	%rax, %rbx
	jl	LBB0_5
LBB0_6:
	movq	_mmSDMA0_RLC0_IB_SUB_REMAIN@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	_mmSDMA0_RLC0_MINOR_PTR_UPDATE@GOTPCREL(%rip), %r14
	cmpq	(%r14), %rbx
	jg	LBB0_8
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	leaq	(%r15,%rbx), %rdi
	callq	_DUMP_REG
	leaq	1(%rbx), %rax
	cmpq	(%r14), %rbx
	movq	%rax, %rbx
	jl	LBB0_7
LBB0_8:
	movq	_mmSDMA0_RLC0_MIDCMD_DATA0@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	_mmSDMA0_RLC0_MIDCMD_CNTL@GOTPCREL(%rip), %r14
	cmpq	(%r14), %rbx
	jg	LBB0_10
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	leaq	(%r15,%rbx), %rdi
	callq	_DUMP_REG
	leaq	1(%rbx), %rax
	cmpq	(%r14), %rbx
	movq	%rax, %rbx
	jl	LBB0_9
LBB0_10:
	movl	$1, %edi
	callq	_WARN_ON_ONCE
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	$0, (%rax)
	xorl	%r12d, %r12d
	jmp	LBB0_11
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
LBB0_11:
	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	"sdma dump engine id %d queue_id %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"sdma base addr %x\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_mmSDMA0_RLC0_RB_CNTL,8,3       ## @mmSDMA0_RLC0_RB_CNTL
	.comm	_mmSDMA0_RLC0_DOORBELL,8,3      ## @mmSDMA0_RLC0_DOORBELL
	.comm	_mmSDMA0_RLC0_STATUS,8,3        ## @mmSDMA0_RLC0_STATUS
	.comm	_mmSDMA0_RLC0_CSA_ADDR_HI,8,3   ## @mmSDMA0_RLC0_CSA_ADDR_HI
	.comm	_mmSDMA0_RLC0_IB_SUB_REMAIN,8,3 ## @mmSDMA0_RLC0_IB_SUB_REMAIN
	.comm	_mmSDMA0_RLC0_MINOR_PTR_UPDATE,8,3 ## @mmSDMA0_RLC0_MINOR_PTR_UPDATE
	.comm	_mmSDMA0_RLC0_MIDCMD_DATA0,8,3  ## @mmSDMA0_RLC0_MIDCMD_DATA0
	.comm	_mmSDMA0_RLC0_MIDCMD_CNTL,8,3   ## @mmSDMA0_RLC0_MIDCMD_CNTL
	.comm	_HQD_N_REGS,4,2                 ## @HQD_N_REGS
	.no_dead_strip	_kgd_hqd_sdma_dump
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kgd_hqd_sdma_dump
_kgd_hqd_sdma_dump:                     ; @kgd_hqd_sdma_dump
	.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	x19, x4
	mov	x21, x3
	mov	x22, x2
	mov	x23, x1
	bl	_get_amdgpu_device
	mov	x1, x23
	mov	x2, x22
	bl	_get_sdma_base_addr
	mov	x20, x0
	str	x22, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x23
	bl	_pr_debug
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_pr_debug
Lloh4:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	w0, #672
	bl	_kmalloc
	str	x0, [x21]
	cbz	x0, LBB0_10
; %bb.1:
Lloh7:
	adrp	x8, _mmSDMA0_RLC0_RB_CNTL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _mmSDMA0_RLC0_RB_CNTL@GOTPAGEOFF]
Lloh9:
	ldr	x22, [x8]
Lloh10:
	adrp	x21, _mmSDMA0_RLC0_DOORBELL@GOTPAGE
Lloh11:
	ldr	x21, [x21, _mmSDMA0_RLC0_DOORBELL@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x22, x8
	b.gt	LBB0_3
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, x20, x22
	bl	_DUMP_REG
	add	x8, x22, #1
	ldr	x9, [x21]
	cmp	x22, x9
	mov	x22, x8
	b.lt	LBB0_2
LBB0_3:
Lloh12:
	adrp	x8, _mmSDMA0_RLC0_STATUS@GOTPAGE
Lloh13:
	ldr	x8, [x8, _mmSDMA0_RLC0_STATUS@GOTPAGEOFF]
Lloh14:
	ldr	x22, [x8]
Lloh15:
	adrp	x21, _mmSDMA0_RLC0_CSA_ADDR_HI@GOTPAGE
Lloh16:
	ldr	x21, [x21, _mmSDMA0_RLC0_CSA_ADDR_HI@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x22, x8
	b.gt	LBB0_5
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, x20, x22
	bl	_DUMP_REG
	add	x8, x22, #1
	ldr	x9, [x21]
	cmp	x22, x9
	mov	x22, x8
	b.lt	LBB0_4
LBB0_5:
Lloh17:
	adrp	x8, _mmSDMA0_RLC0_IB_SUB_REMAIN@GOTPAGE
Lloh18:
	ldr	x8, [x8, _mmSDMA0_RLC0_IB_SUB_REMAIN@GOTPAGEOFF]
Lloh19:
	ldr	x22, [x8]
Lloh20:
	adrp	x21, _mmSDMA0_RLC0_MINOR_PTR_UPDATE@GOTPAGE
Lloh21:
	ldr	x21, [x21, _mmSDMA0_RLC0_MINOR_PTR_UPDATE@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x22, x8
	b.gt	LBB0_7
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, x20, x22
	bl	_DUMP_REG
	add	x8, x22, #1
	ldr	x9, [x21]
	cmp	x22, x9
	mov	x22, x8
	b.lt	LBB0_6
LBB0_7:
Lloh22:
	adrp	x8, _mmSDMA0_RLC0_MIDCMD_DATA0@GOTPAGE
Lloh23:
	ldr	x8, [x8, _mmSDMA0_RLC0_MIDCMD_DATA0@GOTPAGEOFF]
Lloh24:
	ldr	x22, [x8]
Lloh25:
	adrp	x21, _mmSDMA0_RLC0_MIDCMD_CNTL@GOTPAGE
Lloh26:
	ldr	x21, [x21, _mmSDMA0_RLC0_MIDCMD_CNTL@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x22, x8
	b.gt	LBB0_9
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, x20, x22
	bl	_DUMP_REG
	add	x8, x22, #1
	ldr	x9, [x21]
	cmp	x22, x9
	mov	x22, x8
	b.lt	LBB0_8
LBB0_9:
	mov	w0, #1
	bl	_WARN_ON_ONCE
	mov	w0, #0
	str	xzr, [x19]
	b	LBB0_11
LBB0_10:
Lloh27:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	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	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sdma dump engine id %d queue_id %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"sdma base addr %x\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_mmSDMA0_RLC0_RB_CNTL,8,3       ; @mmSDMA0_RLC0_RB_CNTL
	.comm	_mmSDMA0_RLC0_DOORBELL,8,3      ; @mmSDMA0_RLC0_DOORBELL
	.comm	_mmSDMA0_RLC0_STATUS,8,3        ; @mmSDMA0_RLC0_STATUS
	.comm	_mmSDMA0_RLC0_CSA_ADDR_HI,8,3   ; @mmSDMA0_RLC0_CSA_ADDR_HI
	.comm	_mmSDMA0_RLC0_IB_SUB_REMAIN,8,3 ; @mmSDMA0_RLC0_IB_SUB_REMAIN
	.comm	_mmSDMA0_RLC0_MINOR_PTR_UPDATE,8,3 ; @mmSDMA0_RLC0_MINOR_PTR_UPDATE
	.comm	_mmSDMA0_RLC0_MIDCMD_DATA0,8,3  ; @mmSDMA0_RLC0_MIDCMD_DATA0
	.comm	_mmSDMA0_RLC0_MIDCMD_CNTL,8,3   ; @mmSDMA0_RLC0_MIDCMD_CNTL
	.comm	_HQD_N_REGS,4,2                 ; @HQD_N_REGS
	.no_dead_strip	_kgd_hqd_sdma_dump
.subsections_via_symbols
