	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function max6650_write
_max6650_write:                         ## @max6650_write
	.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	%r8, %r15
	movl	%edx, %r13d
	movl	%esi, %ebx
	callq	_dev_get_drvdata
	movq	%rax, %r14
	movq	%rax, %r12
	addq	$4, %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	cmpl	$133, %ebx
	je	LBB0_10
## %bb.1:
	cmpl	$130, %ebx
	jne	LBB0_22
## %bb.2:
	cmpl	$129, %r13d
	je	LBB0_6
## %bb.3:
	cmpl	$128, %r13d
	jne	LBB0_22
## %bb.4:
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$255, %edx
	callq	_clamp_val
	movq	_MAX6650_CFG_V12@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	andl	(%r14), %esi
	movl	%eax, %edi
	callq	_pwm_to_dac
	movq	%rax, %r15
	movl	16(%r14), %edi
	movq	_MAX6650_REG_DAC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdx
	callq	_i2c_smbus_write_byte_data
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_24
## %bb.5:
	movq	%r15, 24(%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_24
LBB0_10:
	cmpl	$131, %r13d
	je	LBB0_20
## %bb.11:
	cmpl	$132, %r13d
	jne	LBB0_22
## %bb.12:
	xorl	%r13d, %r13d
	decq	%r15
	cmpq	$7, %r15
	ja	LBB0_16
## %bb.13:
	leaq	LJTI0_0(%rip), %rax
	movslq	(%rax,%r15,4), %rcx
	addq	%rax, %rcx
	jmpq	*%rcx
LBB0_17:
	movl	$1, %r13d
	jmp	LBB0_18
LBB0_22:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
LBB0_23:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_24:
	movq	%r12, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	testq	%r15, %r15
	js	LBB0_8
## %bb.7:
	movq	_max6650_pwm_modes@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	callq	_ARRAY_SIZE
	cmpq	%r15, %rax
	jle	LBB0_8
## %bb.9:
	movq	(%rbx), %rax
	movl	(%rax,%r15,4), %esi
	movq	%r14, %rdi
	callq	_max6650_set_operating_mode
	movl	%eax, %ebx
	jmp	LBB0_24
LBB0_20:
	testq	%r15, %r15
	js	LBB0_8
## %bb.21:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_max6650_set_target
	movl	%eax, %ebx
	jmp	LBB0_24
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_23
LBB0_16:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	movl	%r13d, %ebx
	jmp	LBB0_24
LBB0_14:
	movl	$2, %r13d
	jmp	LBB0_18
LBB0_15:
	movl	$3, %r13d
LBB0_18:
	movl	16(%r14), %edi
	movq	_MAX6650_REG_COUNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdx
	callq	_i2c_smbus_write_byte_data
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_24
## %bb.19:
	movq	%r13, 8(%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_24
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_18, LBB0_18-LJTI0_0
.set L0_0_set_17, LBB0_17-LJTI0_0
.set L0_0_set_16, LBB0_16-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
.set L0_0_set_15, LBB0_15-LJTI0_0
LJTI0_0:
	.long	L0_0_set_18
	.long	L0_0_set_17
	.long	L0_0_set_16
	.long	L0_0_set_14
	.long	L0_0_set_16
	.long	L0_0_set_16
	.long	L0_0_set_16
	.long	L0_0_set_15
	.end_data_region
                                        ## -- End function
	.comm	_MAX6650_CFG_V12,4,2            ## @MAX6650_CFG_V12
	.comm	_MAX6650_REG_DAC,4,2            ## @MAX6650_REG_DAC
	.comm	_max6650_pwm_modes,8,3          ## @max6650_pwm_modes
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_MAX6650_REG_COUNT,4,2          ## @MAX6650_REG_COUNT
	.no_dead_strip	_max6650_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function max6650_write
_max6650_write:                         ; @max6650_write
	.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	x21, x4
	mov	x22, x2
	mov	x23, x1
	bl	_dev_get_drvdata
	mov	x20, x0
	add	x19, x0, #4
	mov	x0, x19
	bl	_mutex_lock
	cmp	w23, #133
	b.eq	LBB0_6
; %bb.1:
	cmp	w23, #130
	b.ne	LBB0_11
; %bb.2:
	cmp	w22, #129
	b.eq	LBB0_12
; %bb.3:
	cmp	w22, #128
	b.ne	LBB0_11
; %bb.4:
	mov	x0, x21
	mov	w1, #0
	mov	w2, #255
	bl	_clamp_val
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _MAX6650_CFG_V12@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MAX6650_CFG_V12@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	and	w1, w9, w8
	bl	_pwm_to_dac
	mov	x22, x0
	ldr	w0, [x20, #16]
Lloh3:
	adrp	x8, _MAX6650_REG_DAC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX6650_REG_DAC@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x2, x22
	bl	_i2c_smbus_write_byte_data
	mov	x21, x0
	cbnz	w0, LBB0_19
; %bb.5:
	str	x22, [x20, #24]
	b	LBB0_19
LBB0_6:
	cmp	w22, #131
	b.eq	LBB0_15
; %bb.7:
	cmp	w22, #132
	b.ne	LBB0_11
; %bb.8:
	sub	x8, x21, #1
	cmp	x8, #7
	b.hi	LBB0_17
; %bb.9:
	mov	x22, #0
Lloh6:
	adrp	x9, lJTI0_0@PAGE
Lloh7:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_10
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_10:
	mov	w22, #1
	b	LBB0_22
LBB0_11:
Lloh8:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
	b	LBB0_18
LBB0_12:
	tbnz	x21, #63, LBB0_17
; %bb.13:
Lloh10:
	adrp	x22, _max6650_pwm_modes@GOTPAGE
Lloh11:
	ldr	x22, [x22, _max6650_pwm_modes@GOTPAGEOFF]
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	cmp	x0, x21
	b.le	LBB0_17
; %bb.14:
	ldr	x8, [x22]
	ldr	w1, [x8, x21, lsl #2]
	mov	x0, x20
	bl	_max6650_set_operating_mode
	mov	x21, x0
	b	LBB0_19
LBB0_15:
	tbnz	x21, #63, LBB0_17
; %bb.16:
	mov	x0, x20
	mov	x1, x21
	bl	_max6650_set_target
	mov	x21, x0
	b	LBB0_19
LBB0_17:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_18:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_19:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x21
	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
LBB0_20:
	mov	w22, #2
	b	LBB0_22
LBB0_21:
	mov	w22, #3
LBB0_22:
	ldr	w0, [x20, #16]
Lloh14:
	adrp	x8, _MAX6650_REG_COUNT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MAX6650_REG_COUNT@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x2, x22
	bl	_i2c_smbus_write_byte_data
	mov	x21, x0
	cbnz	w0, LBB0_19
; %bb.23:
	str	x22, [x20, #8]
	b	LBB0_19
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_22-LBB0_10)>>2
	.byte	(LBB0_10-LBB0_10)>>2
	.byte	(LBB0_17-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_17-LBB0_10)>>2
	.byte	(LBB0_17-LBB0_10)>>2
	.byte	(LBB0_17-LBB0_10)>>2
	.byte	(LBB0_21-LBB0_10)>>2
                                        ; -- End function
	.comm	_MAX6650_CFG_V12,4,2            ; @MAX6650_CFG_V12
	.comm	_MAX6650_REG_DAC,4,2            ; @MAX6650_REG_DAC
	.comm	_max6650_pwm_modes,8,3          ; @max6650_pwm_modes
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_MAX6650_REG_COUNT,4,2          ; @MAX6650_REG_COUNT
	.no_dead_strip	_max6650_write
.subsections_via_symbols
