	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pcc_cpufreq_target
_pcc_cpufreq_target:                    ## @pcc_cpufreq_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r13d
	movq	%rdi, %rbx
	movq	_pcc_lock@GOTPCREL(%rip), %rdi
	callq	_spin_lock
	movl	(%rbx), %r15d
	movq	_pcc_cpu_info@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r15d, %esi
	callq	_per_cpu_ptr
	movq	%rax, %r12
	movq	_pcch_virt_addr@GOTPCREL(%rip), %r14
	movq	(%rax), %rcx
	addq	(%r14), %rcx
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_dprintk
	movl	%r13d, -48(%rbp)
	movl	%r15d, -44(%rbp)
	movq	_CPUFREQ_PRECHANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdi
	callq	_cpufreq_notify_transition
	imull	$100, %r13d, %ebx
	movq	_pcch_hdr@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	addq	$8, %rdi
	callq	_ioread32
	imull	$1000, %eax, %ecx               ## imm = 0x3E8
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
	shll	$8, %eax
	leal	1(%rax), %edi
	movq	(%r12), %rsi
	addq	(%r14), %rsi
	callq	_iowrite32
	movq	_CMD_SET_FREQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r13), %rsi
	addq	$4, %rsi
	callq	_iowrite16
	xorl	%eax, %eax
	callq	_pcc_cmd
	movq	(%r12), %rdi
	addq	(%r14), %rdi
	movq	_BUF_SZ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_memset_io
	movq	(%r13), %rdi
	callq	_ioread16
	movq	_CMD_COMPLETE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_1
## %bb.2:
	movq	(%r13), %rsi
	xorl	%edi, %edi
	callq	_iowrite16
	movq	_CPUFREQ_POSTCHANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdi
	callq	_cpufreq_notify_transition
	leaq	L_.str.2(%rip), %rdi
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_dprintk
	movq	_pcc_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock
	xorl	%eax, %eax
	jmp	LBB0_3
LBB0_1:
	leaq	L_.str.1(%rip), %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dprintk
	movq	(%r13), %rsi
	xorl	%edi, %edi
	callq	_iowrite16
	movq	_pcc_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, %eax
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_pcc_lock,4,2                   ## @pcc_lock
	.comm	_pcc_cpu_info,4,2               ## @pcc_cpu_info
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"target: CPU %d should go to target freq: %d (virtual) input_offset is 0x%x\n"

	.comm	_pcch_virt_addr,8,3             ## @pcch_virt_addr
	.comm	_CPUFREQ_PRECHANGE,4,2          ## @CPUFREQ_PRECHANGE
	.comm	_pcch_hdr,8,3                   ## @pcch_hdr
	.comm	_CMD_SET_FREQ,4,2               ## @CMD_SET_FREQ
	.comm	_BUF_SZ,4,2                     ## @BUF_SZ
	.comm	_CMD_COMPLETE,4,2               ## @CMD_COMPLETE
L_.str.1:                               ## @.str.1
	.asciz	"target: FAILED for cpu %d, with status: 0x%x\n"

	.comm	_CPUFREQ_POSTCHANGE,4,2         ## @CPUFREQ_POSTCHANGE
L_.str.2:                               ## @.str.2
	.asciz	"target: was SUCCESSFUL for cpu %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_pcc_cpufreq_target
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pcc_cpufreq_target
_pcc_cpufreq_target:                    ; @pcc_cpufreq_target
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x0, _pcc_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _pcc_lock@GOTPAGEOFF]
	bl	_spin_lock
	ldr	w19, [x19]
Lloh2:
	adrp	x8, _pcc_cpu_info@GOTPAGE
Lloh3:
	ldr	x8, [x8, _pcc_cpu_info@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_per_cpu_ptr
	mov	x20, x0
Lloh5:
	adrp	x22, _pcch_virt_addr@GOTPAGE
Lloh6:
	ldr	x22, [x22, _pcch_virt_addr@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	x9, [x0]
	add	x8, x9, x8
	stp	x21, x8, [sp]
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_dprintk
	stp	w21, w19, [sp, #24]
Lloh9:
	adrp	x8, _CPUFREQ_PRECHANGE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CPUFREQ_PRECHANGE@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	add	x0, sp, #24
	bl	_cpufreq_notify_transition
	mov	w8, #100
	mul	w23, w21, w8
Lloh12:
	adrp	x21, _pcch_hdr@GOTPAGE
Lloh13:
	ldr	x21, [x21, _pcch_hdr@GOTPAGEOFF]
	ldr	x8, [x21]
	add	x0, x8, #8
	bl	_ioread32
	mov	w8, #1000
	mul	w8, w0, w8
	udiv	w8, w23, w8
	mov	w0, #1
	bfi	w0, w8, #8, #24
	ldr	x8, [x22]
	ldr	x9, [x20]
	add	x1, x9, x8
	bl	_iowrite32
Lloh14:
	adrp	x8, _CMD_SET_FREQ@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CMD_SET_FREQ@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	ldr	x8, [x21]
	add	x1, x8, #4
	bl	_iowrite16
	bl	_pcc_cmd
	ldr	x8, [x22]
	ldr	x9, [x20]
	add	x0, x9, x8
Lloh17:
	adrp	x8, _BUF_SZ@GOTPAGE
Lloh18:
	ldr	x8, [x8, _BUF_SZ@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_memset_io
	ldr	x0, [x21]
	bl	_ioread16
                                        ; kill: def $w0 killed $w0 def $x0
Lloh20:
	adrp	x8, _CMD_COMPLETE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _CMD_COMPLETE@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_2
; %bb.1:
	ldr	x1, [x21]
	mov	w0, #0
	bl	_iowrite16
Lloh23:
	adrp	x8, _CPUFREQ_POSTCHANGE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _CPUFREQ_POSTCHANGE@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	add	x0, sp, #24
	bl	_cpufreq_notify_transition
Lloh26:
	adrp	x0, l_.str.2@PAGE
Lloh27:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x19
	bl	_dprintk
Lloh28:
	adrp	x0, _pcc_lock@GOTPAGE
Lloh29:
	ldr	x0, [x0, _pcc_lock@GOTPAGEOFF]
	bl	_spin_unlock
	mov	w0, #0
	b	LBB0_3
LBB0_2:
	str	x0, [sp]
Lloh30:
	adrp	x0, l_.str.1@PAGE
Lloh31:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_dprintk
	ldr	x1, [x21]
	mov	w0, #0
	bl	_iowrite16
Lloh32:
	adrp	x0, _pcc_lock@GOTPAGE
Lloh33:
	ldr	x0, [x0, _pcc_lock@GOTPAGEOFF]
	bl	_spin_unlock
Lloh34:
	adrp	x8, _EINVAL@GOTPAGE
Lloh35:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_pcc_lock,4,2                   ; @pcc_lock
	.comm	_pcc_cpu_info,4,2               ; @pcc_cpu_info
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"target: CPU %d should go to target freq: %d (virtual) input_offset is 0x%x\n"

	.comm	_pcch_virt_addr,8,3             ; @pcch_virt_addr
	.comm	_CPUFREQ_PRECHANGE,4,2          ; @CPUFREQ_PRECHANGE
	.comm	_pcch_hdr,8,3                   ; @pcch_hdr
	.comm	_CMD_SET_FREQ,4,2               ; @CMD_SET_FREQ
	.comm	_BUF_SZ,4,2                     ; @BUF_SZ
	.comm	_CMD_COMPLETE,4,2               ; @CMD_COMPLETE
l_.str.1:                               ; @.str.1
	.asciz	"target: FAILED for cpu %d, with status: 0x%x\n"

	.comm	_CPUFREQ_POSTCHANGE,4,2         ; @CPUFREQ_POSTCHANGE
l_.str.2:                               ; @.str.2
	.asciz	"target: was SUCCESSFUL for cpu %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_pcc_cpufreq_target
.subsections_via_symbols
