	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_pwm_freq
_set_pwm_freq:                          ## @set_pwm_freq
	.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	%rcx, %r14
	movq	%rdx, %r15
	movq	%rdi, %r12
	movq	%rsi, %rdi
	callq	_to_sensor_dev_attr
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_dev_get_drvdata
	movq	%rax, %r12
	movl	(%rbx), %ebx
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	movl	$10, %esi
	callq	_kstrtoul
	testq	%rax, %rax
	js	LBB0_1
## %bb.2:
	movq	%r12, %r15
	movq	-48(%rbp), %rdi
	xorl	%r13d, %r13d
	xorl	%esi, %esi
	movl	$1000000, %edx                  ## imm = 0xF4240
	callq	_clamp_val
	movq	%rax, -48(%rbp)
	movq	%r12, %rdi
	callq	_has_newer_autopwm
	xorl	%ecx, %ecx
	testq	%rax, %rax
	setne	%cl
	shlq	$7, %rcx
	subq	$-128, %rcx
	imulq	-48(%rbp), %rcx
	movq	%rcx, -48(%rbp)
	movq	_pwm_freq@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	4(%rax), %edx
	movl	(%rax), %esi
	addl	%edx, %esi
	movl	%esi, %edi
	shrl	$31, %edi
	addl	%esi, %edi
	sarl	%edi
	movslq	%edi, %rsi
	cmpq	%rsi, %rcx
	ja	LBB0_9
## %bb.3:
	movl	8(%rax), %esi
	addl	%esi, %edx
	movl	%edx, %edi
	shrl	$31, %edi
	addl	%edx, %edi
	sarl	%edi
	movslq	%edi, %rdx
	movl	$16, %r13d
	cmpq	%rdx, %rcx
	ja	LBB0_9
## %bb.4:
	movl	12(%rax), %edx
	addl	%edx, %esi
	movl	%esi, %edi
	shrl	$31, %edi
	addl	%esi, %edi
	sarl	%edi
	movslq	%edi, %rsi
	movl	$32, %r13d
	cmpq	%rsi, %rcx
	ja	LBB0_9
## %bb.5:
	movl	16(%rax), %esi
	addl	%esi, %edx
	movl	%edx, %edi
	shrl	$31, %edi
	addl	%edx, %edi
	sarl	%edi
	movslq	%edi, %rdx
	movl	$48, %r13d
	cmpq	%rdx, %rcx
	ja	LBB0_9
## %bb.6:
	movl	20(%rax), %edx
	addl	%edx, %esi
	movl	%esi, %edi
	shrl	$31, %edi
	addl	%esi, %edi
	sarl	%edi
	movslq	%edi, %rsi
	movl	$64, %r13d
	cmpq	%rsi, %rcx
	ja	LBB0_9
## %bb.7:
	movl	24(%rax), %esi
	addl	%esi, %edx
	movl	%edx, %edi
	shrl	$31, %edi
	addl	%edx, %edi
	sarl	%edi
	movslq	%edi, %rdx
	movl	$80, %r13d
	cmpq	%rdx, %rcx
	ja	LBB0_9
## %bb.8:
	addl	28(%rax), %esi
	movl	%esi, %eax
	shrl	$31, %eax
	addl	%esi, %eax
	sarl	%eax
	cltq
	xorl	%r13d, %r13d
	cmpq	%rax, %rcx
	setbe	%r13b
	shll	$4, %r13d
	orl	$96, %r13d
LBB0_9:
	addq	$8, %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	testl	%ebx, %ebx
	je	LBB0_10
## %bb.11:
	movq	_IT87_REG_TEMP_EXTRA@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_it87_read_value
	andl	$143, %eax
	orl	%r13d, %eax
	movl	%eax, 4(%r15)
	jmp	LBB0_12
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subq	(%rax), %r14
	jmp	LBB0_13
LBB0_10:
	movq	_IT87_REG_FAN_CTL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_it87_read_value
	andl	$143, %eax
	orl	%r13d, %eax
	movl	%eax, (%r15)
LBB0_12:
	movl	(%rbx), %esi
	movq	%r15, %rdi
	movl	%eax, %edx
	callq	_it87_write_value
	movq	%r12, %rdi
	callq	_mutex_unlock
LBB0_13:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,8,3                     ## @EINVAL
	.comm	_pwm_freq,8,3                   ## @pwm_freq
	.comm	_IT87_REG_FAN_CTL,4,2           ## @IT87_REG_FAN_CTL
	.comm	_IT87_REG_TEMP_EXTRA,4,2        ## @IT87_REG_TEMP_EXTRA
	.no_dead_strip	_set_pwm_freq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_pwm_freq
_set_pwm_freq:                          ; @set_pwm_freq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x3
	mov	x21, x2
	mov	x20, x0
	mov	x0, x1
	bl	_to_sensor_dev_attr
	mov	x22, x0
	mov	x0, x20
	bl	_dev_get_drvdata
	mov	x20, x0
	ldr	w22, [x22]
	add	x2, sp, #8
	mov	x0, x21
	mov	w1, #10
	bl	_kstrtoul
	tbnz	x0, #63, LBB0_4
; %bb.1:
	ldr	x0, [sp, #8]
	mov	w1, #0
	mov	w2, #16960
	movk	w2, #15, lsl #16
	bl	_clamp_val
	str	x0, [sp, #8]
	mov	x0, x20
	bl	_has_newer_autopwm
	mov	w23, #0
	mov	w8, #256
	mov	w9, #128
	cmp	x0, #0
	csel	x8, x9, x8, eq
	ldr	x9, [sp, #8]
	mul	x8, x8, x9
Lloh0:
	adrp	x9, _pwm_freq@GOTPAGE
Lloh1:
	ldr	x9, [x9, _pwm_freq@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldp	w11, w10, [x9]
	add	w11, w10, w11
	cmp	w11, #0
	cinc	w11, w11, lt
	asr	w11, w11, #1
	cmp	x8, w11, sxtw
	str	x8, [sp, #8]
	b.hi	LBB0_14
; %bb.2:
	ldr	w11, [x9, #8]
	add	w10, w11, w10
	cmp	w10, #0
	cinc	w10, w10, lt
	asr	w10, w10, #1
	cmp	x8, w10, sxtw
	b.ls	LBB0_5
; %bb.3:
	mov	w23, #16
	b	LBB0_14
LBB0_4:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	neg	x19, x8
	b	LBB0_18
LBB0_5:
	ldr	w10, [x9, #12]
	add	w11, w10, w11
	cmp	w11, #0
	cinc	w11, w11, lt
	asr	w11, w11, #1
	cmp	x8, w11, sxtw
	b.ls	LBB0_7
; %bb.6:
	mov	w23, #32
	b	LBB0_14
LBB0_7:
	ldr	w11, [x9, #16]
	add	w10, w11, w10
	cmp	w10, #0
	cinc	w10, w10, lt
	asr	w10, w10, #1
	cmp	x8, w10, sxtw
	b.ls	LBB0_9
; %bb.8:
	mov	w23, #48
	b	LBB0_14
LBB0_9:
	ldr	w10, [x9, #20]
	add	w11, w10, w11
	cmp	w11, #0
	cinc	w11, w11, lt
	asr	w11, w11, #1
	cmp	x8, w11, sxtw
	b.ls	LBB0_11
; %bb.10:
	mov	w23, #64
	b	LBB0_14
LBB0_11:
	ldr	w11, [x9, #24]
	add	w10, w11, w10
	cmp	w10, #0
	cinc	w10, w10, lt
	asr	w10, w10, #1
	cmp	x8, w10, sxtw
	b.ls	LBB0_13
; %bb.12:
	mov	w23, #80
	b	LBB0_14
LBB0_13:
	ldr	w9, [x9, #28]
	add	w9, w9, w11
	cmp	w9, #0
	cinc	w9, w9, lt
	asr	w9, w9, #1
	cmp	x8, w9, sxtw
	mov	w8, #112
	mov	w9, #96
	csel	w23, w9, w8, hi
LBB0_14:
	add	x21, x20, #8
	mov	x0, x21
	bl	_mutex_lock
	cbz	w22, LBB0_16
; %bb.15:
Lloh6:
	adrp	x22, _IT87_REG_TEMP_EXTRA@GOTPAGE
Lloh7:
	ldr	x22, [x22, _IT87_REG_TEMP_EXTRA@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x20
	bl	_it87_read_value
	mov	w8, #143
	and	w8, w0, w8
	orr	w2, w8, w23
	str	w2, [x20, #4]
	b	LBB0_17
LBB0_16:
Lloh8:
	adrp	x22, _IT87_REG_FAN_CTL@GOTPAGE
Lloh9:
	ldr	x22, [x22, _IT87_REG_FAN_CTL@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x20
	bl	_it87_read_value
	mov	w8, #143
	and	w8, w0, w8
	orr	w2, w8, w23
	str	w2, [x20]
LBB0_17:
	ldr	w1, [x22]
	mov	x0, x20
	bl	_it87_write_value
	mov	x0, x21
	bl	_mutex_unlock
LBB0_18:
	mov	x0, x19
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,8,3                     ; @EINVAL
	.comm	_pwm_freq,8,3                   ; @pwm_freq
	.comm	_IT87_REG_FAN_CTL,4,2           ; @IT87_REG_FAN_CTL
	.comm	_IT87_REG_TEMP_EXTRA,4,2        ; @IT87_REG_TEMP_EXTRA
	.no_dead_strip	_set_pwm_freq
.subsections_via_symbols
