	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_pwm_enable
_set_pwm_enable:                        ## @set_pwm_enable
	.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, %rbx
	movq	%rdx, %r12
	callq	_to_i2c_client
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_i2c_get_clientdata
	movq	%rax, %r13
	xorl	%r14d, %r14d
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$10, %edx
	callq	_simple_strtol
	cmpl	$2, %eax
	ja	LBB0_8
## %bb.1:
	movl	%eax, %r12d
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, %rbx
	addq	$4, %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movl	8(%r13), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%r12d, 8(%r13)
	movq	_CFG1_PWM_AFC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	notl	%ecx
	andl	(%r13), %ecx
	cmpl	$2, %r12d
	cmovel	%eax, %r14d
	orl	%ecx, %r14d
	movl	%r14d, (%r13)
	movq	_ADM1026_REG_CONFIG1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_adm1026_write_value
	cmpl	$2, %r12d
	jne	LBB0_3
## %bb.2:
	movq	%rbx, %r14
	movl	12(%r13), %ebx
	movl	16(%r13), %edi
	andl	$15, %ebx
	callq	_PWM_MIN_TO_REG
	orl	%eax, %ebx
	movl	%ebx, %edi
	movq	%r14, %rbx
	callq	_PWM_TO_REG
	movl	%eax, %edx
	movl	%eax, 12(%r13)
	jmp	LBB0_6
LBB0_3:
	cmpl	$1, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_5
## %bb.4:
	cmpl	$1, %r12d
	je	LBB0_7
LBB0_5:
	movl	$255, 12(%r13)
	movl	$255, %edx
LBB0_6:
	movq	_ADM1026_REG_PWM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_adm1026_write_value
LBB0_7:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
LBB0_8:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CFG1_PWM_AFC,4,2               ## @CFG1_PWM_AFC
	.comm	_ADM1026_REG_CONFIG1,4,2        ## @ADM1026_REG_CONFIG1
	.comm	_ADM1026_REG_PWM,4,2            ## @ADM1026_REG_PWM
	.no_dead_strip	_set_pwm_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_pwm_enable
_set_pwm_enable:                        ; @set_pwm_enable
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x3
	mov	x21, x2
	bl	_to_i2c_client
	mov	x20, x0
	bl	_i2c_get_clientdata
	mov	x22, x0
	mov	x0, x21
	mov	x1, #0
	mov	w2, #10
	bl	_simple_strtol
	cmp	w0, #2
	b.hi	LBB0_7
; %bb.1:
	mov	x23, x0
	add	x21, x22, #4
	mov	x0, x21
	bl	_mutex_lock
	ldr	w24, [x22, #8]
	str	w23, [x22, #8]
	ldr	w8, [x22]
Lloh0:
	adrp	x9, _CFG1_PWM_AFC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CFG1_PWM_AFC@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	bic	w8, w8, w9
	cmp	w23, #2
	csel	w9, w9, wzr, eq
	orr	w2, w8, w9
	str	w2, [x22]
Lloh3:
	adrp	x8, _ADM1026_REG_CONFIG1@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ADM1026_REG_CONFIG1@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_adm1026_write_value
	cmp	w23, #2
	b.ne	LBB0_3
; %bb.2:
	ldp	w8, w0, [x22, #12]
	and	w23, w8, #0xf
	bl	_PWM_MIN_TO_REG
	orr	w0, w0, w23
	bl	_PWM_TO_REG
	mov	x2, x0
	str	w0, [x22, #12]
	b	LBB0_5
LBB0_3:
	cmp	w24, #1
	ccmp	w23, #1, #0, eq
	b.eq	LBB0_6
; %bb.4:
	mov	w2, #255
	str	w2, [x22, #12]
LBB0_5:
Lloh6:
	adrp	x8, _ADM1026_REG_PWM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ADM1026_REG_PWM@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_adm1026_write_value
LBB0_6:
	mov	x0, x21
	bl	_mutex_unlock
LBB0_7:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_CFG1_PWM_AFC,4,2               ; @CFG1_PWM_AFC
	.comm	_ADM1026_REG_CONFIG1,4,2        ; @ADM1026_REG_CONFIG1
	.comm	_ADM1026_REG_PWM,4,2            ; @ADM1026_REG_PWM
	.no_dead_strip	_set_pwm_enable
.subsections_via_symbols
