	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdma_v3_0_update_sdma_medium_grain_light_sleep
_sdma_v3_0_update_sdma_medium_grain_light_sleep: ## @sdma_v3_0_update_sdma_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	%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
	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	_sdma_offsets@GOTPCREL(%rip), %r12
	movq	_SDMA0_POWER_CNTL__MEM_POWER_OVERRIDE_MASK@GOTPCREL(%rip), %r13
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%rbx
	movslq	4(%r14), %rax
	cmpq	%rax, %rbx
	jge	LBB0_12
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	addq	(%r15), %rdi
	callq	_RREG32
	movl	(%r13), %esi
	orl	%eax, %esi
	cmpl	%esi, %eax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	addq	(%r15), %rdi
	callq	_WREG32
	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	_sdma_offsets@GOTPCREL(%rip), %r12
	movq	_SDMA0_POWER_CNTL__MEM_POWER_OVERRIDE_MASK@GOTPCREL(%rip), %r13
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	incq	%rbx
	movslq	4(%r14), %rax
	cmpq	%rax, %rbx
	jge	LBB0_12
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	addq	(%r15), %rdi
	callq	_RREG32
	movl	(%r13), %esi
	notl	%esi
	andl	%eax, %esi
	cmpl	%esi, %eax
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	addq	(%r15), %rdi
	callq	_WREG32
	jmp	LBB0_11
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	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,8,3         ## @mmSDMA0_POWER_CNTL
	.comm	_sdma_offsets,8,3               ## @sdma_offsets
	.comm	_SDMA0_POWER_CNTL__MEM_POWER_OVERRIDE_MASK,4,2 ## @SDMA0_POWER_CNTL__MEM_POWER_OVERRIDE_MASK
	.no_dead_strip	_sdma_v3_0_update_sdma_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_v3_0_update_sdma_medium_grain_light_sleep
_sdma_v3_0_update_sdma_medium_grain_light_sleep: ; @sdma_v3_0_update_sdma_medium_grain_light_sleep
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, 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	x20, #0
Lloh3:
	adrp	x21, _mmSDMA0_POWER_CNTL@GOTPAGE
Lloh4:
	ldr	x21, [x21, _mmSDMA0_POWER_CNTL@GOTPAGEOFF]
Lloh5:
	adrp	x22, _sdma_offsets@GOTPAGE
Lloh6:
	ldr	x22, [x22, _sdma_offsets@GOTPAGEOFF]
Lloh7:
	adrp	x23, _SDMA0_POWER_CNTL__MEM_POWER_OVERRIDE_MASK@GOTPAGE
Lloh8:
	ldr	x23, [x23, _SDMA0_POWER_CNTL__MEM_POWER_OVERRIDE_MASK@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x20, x20, #1
	ldrsw	x8, [x19, #4]
	cmp	x20, x8
	b.ge	LBB0_12
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
	ldr	x9, [x22]
	ldr	x9, [x9, x20, lsl #3]
	add	x0, x9, x8
	bl	_RREG32
	ldr	w8, [x23]
	orr	w1, w8, w0
	cmp	w0, w1
	b.eq	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x21]
	ldr	x9, [x22]
	ldr	x9, [x9, x20, lsl #3]
	add	x0, x9, x8
	bl	_WREG32
	b	LBB0_4
LBB0_7:
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.8:
	mov	x20, #0
Lloh9:
	adrp	x21, _mmSDMA0_POWER_CNTL@GOTPAGE
Lloh10:
	ldr	x21, [x21, _mmSDMA0_POWER_CNTL@GOTPAGEOFF]
Lloh11:
	adrp	x22, _sdma_offsets@GOTPAGE
Lloh12:
	ldr	x22, [x22, _sdma_offsets@GOTPAGEOFF]
Lloh13:
	adrp	x23, _SDMA0_POWER_CNTL__MEM_POWER_OVERRIDE_MASK@GOTPAGE
Lloh14:
	ldr	x23, [x23, _SDMA0_POWER_CNTL__MEM_POWER_OVERRIDE_MASK@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x20, x20, #1
	ldrsw	x8, [x19, #4]
	cmp	x20, x8
	b.ge	LBB0_12
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
	ldr	x9, [x22]
	ldr	x9, [x9, x20, lsl #3]
	add	x0, x9, x8
	bl	_RREG32
	ldr	w8, [x23]
	bic	w1, w0, w8
	cmp	w0, w1
	b.eq	LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [x21]
	ldr	x9, [x22]
	ldr	x9, [x9, x20, lsl #3]
	add	x0, x9, x8
	bl	_WREG32
	b	LBB0_9
LBB0_12:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_AMD_CG_SUPPORT_SDMA_LS,4,2     ; @AMD_CG_SUPPORT_SDMA_LS
	.comm	_mmSDMA0_POWER_CNTL,8,3         ; @mmSDMA0_POWER_CNTL
	.comm	_sdma_offsets,8,3               ; @sdma_offsets
	.comm	_SDMA0_POWER_CNTL__MEM_POWER_OVERRIDE_MASK,4,2 ; @SDMA0_POWER_CNTL__MEM_POWER_OVERRIDE_MASK
	.no_dead_strip	_sdma_v3_0_update_sdma_medium_grain_light_sleep
.subsections_via_symbols
