	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function chv_set_memory_dvfs
_chv_set_memory_dvfs:                   ## @chv_set_memory_dvfs
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	callq	_vlv_punit_get
	movq	_PUNIT_REG_DDR_SETUP2@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_vlv_punit_read
	movq	_FORCE_DDR_HIGH_FREQ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %edx
	notl	%edx
	andl	%eax, %edx
	orl	%eax, %ecx
	testl	%r14d, %r14d
	cmovnel	%edx, %ecx
	movq	_FORCE_DDR_LOW_FREQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	andl	%ecx, %edx
	movq	_FORCE_DDR_FREQ_REQ_ACK@GOTPCREL(%rip), %r14
	orl	(%r14), %edx
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_vlv_punit_write
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_vlv_punit_read
	xorl	%edi, %edi
	andl	(%r14), %eax
	sete	%dil
	movl	$3, %esi
	callq	_wait_for
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
LBB0_2:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_vlv_punit_put                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PUNIT_REG_DDR_SETUP2,4,2       ## @PUNIT_REG_DDR_SETUP2
	.comm	_FORCE_DDR_HIGH_FREQ,4,2        ## @FORCE_DDR_HIGH_FREQ
	.comm	_FORCE_DDR_LOW_FREQ,4,2         ## @FORCE_DDR_LOW_FREQ
	.comm	_FORCE_DDR_FREQ_REQ_ACK,4,2     ## @FORCE_DDR_FREQ_REQ_ACK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timed out waiting for Punit DDR DVFS request\n"

	.no_dead_strip	_chv_set_memory_dvfs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function chv_set_memory_dvfs
_chv_set_memory_dvfs:                   ; @chv_set_memory_dvfs
	.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	x20, x1
	mov	x19, x0
	bl	_vlv_punit_get
Lloh0:
	adrp	x21, _PUNIT_REG_DDR_SETUP2@GOTPAGE
Lloh1:
	ldr	x21, [x21, _PUNIT_REG_DDR_SETUP2@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_vlv_punit_read
Lloh2:
	adrp	x8, _FORCE_DDR_HIGH_FREQ@GOTPAGE
Lloh3:
	ldr	x8, [x8, _FORCE_DDR_HIGH_FREQ@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	bic	w9, w0, w8
	orr	w8, w8, w0
	cmp	w20, #0
	csel	w8, w8, w9, eq
Lloh5:
	adrp	x9, _FORCE_DDR_LOW_FREQ@GOTPAGE
Lloh6:
	ldr	x9, [x9, _FORCE_DDR_LOW_FREQ@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	bic	w8, w8, w9
Lloh8:
	adrp	x20, _FORCE_DDR_FREQ_REQ_ACK@GOTPAGE
Lloh9:
	ldr	x20, [x20, _FORCE_DDR_FREQ_REQ_ACK@GOTPAGEOFF]
	ldr	w9, [x20]
	orr	w2, w8, w9
	ldr	w1, [x21]
	mov	x0, x19
	bl	_vlv_punit_write
	ldr	w1, [x21]
	mov	x0, x19
	bl	_vlv_punit_read
	ldr	w8, [x20]
	tst	w8, w0
	cset	w0, eq
	mov	w1, #3
	bl	_wait_for
	cbz	x0, LBB0_2
; %bb.1:
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
LBB0_2:
	mov	x0, x19
	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
	b	_vlv_punit_put
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_PUNIT_REG_DDR_SETUP2,4,2       ; @PUNIT_REG_DDR_SETUP2
	.comm	_FORCE_DDR_HIGH_FREQ,4,2        ; @FORCE_DDR_HIGH_FREQ
	.comm	_FORCE_DDR_LOW_FREQ,4,2         ; @FORCE_DDR_LOW_FREQ
	.comm	_FORCE_DDR_FREQ_REQ_ACK,4,2     ; @FORCE_DDR_FREQ_REQ_ACK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timed out waiting for Punit DDR DVFS request\n"

	.no_dead_strip	_chv_set_memory_dvfs
.subsections_via_symbols
