	.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, -48(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r12
	movq	%rsi, %rbx
	callq	_to_i2c_client
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_i2c_get_clientdata
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_to_sensor_dev_attr
	movslq	(%rax), %rbx
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$10, %edx
	callq	_simple_strtol
	movl	%eax, %r13d
	leaq	16(%r14), %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	_ADM1031_CONF1_AUTO_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_3
## %bb.1:
	movl	%r13d, %eax
	andl	$240, %eax
	cmpl	$80, %eax
	je	LBB0_3
## %bb.2:
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subq	(%rcx), %rax
	jmp	LBB0_4
LBB0_3:
	movl	%r13d, %edi
	callq	_PWM_TO_REG
	movq	8(%r14), %rcx
	movl	%eax, (%rcx,%rbx,4)
	movq	_ADM1031_REG_PWM@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_adm1031_read_value
	movl	(%r13), %esi
	movq	8(%r14), %rcx
	movl	(%rcx,%rbx,4), %ecx
	movl	%ecx, %edi
	andl	$15, %edi
	shll	$4, %ecx
	testl	%ebx, %ebx
	movzbl	%cl, %ecx
	movl	$240, %ebx
	movl	$15, %edx
	cmovel	%ebx, %edx
	cmovel	%edi, %ecx
	andl	%eax, %edx
	orl	%ecx, %edx
	movq	%r15, %rdi
	callq	_adm1031_write_value
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	-48(%rbp), %rax                 ## 8-byte Reload
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ADM1031_CONF1_AUTO_MODE,4,2    ## @ADM1031_CONF1_AUTO_MODE
	.comm	_EINVAL,8,3                     ## @EINVAL
	.comm	_ADM1031_REG_PWM,4,2            ## @ADM1031_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:
	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
	mov	x19, x3
	mov	x21, x2
	mov	x23, x1
	bl	_to_i2c_client
	mov	x20, x0
	bl	_i2c_get_clientdata
	mov	x22, x0
	mov	x0, x23
	bl	_to_sensor_dev_attr
	ldrsw	x24, [x0]
	mov	x0, x21
	mov	x1, #0
	mov	w2, #10
	bl	_simple_strtol
	mov	x23, x0
	add	x21, x22, #16
	mov	x0, x21
	bl	_mutex_lock
	ldr	w8, [x22]
Lloh0:
	adrp	x9, _ADM1031_CONF1_AUTO_MODE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ADM1031_CONF1_AUTO_MODE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.1:
	and	w8, w23, #0xf0
	cmp	w8, #80
	b.eq	LBB0_3
; %bb.2:
	mov	x0, x21
	bl	_mutex_unlock
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	neg	x19, x8
	b	LBB0_4
LBB0_3:
	mov	x0, x23
	bl	_PWM_TO_REG
	ldr	x8, [x22, #8]
	lsl	x23, x24, #2
	str	w0, [x8, x23]
Lloh6:
	adrp	x25, _ADM1031_REG_PWM@GOTPAGE
Lloh7:
	ldr	x25, [x25, _ADM1031_REG_PWM@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x20
	bl	_adm1031_read_value
	ldr	w1, [x25]
	ldr	x8, [x22, #8]
	ldr	w8, [x8, x23]
	and	w9, w8, #0xf
	ubfiz	w8, w8, #4, #4
	mov	w10, #15
	mov	w11, #240
	cmp	w24, #0
	csel	w10, w11, w10, eq
	csel	w8, w9, w8, eq
	and	w9, w0, w10
	orr	w2, w8, w9
	mov	x0, x20
	bl	_adm1031_write_value
	mov	x0, x21
	bl	_mutex_unlock
LBB0_4:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_ADM1031_CONF1_AUTO_MODE,4,2    ; @ADM1031_CONF1_AUTO_MODE
	.comm	_EINVAL,8,3                     ; @EINVAL
	.comm	_ADM1031_REG_PWM,4,2            ; @ADM1031_REG_PWM
	.no_dead_strip	_set_pwm
.subsections_via_symbols
