	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_pwm1
_set_pwm1:                              ## @set_pwm1
	.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
	subq	$24, %rsp
	.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, %rbx
	movq	%rsi, %rdi
	callq	_to_sensor_dev_attr
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_dev_get_drvdata
	testb	$32, (%rax)
	jne	LBB0_2
## %bb.1:
	movq	_EPERM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_9
LBB0_2:
	movq	%rax, %r13
	movq	%r14, %rbx
	movq	40(%rax), %r14
	movslq	(%r15), %r15
	leaq	-48(%rbp), %rdx
	movq	%r12, %rdi
	movl	$10, %esi
	callq	_kstrtoul
	testl	%eax, %eax
	jne	LBB0_9
## %bb.3:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, %r14
	testl	%r15d, %r15d
	je	LBB0_5
## %bb.4:
	leal	-1(%r15), %edi
	callq	_LM63_REG_LUT_PWM
	movl	%eax, %r12d
	jmp	LBB0_6
LBB0_5:
	movq	_LM63_REG_PWM_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_6:
	movq	-48(%rbp), %rdi
	xorl	%esi, %esi
	movl	$255, %edx
	callq	_clamp_val
	movq	%rax, -48(%rbp)
	addq	$24, %r13
	movq	%r13, %rdi
	callq	_mutex_lock
	cmpq	$0, 32(%r14)
	movq	-48(%rbp), %rdx
	jne	LBB0_8
## %bb.7:
	imulq	16(%r14), %rdx
	leaq	(%rdx,%rdx), %rax
	addq	$127, %rax
	movabsq	$-9187201950435737471, %rcx     ## imm = 0x8080808080808081
	mulq	%rcx
	shrq	$7, %rdx
LBB0_8:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	8(%r14), %rax
	movq	%rdx, (%rax,%r15,8)
	movl	%r12d, %esi
	callq	_i2c_smbus_write_byte_data
	movq	%r13, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
LBB0_9:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_LM63_REG_PWM_VALUE,4,2         ## @LM63_REG_PWM_VALUE
	.no_dead_strip	_set_pwm1
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_pwm1
_set_pwm1:                              ; @set_pwm1
	.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	x22, x2
	mov	x20, x0
	mov	x0, x1
	bl	_to_sensor_dev_attr
	mov	x23, x0
	mov	x0, x20
	bl	_dev_get_drvdata
	ldrb	w8, [x0]
	tbnz	w8, #5, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EPERM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_2:
	mov	x20, x0
	ldr	x21, [x0, #40]
	ldrsw	x24, [x23]
	add	x2, sp, #8
	mov	x0, x22
	mov	w1, #10
	bl	_kstrtoul
	cbnz	w0, LBB0_9
; %bb.3:
	cbz	w24, LBB0_5
; %bb.4:
	sub	w0, w24, #1
	bl	_LM63_REG_LUT_PWM
	mov	x22, x0
	b	LBB0_6
LBB0_5:
Lloh3:
	adrp	x8, _LM63_REG_PWM_VALUE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _LM63_REG_PWM_VALUE@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
LBB0_6:
	ldr	x0, [sp, #8]
	mov	w1, #0
	mov	w2, #255
	bl	_clamp_val
	str	x0, [sp, #8]
	add	x23, x20, #24
	mov	x0, x23
	bl	_mutex_lock
	ldr	x8, [x20, #32]
	ldr	x2, [sp, #8]
	cbnz	x8, LBB0_8
; %bb.7:
	ldr	x8, [x20, #16]
	mul	x8, x2, x8
	lsl	x8, x8, #1
	add	x8, x8, #127
	mov	x9, #-9187201950435737472
	movk	x9, #32897
	umulh	x8, x8, x9
	lsr	x2, x8, #7
LBB0_8:
	ldr	x8, [x20, #8]
	str	x2, [x8, x24, lsl #3]
	mov	x0, x21
	mov	x1, x22
	bl	_i2c_smbus_write_byte_data
	mov	x0, x23
	bl	_mutex_unlock
	mov	x0, x19
LBB0_9:
	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
	.cfi_endproc
                                        ; -- End function
	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_LM63_REG_PWM_VALUE,4,2         ; @LM63_REG_PWM_VALUE
	.no_dead_strip	_set_pwm1
.subsections_via_symbols
