	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rk3399_dmcfreq_target
_rk3399_dmcfreq_target:                 ## @rk3399_dmcfreq_target
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	movq	%rsi, %rbx
	movq	%rdi, %r15
	callq	_dev_get_drvdata
	movq	%rax, %r14
	movq	(%rax), %r13
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	%r12d, %edx
	callq	_devfreq_recommended_opp
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_1
## %bb.17:
	movq	%rbx, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_1:
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_dev_pm_opp_get_freq
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	_dev_pm_opp_get_voltage
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_dev_pm_opp_put
	xorl	%ebx, %ebx
	cmpq	%r13, (%r14)
	je	LBB0_16
## %bb.2:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %r12
	addq	$24, %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	xorl	%r8d, %r8d
	cmpq	8(%r14), %r13
	setae	%r8b
	movq	_ROCKCHIP_SIP_DRAM_FREQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	36(%r14), %edx
	movl	40(%r14), %esi
	movq	_ROCKCHIP_SIP_CONFIG_DRAM_SET_ODT_PD@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	subq	$8, %rsp
	leaq	-64(%rbp), %rax
	xorl	%r9d, %r9d
	pushq	%rax
	pushq	$0
	pushq	$0
	callq	_arm_smccc_smc
	addq	$32, %rsp
	cmpq	%r13, -56(%rbp)                 ## 8-byte Folded Reload
	jae	LBB0_5
## %bb.3:
	movl	28(%r14), %edi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	%rdx, %rsi
	callq	_regulator_set_voltage
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_15
LBB0_5:
	movl	32(%r14), %edi
	movq	%r13, %rsi
	callq	_clk_set_rate
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movq	%r13, %rdx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_7
LBB0_8:
	movl	32(%r14), %edi
	callq	_clk_get_rate
	movq	%rax, (%r14)
	cmpq	%r13, %rax
	jne	LBB0_9
## %bb.10:
	xorl	%ebx, %ebx
	cmpq	%r13, -56(%rbp)                 ## 8-byte Folded Reload
	jbe	LBB0_13
## %bb.11:
	movl	28(%r14), %edi
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rsi
	movq	%r13, %rdx
	callq	_regulator_set_voltage
	movq	%r13, %rdx
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	testl	%eax, %eax
	je	LBB0_14
## %bb.12:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_13:
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
LBB0_14:
	movq	%r13, (%r14)
	movq	%rdx, 16(%r14)
	jmp	LBB0_15
LBB0_9:
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	movq	%r13, %rdx
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_7:
	movl	28(%r14), %edi
	movq	16(%r14), %rdx
	movq	%rdx, %rsi
	callq	_regulator_set_voltage
LBB0_15:
	movq	%r12, %rdi
	callq	_mutex_unlock
LBB0_16:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ROCKCHIP_SIP_DRAM_FREQ,4,2     ## @ROCKCHIP_SIP_DRAM_FREQ
	.comm	_ROCKCHIP_SIP_CONFIG_DRAM_SET_ODT_PD,4,2 ## @ROCKCHIP_SIP_CONFIG_DRAM_SET_ODT_PD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot set voltage %lu uV\n"

L_.str.1:                               ## @.str.1
	.asciz	"Cannot set frequency %lu (%d)\n"

L_.str.2:                               ## @.str.2
	.asciz	"Got wrong frequency, Request %lu, Current %lu\n"

	.no_dead_strip	_rk3399_dmcfreq_target
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rk3399_dmcfreq_target
_rk3399_dmcfreq_target:                 ; @rk3399_dmcfreq_target
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x2
	mov	x22, x1
	mov	x21, x0
	bl	_dev_get_drvdata
	mov	x19, x0
	ldr	x25, [x0]
	mov	x0, x21
	mov	x1, x22
	mov	x2, x20
	bl	_devfreq_recommended_opp
	mov	x20, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_PTR_ERR
LBB0_2:
	mov	x0, x20
	bl	_dev_pm_opp_get_freq
	mov	x22, x0
	mov	x0, x20
	bl	_dev_pm_opp_get_voltage
	mov	x23, x0
	mov	x0, x20
	bl	_dev_pm_opp_put
	ldr	x8, [x19]
	cmp	x8, x22
	b.ne	LBB0_4
; %bb.3:
	mov	w24, #0
	b	LBB0_17
LBB0_4:
	add	x20, x19, #24
	mov	x0, x20
	bl	_mutex_lock
	ldr	x8, [x19, #8]
	cmp	x22, x8
	cset	w4, hs
Lloh0:
	adrp	x8, _ROCKCHIP_SIP_DRAM_FREQ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ROCKCHIP_SIP_DRAM_FREQ@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldp	w2, w1, [x19, #36]
Lloh3:
	adrp	x8, _ROCKCHIP_SIP_CONFIG_DRAM_SET_ODT_PD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ROCKCHIP_SIP_CONFIG_DRAM_SET_ODT_PD@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	add	x8, sp, #8
	str	x8, [sp]
	mov	w5, #0
	mov	w6, #0
	mov	w7, #0
	bl	_arm_smccc_smc
	cmp	x25, x22
	b.hs	LBB0_7
; %bb.5:
	ldr	w0, [x19, #28]
	mov	x1, x23
	mov	x2, x23
	bl	_regulator_set_voltage
	cbz	w0, LBB0_7
; %bb.6:
	mov	x24, x0
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x23
	bl	_dev_err
	b	LBB0_16
LBB0_7:
	ldr	w0, [x19, #32]
	mov	x1, x22
	bl	_clk_set_rate
	cbz	w0, LBB0_9
; %bb.8:
	mov	x24, x0
	str	x24, [sp]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	mov	x2, x22
	bl	_dev_err
	ldr	w0, [x19, #28]
	ldr	x1, [x19, #16]
	mov	x2, x1
	bl	_regulator_set_voltage
	b	LBB0_16
LBB0_9:
	ldr	w0, [x19, #32]
	bl	_clk_get_rate
	str	x0, [x19]
	cmp	x0, x22
	b.ne	LBB0_13
; %bb.10:
	cmp	x25, x22
	b.ls	LBB0_14
; %bb.11:
	ldr	w0, [x19, #28]
	mov	x1, x23
	mov	x2, x23
	bl	_regulator_set_voltage
	mov	x24, x0
	cbz	w0, LBB0_15
; %bb.12:
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x23
	bl	_dev_err
	b	LBB0_15
LBB0_13:
	str	x0, [sp]
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	mov	x2, x22
	bl	_dev_err
	ldr	w0, [x19, #28]
	ldr	x1, [x19, #16]
	mov	x2, x1
	bl	_regulator_set_voltage
	mov	w24, #0
	b	LBB0_16
LBB0_14:
	mov	w24, #0
LBB0_15:
	str	x22, [x19]
	str	x23, [x19, #16]
LBB0_16:
	mov	x0, x20
	bl	_mutex_unlock
LBB0_17:
	mov	x0, x24
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_ROCKCHIP_SIP_DRAM_FREQ,4,2     ; @ROCKCHIP_SIP_DRAM_FREQ
	.comm	_ROCKCHIP_SIP_CONFIG_DRAM_SET_ODT_PD,4,2 ; @ROCKCHIP_SIP_CONFIG_DRAM_SET_ODT_PD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot set voltage %lu uV\n"

l_.str.1:                               ; @.str.1
	.asciz	"Cannot set frequency %lu (%d)\n"

l_.str.2:                               ; @.str.2
	.asciz	"Got wrong frequency, Request %lu, Current %lu\n"

	.no_dead_strip	_rk3399_dmcfreq_target
.subsections_via_symbols
