	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_pwm
_set_pwm:                               ## @set_pwm
	.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, %r12
	movq	%rdi, %r15
	movq	%rsi, %rdi
	callq	_to_sensor_dev_attr
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_dev_get_drvdata
	movq	%rax, %r13
	movslq	(%rbx), %r15
	leaq	-48(%rbp), %rdx
	movq	%r12, %rdi
	movl	$10, %esi
	callq	_kstrtol
	testq	%rax, %rax
	js	LBB0_3
## %bb.1:
	movq	-48(%rbp), %rax
	testq	%rax, %rax
	js	LBB0_3
## %bb.2:
	cmpq	$256, %rax                      ## imm = 0x100
	jge	LBB0_3
## %bb.5:
	movq	%r13, %r12
	addq	$16, %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_it87_update_pwm_ctrl
	movq	%r13, %rdi
	callq	_has_newer_autopwm
	testq	%rax, %rax
	je	LBB0_9
## %bb.6:
	movq	(%r13), %rax
	testb	$-128, (%rax,%r15,4)
	jne	LBB0_7
## %bb.8:
	movq	-48(%rbp), %rsi
	movq	%r13, %rdi
	callq	_pwm_to_reg
	movq	8(%r13), %rcx
	movl	%eax, (%rcx,%r15,4)
	movq	_IT87_REG_PWM_DUTY@GOTPCREL(%rip), %rcx
	jmp	LBB0_11
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_9:
	movq	-48(%rbp), %rsi
	movq	%r13, %rdi
	callq	_pwm_to_reg
	movq	8(%r13), %rcx
	movl	%eax, (%rcx,%r15,4)
	movq	(%r13), %rcx
	testb	$-128, (%rcx,%r15,4)
	jne	LBB0_12
## %bb.10:
	movl	%eax, (%rcx,%r15,4)
	movq	_IT87_REG_PWM@GOTPCREL(%rip), %rcx
LBB0_11:
	movq	(%rcx), %rcx
	movl	(%rcx,%r15,4), %esi
	movq	%r13, %rdi
	movl	%eax, %edx
	callq	_it87_write_value
LBB0_12:
	movq	%r12, %rdi
	callq	_mutex_unlock
	jmp	LBB0_13
LBB0_7:
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%r14d, %r14d
	subq	(%rax), %r14
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	_EBUSY,8,3                      ## @EBUSY
	.comm	_IT87_REG_PWM_DUTY,8,3          ## @IT87_REG_PWM_DUTY
	.comm	_IT87_REG_PWM,8,3               ## @IT87_REG_PWM
	.no_dead_strip	_set_pwm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_pwm
_set_pwm:                               ; @set_pwm
	.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	x19, x3
	mov	x22, x2
	mov	x20, x0
	mov	x0, x1
	bl	_to_sensor_dev_attr
	mov	x21, x0
	mov	x0, x20
	bl	_dev_get_drvdata
	mov	x20, x0
	ldrsw	x21, [x21]
	add	x2, sp, #8
	mov	x0, x22
	mov	w1, #10
	bl	_kstrtol
	tbnz	x0, #63, LBB0_6
; %bb.1:
	ldr	x8, [sp, #8]
	tbnz	x8, #63, LBB0_6
; %bb.2:
	cmp	x8, #256
	b.ge	LBB0_6
; %bb.3:
	add	x22, x20, #16
	mov	x0, x22
	bl	_mutex_lock
	mov	x0, x20
	mov	x1, x21
	bl	_it87_update_pwm_ctrl
	mov	x0, x20
	bl	_has_newer_autopwm
	cbz	x0, LBB0_7
; %bb.4:
	ldr	x8, [x20]
	ldr	w8, [x8, x21, lsl #2]
	tbnz	w8, #7, LBB0_11
; %bb.5:
	ldr	x1, [sp, #8]
	mov	x0, x20
	bl	_pwm_to_reg
	ldr	x8, [x20, #8]
	str	w0, [x8, x21, lsl #2]
Lloh0:
	adrp	x8, _IT87_REG_PWM_DUTY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IT87_REG_PWM_DUTY@GOTPAGEOFF]
	mov	x2, x0
	b	LBB0_9
LBB0_6:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_12
LBB0_7:
	ldr	x1, [sp, #8]
	mov	x0, x20
	bl	_pwm_to_reg
	mov	x2, x0
	lsl	x9, x21, #2
	ldp	x8, x10, [x20]
	str	w2, [x10, x9]
	ldrb	w9, [x8, x9]
	tbnz	w9, #7, LBB0_10
; %bb.8:
	str	w2, [x8, x21, lsl #2]
Lloh4:
	adrp	x8, _IT87_REG_PWM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _IT87_REG_PWM@GOTPAGEOFF]
LBB0_9:
	ldr	x8, [x8]
	ldr	w1, [x8, x21, lsl #2]
	mov	x0, x20
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_it87_write_value
LBB0_10:
	mov	x0, x22
	bl	_mutex_unlock
	b	LBB0_13
LBB0_11:
	mov	x0, x22
	bl	_mutex_unlock
Lloh6:
	adrp	x8, _EBUSY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_12:
	ldr	x8, [x8]
	neg	x19, x8
LBB0_13:
	mov	x0, x19
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,8,3                     ; @EINVAL
	.comm	_EBUSY,8,3                      ; @EBUSY
	.comm	_IT87_REG_PWM_DUTY,8,3          ; @IT87_REG_PWM_DUTY
	.comm	_IT87_REG_PWM,8,3               ; @IT87_REG_PWM
	.no_dead_strip	_set_pwm
.subsections_via_symbols
