	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function max6650_set_cur_state
_max6650_set_cur_state:                 ## @max6650_set_cur_state
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rbx
	movq	24(%rbx), %r12
	movq	%rsi, %rdi
	xorl	%esi, %esi
	movl	$255, %edx
	callq	_clamp_val
	movq	%rax, %r15
	leaq	16(%rbx), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	_MAX6650_CFG_V12@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	andl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_pwm_to_dac
	movl	%eax, 20(%rbx)
	movq	_MAX6650_REG_DAC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%r12, %rdi
	movl	%eax, %edx
	callq	_i2c_smbus_write_byte_data
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_5
## %bb.1:
	testq	%r15, %r15
	jne	LBB0_2
## %bb.3:
	movq	_MAX6650_CFG_MODE_OFF@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_2:
	movq	_MAX6650_CFG_MODE_OPEN_LOOP@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_max6650_set_operating_mode
	movq	%r15, 8(%rbx)
LBB0_5:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX6650_CFG_V12,4,2            ## @MAX6650_CFG_V12
	.comm	_MAX6650_REG_DAC,4,2            ## @MAX6650_REG_DAC
	.comm	_MAX6650_CFG_MODE_OPEN_LOOP,4,2 ## @MAX6650_CFG_MODE_OPEN_LOOP
	.comm	_MAX6650_CFG_MODE_OFF,4,2       ## @MAX6650_CFG_MODE_OFF
	.no_dead_strip	_max6650_set_cur_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function max6650_set_cur_state
_max6650_set_cur_state:                 ; @max6650_set_cur_state
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	x19, [x0]
	ldr	x22, [x19, #24]
	mov	x0, x1
	mov	w1, #0
	mov	w2, #255
	bl	_clamp_val
	mov	x21, x0
	add	x20, x19, #16
	mov	x0, x20
	bl	_mutex_lock
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _MAX6650_CFG_V12@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MAX6650_CFG_V12@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	and	w1, w9, w8
	mov	x0, x21
	bl	_pwm_to_dac
	mov	x2, x0
	str	w0, [x19, #20]
Lloh3:
	adrp	x8, _MAX6650_REG_DAC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX6650_REG_DAC@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_i2c_smbus_write_byte_data
	mov	x22, x0
	cbnz	w0, LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _MAX6650_CFG_MODE_OPEN_LOOP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MAX6650_CFG_MODE_OPEN_LOOP@GOTPAGEOFF]
Lloh8:
	adrp	x9, _MAX6650_CFG_MODE_OFF@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MAX6650_CFG_MODE_OFF@GOTPAGEOFF]
	cmp	x21, #0
	csel	x8, x9, x8, eq
	ldr	w1, [x8]
	mov	x0, x19
	bl	_max6650_set_operating_mode
	str	x21, [x19, #8]
LBB0_2:
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x22
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX6650_CFG_V12,4,2            ; @MAX6650_CFG_V12
	.comm	_MAX6650_REG_DAC,4,2            ; @MAX6650_REG_DAC
	.comm	_MAX6650_CFG_MODE_OPEN_LOOP,4,2 ; @MAX6650_CFG_MODE_OPEN_LOOP
	.comm	_MAX6650_CFG_MODE_OFF,4,2       ; @MAX6650_CFG_MODE_OFF
	.no_dead_strip	_max6650_set_cur_state
.subsections_via_symbols
