	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pm121_tick
_pm121_tick:                            ## @pm121_tick
	.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	_pm121_failure_state@GOTPCREL(%rip), %r12
	movl	(%r12), %r13d
	movq	_pm121_started@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	jne	LBB0_5
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_pr_debug
	movq	_N_LOOPS@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_4
## %bb.2:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_pm121_create_sys_fans
	incl	%ebx
	cmpl	(%r15), %ebx
	jl	LBB0_3
LBB0_4:
	xorl	%eax, %eax
	callq	_pm121_create_cpu_fans
	movl	$1, (%r14)
LBB0_5:
	movq	_pm121_skipping@GOTPCREL(%rip), %rcx
	movl	(%rcx), %eax
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	decl	%eax
	movl	%eax, (%rcx)
	jne	LBB0_46
LBB0_7:
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movq	_pm121_cpu_state@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	movl	(%rdi), %ecx
	testl	%ecx, %ecx
	jle	LBB0_8
## %bb.9:
	movq	8(%rdi), %rdx
	cmpl	$4, %ecx
	jae	LBB0_11
## %bb.10:
	xorl	%esi, %esi
	xorl	%eax, %eax
	jmp	LBB0_18
LBB0_8:
	xorl	%eax, %eax
	jmp	LBB0_19
LBB0_11:
	movl	%ecx, %esi
	andl	$-4, %esi
	leaq	-4(%rsi), %rax
	movq	%rax, %r8
	shrq	$2, %r8
	incq	%r8
	testq	%rax, %rax
	je	LBB0_12
## %bb.13:
	movq	%r8, %rax
	andq	$-2, %rax
	pxor	%xmm0, %xmm0
	xorl	%ebx, %ebx
	pxor	%xmm1, %xmm1
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movdqu	(%rdx,%rbx,8), %xmm2
	movdqu	16(%rdx,%rbx,8), %xmm3
	movdqu	32(%rdx,%rbx,8), %xmm4
	movdqu	48(%rdx,%rbx,8), %xmm5
	pshufd	$232, %xmm2, %xmm2              ## xmm2 = xmm2[0,2,2,3]
	paddd	%xmm0, %xmm2
	pshufd	$232, %xmm3, %xmm3              ## xmm3 = xmm3[0,2,2,3]
	paddd	%xmm1, %xmm3
	pshufd	$232, %xmm4, %xmm0              ## xmm0 = xmm4[0,2,2,3]
	paddd	%xmm2, %xmm0
	pshufd	$232, %xmm5, %xmm1              ## xmm1 = xmm5[0,2,2,3]
	paddd	%xmm3, %xmm1
	addq	$8, %rbx
	addq	$-2, %rax
	jne	LBB0_14
## %bb.15:
	testb	$1, %r8b
	je	LBB0_17
LBB0_16:
	movdqu	(%rdx,%rbx,8), %xmm2
	movdqu	16(%rdx,%rbx,8), %xmm3
	pshufd	$232, %xmm2, %xmm2              ## xmm2 = xmm2[0,2,2,3]
	paddd	%xmm2, %xmm0
	pshufd	$232, %xmm3, %xmm2              ## xmm2 = xmm3[0,2,2,3]
	paddd	%xmm2, %xmm1
LBB0_17:
	paddd	%xmm1, %xmm0
	pshufd	$85, %xmm0, %xmm1               ## xmm1 = xmm0[1,1,1,1]
	paddd	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpq	%rcx, %rsi
	je	LBB0_19
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	addl	(%rdx,%rsi,8), %eax
	incq	%rsi
	cmpq	%rsi, %rcx
	jne	LBB0_18
LBB0_19:
	cltd
	idivl	%ecx
	movq	_average_power@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	$0, (%r12)
	movq	_N_LOOPS@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	testl	%eax, %eax
	jle	LBB0_25
## %bb.20:
	xorl	%ebx, %ebx
	movq	_pm121_sys_state@GOTPCREL(%rip), %r14
	jmp	LBB0_21
	.p2align	4, 0x90
LBB0_23:                                ##   in Loop: Header=BB0_21 Depth=1
	incq	%rbx
	movslq	%eax, %rcx
	cmpq	%rcx, %rbx
	jge	LBB0_24
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rcx
	cmpq	$0, (%rcx,%rbx,8)
	je	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_21 Depth=1
	movl	%ebx, %edi
	callq	_pm121_sys_fans_tick
	movl	(%r15), %eax
	jmp	LBB0_23
LBB0_24:
	movq	(%r13), %rdi
LBB0_25:
	testq	%rdi, %rdi
	je	LBB0_27
## %bb.26:
	callq	_pm121_cpu_fans_tick
LBB0_27:
	movq	_pm121_readjust@GOTPCREL(%rip), %r13
	movl	$0, (%r13)
	movl	(%r12), %ebx
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%edx, %r15d
	notl	%r15d
	movl	%ebx, %ecx
	testl	%ebx, %ebx
	je	LBB0_35
## %bb.28:
	movl	%ebx, %ecx
	testl	%edx, %edx
	jne	LBB0_35
## %bb.29:
	movq	_N_CONTROLS@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	movl	%ebx, %ecx
	testl	%eax, %eax
	jle	LBB0_35
## %bb.30:
	xorl	%r13d, %r13d
	movq	_controls@GOTPCREL(%rip), %r12
	jmp	LBB0_31
	.p2align	4, 0x90
LBB0_33:                                ##   in Loop: Header=BB0_31 Depth=1
	incq	%r13
	movslq	%eax, %rcx
	cmpq	%rcx, %r13
	jge	LBB0_34
LBB0_31:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rcx
	movq	(%rcx,%r13,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_33
## %bb.32:                              ##   in Loop: Header=BB0_31 Depth=1
	callq	_wf_control_set_max
	movl	(%r14), %eax
	jmp	LBB0_33
LBB0_34:
	movq	_pm121_failure_state@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	_pm121_readjust@GOTPCREL(%rip), %r13
LBB0_35:
	andl	%r15d, %ebx
	testl	%ecx, %ecx
	jne	LBB0_40
## %bb.36:
	testl	%edx, %edx
	je	LBB0_40
## %bb.37:
	movq	_controls@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_CPUFREQ@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_39
## %bb.38:
	callq	_wf_control_set_min
LBB0_39:
	movl	$1, (%r13)
LBB0_40:
	movq	_FAILURE_OVERTEMP@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_41
## %bb.42:
	xorl	%eax, %eax
	callq	_wf_set_overtemp
	movq	_pm121_skipping@GOTPCREL(%rip), %rax
	movl	$2, (%rax)
	movq	_pm121_overtemp@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	movb	$1, %al
	cmpl	$0, (%r12)
	je	LBB0_44
	jmp	LBB0_46
LBB0_41:
	movq	_pm121_overtemp@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	setne	%al
	cmpl	$0, (%r12)
	jne	LBB0_46
LBB0_44:
	testb	%al, %al
	je	LBB0_46
## %bb.45:
	xorl	%eax, %eax
	callq	_wf_clear_overtemp
	movq	_pm121_overtemp@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
LBB0_46:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	pxor	%xmm0, %xmm0
	xorl	%ebx, %ebx
	pxor	%xmm1, %xmm1
	testb	$1, %r8b
	jne	LBB0_16
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_pm121_failure_state,4,2        ## @pm121_failure_state
	.comm	_pm121_started,4,2              ## @pm121_started
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pm121: creating control loops !\n"

	.comm	_N_LOOPS,4,2                    ## @N_LOOPS
	.comm	_pm121_skipping,4,2             ## @pm121_skipping
	.comm	_pm121_cpu_state,8,3            ## @pm121_cpu_state
	.comm	_average_power,4,2              ## @average_power
	.comm	_pm121_sys_state,8,3            ## @pm121_sys_state
	.comm	_pm121_readjust,4,2             ## @pm121_readjust
	.comm	_N_CONTROLS,4,2                 ## @N_CONTROLS
	.comm	_controls,8,3                   ## @controls
	.comm	_CPUFREQ,8,3                    ## @CPUFREQ
	.comm	_FAILURE_OVERTEMP,4,2           ## @FAILURE_OVERTEMP
	.comm	_pm121_overtemp,4,2             ## @pm121_overtemp
	.no_dead_strip	_pm121_tick
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pm121_tick
_pm121_tick:                            ; @pm121_tick
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
Lloh0:
	adrp	x20, _pm121_failure_state@GOTPAGE
Lloh1:
	ldr	x20, [x20, _pm121_failure_state@GOTPAGEOFF]
	ldr	w21, [x20]
Lloh2:
	adrp	x22, _pm121_started@GOTPAGE
Lloh3:
	ldr	x22, [x22, _pm121_started@GOTPAGEOFF]
	ldr	w8, [x22]
	cbnz	w8, LBB0_5
; %bb.1:
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
Lloh6:
	adrp	x23, _N_LOOPS@GOTPAGE
Lloh7:
	ldr	x23, [x23, _N_LOOPS@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.2:
	mov	w19, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_pm121_create_sys_fans
	add	w19, w19, #1
	ldr	w8, [x23]
	cmp	w19, w8
	b.lt	LBB0_3
LBB0_4:
	bl	_pm121_create_cpu_fans
	mov	w8, #1
	str	w8, [x22]
LBB0_5:
Lloh8:
	adrp	x22, _pm121_skipping@GOTPAGE
Lloh9:
	ldr	x22, [x22, _pm121_skipping@GOTPAGEOFF]
	ldr	w8, [x22]
	cbz	w8, LBB0_7
; %bb.6:
	subs	w8, w8, #1
	str	w8, [x22]
	b.ne	LBB0_42
LBB0_7:
Lloh10:
	adrp	x23, _pm121_cpu_state@GOTPAGE
Lloh11:
	ldr	x23, [x23, _pm121_cpu_state@GOTPAGEOFF]
	ldr	x0, [x23]
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.8:
	ldr	x9, [x0, #8]
	cmp	w8, #8
	b.hs	LBB0_11
; %bb.9:
	mov	x10, #0
	mov	w11, #0
	b	LBB0_14
LBB0_10:
	mov	w11, #0
	b	LBB0_16
LBB0_11:
	and	x10, x8, #0xfffffff8
	movi.2d	v0, #0000000000000000
	add	x11, x9, #32
	mov	x12, x10
	movi.2d	v1, #0000000000000000
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldp	q4, q5, [x11, #-32]
	ldp	q6, q7, [x11], #64
	xtn.2s	v4, v4
	xtn.2s	v5, v5
	xtn.2s	v6, v6
	xtn.2s	v7, v7
	add.2s	v0, v0, v4
	add.2s	v1, v1, v5
	add.2s	v2, v2, v6
	add.2s	v3, v3, v7
	subs	x12, x12, #8
	b.ne	LBB0_12
; %bb.13:
	add.2s	v0, v1, v0
	add.2s	v0, v2, v0
	add.2s	v0, v3, v0
	addp.2s	v0, v0, v0
	fmov	w11, s0
	cmp	x10, x8
	b.eq	LBB0_16
LBB0_14:
	add	x9, x9, x10, lsl #3
	sub	x10, x8, x10
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x9], #8
	add	w11, w11, w12
	subs	x10, x10, #1
	b.ne	LBB0_15
LBB0_16:
	sdiv	w8, w11, w8
Lloh12:
	adrp	x9, _average_power@GOTPAGE
Lloh13:
	ldr	x9, [x9, _average_power@GOTPAGEOFF]
Lloh14:
	str	w8, [x9]
	str	wzr, [x20]
Lloh15:
	adrp	x24, _N_LOOPS@GOTPAGE
Lloh16:
	ldr	x24, [x24, _N_LOOPS@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_22
; %bb.17:
	mov	x19, #0
Lloh17:
	adrp	x25, _pm121_sys_state@GOTPAGE
Lloh18:
	ldr	x25, [x25, _pm121_sys_state@GOTPAGEOFF]
	b	LBB0_19
LBB0_18:                                ;   in Loop: Header=BB0_19 Depth=1
	add	x19, x19, #1
	cmp	x19, w8, sxtw
	b.ge	LBB0_21
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x25]
	ldr	x9, [x9, x19, lsl #3]
	cbz	x9, LBB0_18
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=1
	mov	x0, x19
	bl	_pm121_sys_fans_tick
	ldr	w8, [x24]
	b	LBB0_18
LBB0_21:
	ldr	x0, [x23]
LBB0_22:
	cbz	x0, LBB0_24
; %bb.23:
	bl	_pm121_cpu_fans_tick
LBB0_24:
Lloh19:
	adrp	x19, _pm121_readjust@GOTPAGE
Lloh20:
	ldr	x19, [x19, _pm121_readjust@GOTPAGEOFF]
	str	wzr, [x19]
	ldr	w23, [x20]
	cbz	w23, LBB0_32
; %bb.25:
	cbnz	w21, LBB0_32
; %bb.26:
Lloh21:
	adrp	x24, _N_CONTROLS@GOTPAGE
Lloh22:
	ldr	x24, [x24, _N_CONTROLS@GOTPAGEOFF]
	ldr	w8, [x24]
	mov	x9, x23
	cmp	w8, #1
	b.lt	LBB0_33
; %bb.27:
	mov	x25, #0
Lloh23:
	adrp	x26, _controls@GOTPAGE
Lloh24:
	ldr	x26, [x26, _controls@GOTPAGEOFF]
	b	LBB0_29
LBB0_28:                                ;   in Loop: Header=BB0_29 Depth=1
	add	x25, x25, #1
	cmp	x25, w8, sxtw
	b.ge	LBB0_31
LBB0_29:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x26]
	ldr	x0, [x9, x25, lsl #3]
	cbz	x0, LBB0_28
; %bb.30:                               ;   in Loop: Header=BB0_29 Depth=1
	bl	_wf_control_set_max
	ldr	w8, [x24]
	b	LBB0_28
LBB0_31:
	ldr	w9, [x20]
	b	LBB0_33
LBB0_32:
	mov	x9, x23
LBB0_33:
	bic	w23, w23, w21
	cmp	w9, #0
	ccmp	w21, #0, #4, eq
	b.eq	LBB0_37
; %bb.34:
Lloh25:
	adrp	x8, _controls@GOTPAGE
Lloh26:
	ldr	x8, [x8, _controls@GOTPAGEOFF]
Lloh27:
	ldr	x8, [x8]
Lloh28:
	adrp	x9, _CPUFREQ@GOTPAGE
Lloh29:
	ldr	x9, [x9, _CPUFREQ@GOTPAGEOFF]
Lloh30:
	ldr	x9, [x9]
	ldr	x0, [x8, x9, lsl #3]
	cbz	x0, LBB0_36
; %bb.35:
	bl	_wf_control_set_min
LBB0_36:
	mov	w8, #1
	str	w8, [x19]
LBB0_37:
Lloh31:
	adrp	x8, _FAILURE_OVERTEMP@GOTPAGE
Lloh32:
	ldr	x8, [x8, _FAILURE_OVERTEMP@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
Lloh34:
	adrp	x19, _pm121_overtemp@GOTPAGE
Lloh35:
	ldr	x19, [x19, _pm121_overtemp@GOTPAGEOFF]
	tst	w23, w8
	b.eq	LBB0_39
; %bb.38:
	bl	_wf_set_overtemp
	mov	w8, #2
	str	w8, [x22]
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_40
LBB0_39:
	ldr	w8, [x19]
	cmp	w8, #0
	cset	w8, ne
LBB0_40:
	ldr	w9, [x20]
	cmp	w9, #0
	ccmp	w8, #0, #4, eq
	b.eq	LBB0_42
; %bb.41:
	bl	_wf_clear_overtemp
	str	wzr, [x19]
LBB0_42:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotStr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_pm121_failure_state,4,2        ; @pm121_failure_state
	.comm	_pm121_started,4,2              ; @pm121_started
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pm121: creating control loops !\n"

	.comm	_N_LOOPS,4,2                    ; @N_LOOPS
	.comm	_pm121_skipping,4,2             ; @pm121_skipping
	.comm	_pm121_cpu_state,8,3            ; @pm121_cpu_state
	.comm	_average_power,4,2              ; @average_power
	.comm	_pm121_sys_state,8,3            ; @pm121_sys_state
	.comm	_pm121_readjust,4,2             ; @pm121_readjust
	.comm	_N_CONTROLS,4,2                 ; @N_CONTROLS
	.comm	_controls,8,3                   ; @controls
	.comm	_CPUFREQ,8,3                    ; @CPUFREQ
	.comm	_FAILURE_OVERTEMP,4,2           ; @FAILURE_OVERTEMP
	.comm	_pm121_overtemp,4,2             ; @pm121_overtemp
	.no_dead_strip	_pm121_tick
.subsections_via_symbols
