	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdma_v4_0_update_medium_grain_light_sleep
_sdma_v4_0_update_medium_grain_light_sleep: ## @sdma_v4_0_update_medium_grain_light_sleep
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	testl	%esi, %esi
	je	LBB0_7
## %bb.1:
	movq	_AMD_CG_SUPPORT_SDMA_LS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_7
## %bb.2:
	cmpl	$0, 4(%r14)
	jle	LBB0_12
## %bb.3:
	xorl	%ebx, %ebx
	movq	_mmSDMA0_POWER_CNTL@GOTPCREL(%rip), %r15
	movq	_SDMA0_POWER_CNTL__MEM_POWER_OVERRIDE_MASK@GOTPCREL(%rip), %r12
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	incl	%ebx
	cmpl	4(%r14), %ebx
	jge	LBB0_12
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	xorl	%edi, %edi
	callq	_RREG32_SDMA
	movl	(%r12), %edx
	orl	%eax, %edx
	cmpl	%edx, %eax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r15), %esi
	xorl	%edi, %edi
	callq	_WREG32_SDMA
	jmp	LBB0_6
LBB0_7:
	cmpl	$0, 4(%r14)
	jle	LBB0_12
## %bb.8:
	xorl	%ebx, %ebx
	movq	_mmSDMA0_POWER_CNTL@GOTPCREL(%rip), %r15
	movq	_SDMA0_POWER_CNTL__MEM_POWER_OVERRIDE_MASK@GOTPCREL(%rip), %r12
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	incl	%ebx
	cmpl	4(%r14), %ebx
	jge	LBB0_12
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	xorl	%edi, %edi
	callq	_RREG32_SDMA
	movl	(%r12), %edx
	notl	%edx
	andl	%eax, %edx
	cmpl	%edx, %eax
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	(%r15), %esi
	xorl	%edi, %edi
	callq	_WREG32_SDMA
	jmp	LBB0_11
LBB0_12:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AMD_CG_SUPPORT_SDMA_LS,4,2     ## @AMD_CG_SUPPORT_SDMA_LS
	.comm	_mmSDMA0_POWER_CNTL,4,2         ## @mmSDMA0_POWER_CNTL
	.comm	_SDMA0_POWER_CNTL__MEM_POWER_OVERRIDE_MASK,4,2 ## @SDMA0_POWER_CNTL__MEM_POWER_OVERRIDE_MASK
	.no_dead_strip	_sdma_v4_0_update_medium_grain_light_sleep
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sdma_v4_0_update_medium_grain_light_sleep
_sdma_v4_0_update_medium_grain_light_sleep: ; @sdma_v4_0_update_medium_grain_light_sleep
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
	cbz	w1, LBB0_7
; %bb.1:
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _AMD_CG_SUPPORT_SDMA_LS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AMD_CG_SUPPORT_SDMA_LS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.2:
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.3:
	mov	w20, #0
Lloh3:
	adrp	x21, _mmSDMA0_POWER_CNTL@GOTPAGE
Lloh4:
	ldr	x21, [x21, _mmSDMA0_POWER_CNTL@GOTPAGEOFF]
Lloh5:
	adrp	x22, _SDMA0_POWER_CNTL__MEM_POWER_OVERRIDE_MASK@GOTPAGE
Lloh6:
	ldr	x22, [x22, _SDMA0_POWER_CNTL__MEM_POWER_OVERRIDE_MASK@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w20, w20, #1
	ldr	w8, [x19, #4]
	cmp	w20, w8
	b.ge	LBB0_12
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	mov	w0, #0
	bl	_RREG32_SDMA
	ldr	w8, [x22]
	orr	w2, w8, w0
	cmp	w0, w2
	b.eq	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w1, [x21]
	mov	w0, #0
	bl	_WREG32_SDMA
	b	LBB0_4
LBB0_7:
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.8:
	mov	w20, #0
Lloh7:
	adrp	x21, _mmSDMA0_POWER_CNTL@GOTPAGE
Lloh8:
	ldr	x21, [x21, _mmSDMA0_POWER_CNTL@GOTPAGEOFF]
Lloh9:
	adrp	x22, _SDMA0_POWER_CNTL__MEM_POWER_OVERRIDE_MASK@GOTPAGE
Lloh10:
	ldr	x22, [x22, _SDMA0_POWER_CNTL__MEM_POWER_OVERRIDE_MASK@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	w20, w20, #1
	ldr	w8, [x19, #4]
	cmp	w20, w8
	b.ge	LBB0_12
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	mov	w0, #0
	bl	_RREG32_SDMA
	ldr	w8, [x22]
	bic	w2, w0, w8
	cmp	w0, w2
	b.eq	LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w1, [x21]
	mov	w0, #0
	bl	_WREG32_SDMA
	b	LBB0_9
LBB0_12:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_AMD_CG_SUPPORT_SDMA_LS,4,2     ; @AMD_CG_SUPPORT_SDMA_LS
	.comm	_mmSDMA0_POWER_CNTL,4,2         ; @mmSDMA0_POWER_CNTL
	.comm	_SDMA0_POWER_CNTL__MEM_POWER_OVERRIDE_MASK,4,2 ; @SDMA0_POWER_CNTL__MEM_POWER_OVERRIDE_MASK
	.no_dead_strip	_sdma_v4_0_update_medium_grain_light_sleep
.subsections_via_symbols
