	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpufreq_p4_setdc
_cpufreq_p4_setdc:                      ## @cpufreq_p4_setdc
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movl	%edi, %r14d
	callq	_cpu_online
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movq	_DC_DISABLE@GOTPCREL(%rip), %r15
	cmpl	%ebx, (%r15)
	jb	LBB0_3
## %bb.2:
	movq	_DC_RESV@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	je	LBB0_3
## %bb.4:
	movq	_MSR_IA32_THERM_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rcx
	movl	%r14d, %edi
	callq	_rdmsr_on_cpu
	testb	$1, -36(%rbp)
	je	LBB0_6
## %bb.5:
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_dprintk
LBB0_6:
	movq	_has_N44_O17_errata@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%r14d, %ecx
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_8
## %bb.7:
	movq	_DC_25PT@GOTPCREL(%rip), %rax
	movq	_DC_DFLT@GOTPCREL(%rip), %rcx
	cmpl	%ebx, (%rcx)
	movq	_DC_38PT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ebx, %edx
	cmovel	%ecx, %edx
	cmpl	%ebx, (%rax)
	cmovel	%ecx, %edx
	movl	%edx, %ebx
LBB0_8:
	movq	_MSR_IA32_THERM_CONTROL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rcx
	movl	%r14d, %edi
	callq	_rdmsr_on_cpu
	cmpl	(%r15), %ebx
	jne	LBB0_10
## %bb.9:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r15d, %r15d
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_dprintk
	movl	(%r12), %esi
	movl	-36(%rbp), %edx
	andl	$-17, %edx
	jmp	LBB0_11
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_12
LBB0_10:
	imull	$125, %ebx, %eax
	movl	$3435973837, %edx               ## imm = 0xCCCCCCCD
	imulq	%rax, %rdx
	shrq	$35, %rdx
	leaq	L_.str.2(%rip), %rdi
	xorl	%r15d, %r15d
	movl	%r14d, %esi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_dprintk
	movl	-36(%rbp), %eax
	andl	$-31, %eax
	andl	$7, %ebx
	leal	(%rax,%rbx,2), %edx
	addl	$16, %edx
	movl	%edx, -36(%rbp)
	movl	(%r12), %esi
LBB0_11:
	movl	-40(%rbp), %ecx
	movl	%r14d, %edi
	callq	_wrmsr_on_cpu
LBB0_12:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DC_DISABLE,4,2                 ## @DC_DISABLE
	.comm	_DC_RESV,4,2                    ## @DC_RESV
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MSR_IA32_THERM_STATUS,4,2      ## @MSR_IA32_THERM_STATUS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CPU#%d currently thermal throttled\n"

	.comm	_has_N44_O17_errata,8,3         ## @has_N44_O17_errata
	.comm	_DC_25PT,4,2                    ## @DC_25PT
	.comm	_DC_DFLT,4,2                    ## @DC_DFLT
	.comm	_DC_38PT,4,2                    ## @DC_38PT
	.comm	_MSR_IA32_THERM_CONTROL,4,2     ## @MSR_IA32_THERM_CONTROL
L_.str.1:                               ## @.str.1
	.asciz	"CPU#%d disabling modulation\n"

L_.str.2:                               ## @.str.2
	.asciz	"CPU#%d setting duty cycle to %d%%\n"

	.no_dead_strip	_cpufreq_p4_setdc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpufreq_p4_setdc
_cpufreq_p4_setdc:                      ; @cpufreq_p4_setdc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_cpu_online
	cbz	w0, LBB0_8
; %bb.1:
Lloh0:
	adrp	x21, _DC_DISABLE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _DC_DISABLE@GOTPAGEOFF]
	ldr	w8, [x21]
Lloh2:
	adrp	x9, _DC_RESV@GOTPAGE
Lloh3:
	ldr	x9, [x9, _DC_RESV@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	cmp	w8, w20
	ccmp	w9, w20, #4, hs
	b.eq	LBB0_8
; %bb.2:
Lloh5:
	adrp	x8, _MSR_IA32_THERM_STATUS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MSR_IA32_THERM_STATUS@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	add	x2, sp, #12
	add	x3, sp, #8
	mov	x0, x19
	bl	_rdmsr_on_cpu
	ldrb	w8, [sp, #12]
	tbz	w8, #0, LBB0_4
; %bb.3:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_dprintk
LBB0_4:
Lloh10:
	adrp	x8, _has_N44_O17_errata@GOTPAGE
Lloh11:
	ldr	x8, [x8, _has_N44_O17_errata@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	ldr	x8, [x8, w19, uxtw #3]
	cbz	x8, LBB0_6
; %bb.5:
Lloh13:
	adrp	x8, _DC_25PT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DC_25PT@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
Lloh16:
	adrp	x9, _DC_DFLT@GOTPAGE
Lloh17:
	ldr	x9, [x9, _DC_DFLT@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	cmp	w9, w20
	ccmp	w8, w20, #4, ne
Lloh19:
	adrp	x8, _DC_38PT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _DC_38PT@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	csel	w20, w8, w20, eq
LBB0_6:
Lloh22:
	adrp	x22, _MSR_IA32_THERM_CONTROL@GOTPAGE
Lloh23:
	ldr	x22, [x22, _MSR_IA32_THERM_CONTROL@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #12
	add	x3, sp, #8
	mov	x0, x19
	bl	_rdmsr_on_cpu
	ldr	w8, [x21]
	cmp	w20, w8
	b.ne	LBB0_9
; %bb.7:
Lloh24:
	adrp	x0, l_.str.1@PAGE
Lloh25:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_dprintk
	ldr	w1, [x22]
	ldr	w8, [sp, #12]
	and	w2, w8, #0xffffffef
	b	LBB0_10
LBB0_8:
Lloh26:
	adrp	x8, _EINVAL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
LBB0_9:
	mov	w8, #125
	mul	w8, w20, w8
	mov	w9, #52429
	movk	w9, #52428, lsl #16
	umull	x8, w8, w9
	lsr	x8, x8, #35
	str	x8, [sp]
Lloh29:
	adrp	x0, l_.str.2@PAGE
Lloh30:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x19
	bl	_dprintk
	ldr	w8, [sp, #12]
	and	w8, w8, #0xffffffe1
	bfi	w8, w20, #1, #3
	orr	w2, w8, #0x10
	str	w2, [sp, #12]
	ldr	w1, [x22]
LBB0_10:
	ldr	w3, [sp, #8]
	mov	x0, x19
	bl	_wrmsr_on_cpu
	mov	w0, #0
LBB0_11:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_DC_DISABLE,4,2                 ; @DC_DISABLE
	.comm	_DC_RESV,4,2                    ; @DC_RESV
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MSR_IA32_THERM_STATUS,4,2      ; @MSR_IA32_THERM_STATUS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CPU#%d currently thermal throttled\n"

	.comm	_has_N44_O17_errata,8,3         ; @has_N44_O17_errata
	.comm	_DC_25PT,4,2                    ; @DC_25PT
	.comm	_DC_DFLT,4,2                    ; @DC_DFLT
	.comm	_DC_38PT,4,2                    ; @DC_38PT
	.comm	_MSR_IA32_THERM_CONTROL,4,2     ; @MSR_IA32_THERM_CONTROL
l_.str.1:                               ; @.str.1
	.asciz	"CPU#%d disabling modulation\n"

l_.str.2:                               ; @.str.2
	.asciz	"CPU#%d setting duty cycle to %d%%\n"

	.no_dead_strip	_cpufreq_p4_setdc
.subsections_via_symbols
