	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_sdma_get_csa_mc_addr    ## -- Begin function amdgpu_sdma_get_csa_mc_addr
	.p2align	4, 0x90
_amdgpu_sdma_get_csa_mc_addr:           ## @amdgpu_sdma_get_csa_mc_addr
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	(%rdi), %rbx
	movl	$0, -12(%rbp)
	xorl	%eax, %eax
	testl	%esi, %esi
	je	LBB0_5
## %bb.1:
	movq	_amdgpu_mcbp@GOTPCREL(%rip), %rcx
	cmpl	$0, (%rcx)
	je	LBB0_5
## %bb.2:
	leaq	-12(%rbp), %rsi
	callq	_amdgpu_sdma_get_index_from_ring
	movl	%eax, %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	jne	LBB0_5
## %bb.3:
	cmpl	$31, -12(%rbp)
	jg	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	callq	_amdgpu_csa_vaddr
	movq	%rax, %rcx
	movq	_AMDGPU_CSA_SDMA_OFFSET@GOTPCREL(%rip), %rax
	addq	(%rax), %rcx
	movslq	-12(%rbp), %rdx
	movq	_AMDGPU_CSA_SDMA_SIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	imulq	%rdx, %rax
	addq	%rcx, %rax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_amdgpu_mcbp,4,2                ## @amdgpu_mcbp
	.comm	_AMDGPU_CSA_SDMA_OFFSET,8,3     ## @AMDGPU_CSA_SDMA_OFFSET
	.comm	_AMDGPU_CSA_SDMA_SIZE,4,2       ## @AMDGPU_CSA_SDMA_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_sdma_get_csa_mc_addr    ; -- Begin function amdgpu_sdma_get_csa_mc_addr
	.p2align	2
_amdgpu_sdma_get_csa_mc_addr:           ; @amdgpu_sdma_get_csa_mc_addr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x8, x0
	mov	x0, #0
	ldr	x19, [x8]
	str	wzr, [sp, #12]
	cbz	w1, LBB0_5
; %bb.1:
Lloh0:
	adrp	x9, _amdgpu_mcbp@GOTPAGE
Lloh1:
	ldr	x9, [x9, _amdgpu_mcbp@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cbz	w9, LBB0_5
; %bb.2:
	add	x1, sp, #12
	mov	x0, x8
	bl	_amdgpu_sdma_get_index_from_ring
	mov	x8, x0
	mov	x0, #0
	cbnz	w8, LBB0_5
; %bb.3:
	ldr	w8, [sp, #12]
	cmp	w8, #31
	b.gt	LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_amdgpu_csa_vaddr
Lloh3:
	adrp	x8, _AMDGPU_CSA_SDMA_OFFSET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AMDGPU_CSA_SDMA_OFFSET@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	add	x8, x8, x0
	ldrsw	x9, [sp, #12]
Lloh6:
	adrp	x10, _AMDGPU_CSA_SDMA_SIZE@GOTPAGE
Lloh7:
	ldr	x10, [x10, _AMDGPU_CSA_SDMA_SIZE@GOTPAGEOFF]
Lloh8:
	ldrsw	x10, [x10]
	madd	x0, x10, x9, x8
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_amdgpu_mcbp,4,2                ; @amdgpu_mcbp
	.comm	_AMDGPU_CSA_SDMA_OFFSET,8,3     ; @AMDGPU_CSA_SDMA_OFFSET
	.comm	_AMDGPU_CSA_SDMA_SIZE,4,2       ; @AMDGPU_CSA_SDMA_SIZE
.subsections_via_symbols
