	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function jc42_write
_jc42_write:                            ## @jc42_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, %r12
	movl	%edx, %ebx
	callq	_dev_get_drvdata
	movq	%rax, %r13
	movq	16(%rax), %r15
	leaq	12(%rax), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	addl	$-128, %ebx
	cmpl	$3, %ebx
	ja	LBB0_15
## %bb.1:
	leaq	LJTI0_0(%rip), %rax
	movslq	(%rax,%rbx,4), %rcx
	addq	%rax, %rcx
	jmpq	*%rcx
LBB0_2:
	movl	24(%r13), %esi
	movq	%r12, %rdi
	callq	_jc42_temp_to_reg
	movq	(%r13), %rcx
	movq	_t_min@GOTPCREL(%rip), %rdx
	jmp	LBB0_3
LBB0_15:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_16
LBB0_5:
	movl	24(%r13), %esi
	movq	%r12, %rdi
	callq	_jc42_temp_to_reg
	movq	(%r13), %rcx
	movq	_t_max@GOTPCREL(%rip), %rdx
	jmp	LBB0_3
LBB0_7:
	cmpl	$0, 24(%r13)
	jne	LBB0_8
## %bb.9:
	movq	_JC42_TEMP_MIN@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_6:
	movl	24(%r13), %esi
	movq	%r12, %rdi
	callq	_jc42_temp_to_reg
	movq	(%r13), %rcx
	movq	_t_crit@GOTPCREL(%rip), %rdx
LBB0_3:
	movq	(%rdx), %rdx
	movl	%eax, (%rcx,%rdx,4)
	movq	_temp_regs@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx,%rdx,4), %esi
	movq	%r15, %rdi
	movl	%eax, %edx
	jmp	LBB0_4
LBB0_8:
	movq	_JC42_TEMP_MIN_EXTENDED@GOTPCREL(%rip), %rax
LBB0_10:
	movl	$-6000, %esi                    ## imm = 0xE890
	addl	(%rax), %esi
	movq	_JC42_TEMP_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_clamp_val
	movq	%rax, %rbx
	movq	(%r13), %rax
	movq	_t_crit@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %edi
	callq	_jc42_temp_from_reg
	subl	%ebx, %eax
	testl	%eax, %eax
	jle	LBB0_11
## %bb.12:
	movl	$1, %edx
	cmpl	$2250, %eax                     ## imm = 0x8CA
	jb	LBB0_14
## %bb.13:
	cmpl	$4500, %eax                     ## imm = 0x1194
	movl	$3, %edx
	sbbl	$0, %edx
	jmp	LBB0_14
LBB0_11:
	xorl	%edx, %edx
LBB0_14:
	movq	_JC42_CFG_HYST_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	8(%r13), %eax
	movq	_JC42_CFG_HYST_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	orl	%eax, %edx
	movl	%edx, 8(%r13)
	movq	16(%r13), %rdi
	movq	_JC42_REG_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
LBB0_4:
	callq	_i2c_smbus_write_word_swapped
	movl	%eax, %ebx
LBB0_16:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
LJTI0_0:
	.long	L0_0_set_2
	.long	L0_0_set_5
	.long	L0_0_set_7
	.long	L0_0_set_6
	.end_data_region
                                        ## -- End function
	.comm	_t_min,8,3                      ## @t_min
	.comm	_temp_regs,8,3                  ## @temp_regs
	.comm	_t_max,8,3                      ## @t_max
	.comm	_t_crit,8,3                     ## @t_crit
	.comm	_JC42_TEMP_MIN_EXTENDED,4,2     ## @JC42_TEMP_MIN_EXTENDED
	.comm	_JC42_TEMP_MIN,4,2              ## @JC42_TEMP_MIN
	.comm	_JC42_TEMP_MAX,4,2              ## @JC42_TEMP_MAX
	.comm	_JC42_CFG_HYST_MASK,4,2         ## @JC42_CFG_HYST_MASK
	.comm	_JC42_CFG_HYST_SHIFT,4,2        ## @JC42_CFG_HYST_SHIFT
	.comm	_JC42_REG_CONFIG,4,2            ## @JC42_REG_CONFIG
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.no_dead_strip	_jc42_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function jc42_write
_jc42_write:                            ; @jc42_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	x22, x4
	mov	x23, x2
	bl	_dev_get_drvdata
	mov	x20, x0
	ldr	x21, [x0, #16]
	add	x19, x0, #12
	mov	x0, x19
	bl	_mutex_lock
	sub	w8, w23, #128
	cmp	w8, #3
	b.hi	LBB0_3
; %bb.1:
Lloh0:
	adrp	x9, lJTI0_0@PAGE
Lloh1:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
	ldr	w1, [x20, #24]
	mov	x0, x22
	bl	_jc42_temp_to_reg
	mov	x2, x0
	ldr	x8, [x20]
Lloh2:
	adrp	x9, _t_min@GOTPAGE
Lloh3:
	ldr	x9, [x9, _t_min@GOTPAGEOFF]
	b	LBB0_9
LBB0_3:
Lloh4:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_14
LBB0_4:
	ldr	w1, [x20, #24]
	mov	x0, x22
	bl	_jc42_temp_to_reg
	mov	x2, x0
	ldr	x8, [x20]
Lloh7:
	adrp	x9, _t_max@GOTPAGE
Lloh8:
	ldr	x9, [x9, _t_max@GOTPAGEOFF]
	b	LBB0_9
LBB0_5:
	ldr	w8, [x20, #24]
Lloh9:
	adrp	x9, _JC42_TEMP_MIN_EXTENDED@GOTPAGE
Lloh10:
	ldr	x9, [x9, _JC42_TEMP_MIN_EXTENDED@GOTPAGEOFF]
Lloh11:
	adrp	x10, _JC42_TEMP_MIN@GOTPAGE
Lloh12:
	ldr	x10, [x10, _JC42_TEMP_MIN@GOTPAGEOFF]
	cmp	w8, #0
	csel	x8, x10, x9, eq
	ldr	w8, [x8]
	mov	w9, #-6000
	add	w1, w8, w9
Lloh13:
	adrp	x8, _JC42_TEMP_MAX@GOTPAGE
Lloh14:
	ldr	x8, [x8, _JC42_TEMP_MAX@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	mov	x0, x22
	bl	_clamp_val
	mov	x21, x0
	ldr	x8, [x20]
Lloh16:
	adrp	x9, _t_crit@GOTPAGE
Lloh17:
	ldr	x9, [x9, _t_crit@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	ldr	w0, [x8, x9, lsl #2]
	bl	_jc42_temp_from_reg
	sub	w8, w0, w21
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.6:
	cmp	w8, #2250
	b.hs	LBB0_11
; %bb.7:
	mov	w8, #1
	b	LBB0_12
LBB0_8:
	ldr	w1, [x20, #24]
	mov	x0, x22
	bl	_jc42_temp_to_reg
	mov	x2, x0
	ldr	x8, [x20]
Lloh19:
	adrp	x9, _t_crit@GOTPAGE
Lloh20:
	ldr	x9, [x9, _t_crit@GOTPAGEOFF]
LBB0_9:
	ldr	x9, [x9]
	lsl	x9, x9, #2
	str	w2, [x8, x9]
Lloh21:
	adrp	x8, _temp_regs@GOTPAGE
Lloh22:
	ldr	x8, [x8, _temp_regs@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	ldr	w1, [x8, x9]
	mov	x0, x21
                                        ; kill: def $w2 killed $w2 killed $x2
	b	LBB0_13
LBB0_10:
	mov	w8, #0
	b	LBB0_12
LBB0_11:
	lsr	w8, w8, #2
	cmp	w8, #1125
	mov	w8, #2
	cinc	w8, w8, hs
LBB0_12:
	ldr	w9, [x20, #8]
Lloh24:
	adrp	x10, _JC42_CFG_HYST_MASK@GOTPAGE
Lloh25:
	ldr	x10, [x10, _JC42_CFG_HYST_MASK@GOTPAGEOFF]
Lloh26:
	ldr	w10, [x10]
	bic	w9, w9, w10
Lloh27:
	adrp	x10, _JC42_CFG_HYST_SHIFT@GOTPAGE
Lloh28:
	ldr	x10, [x10, _JC42_CFG_HYST_SHIFT@GOTPAGEOFF]
Lloh29:
	ldr	w10, [x10]
	lsl	w8, w8, w10
	orr	w2, w8, w9
	str	w2, [x20, #8]
	ldr	x0, [x20, #16]
Lloh30:
	adrp	x8, _JC42_REG_CONFIG@GOTPAGE
Lloh31:
	ldr	x8, [x8, _JC42_REG_CONFIG@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
LBB0_13:
	bl	_i2c_smbus_write_word_swapped
	mov	x20, x0
LBB0_14:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_4-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_8-LBB0_2)>>2
                                        ; -- End function
	.comm	_t_min,8,3                      ; @t_min
	.comm	_temp_regs,8,3                  ; @temp_regs
	.comm	_t_max,8,3                      ; @t_max
	.comm	_t_crit,8,3                     ; @t_crit
	.comm	_JC42_TEMP_MIN_EXTENDED,4,2     ; @JC42_TEMP_MIN_EXTENDED
	.comm	_JC42_TEMP_MIN,4,2              ; @JC42_TEMP_MIN
	.comm	_JC42_TEMP_MAX,4,2              ; @JC42_TEMP_MAX
	.comm	_JC42_CFG_HYST_MASK,4,2         ; @JC42_CFG_HYST_MASK
	.comm	_JC42_CFG_HYST_SHIFT,4,2        ; @JC42_CFG_HYST_SHIFT
	.comm	_JC42_REG_CONFIG,4,2            ; @JC42_REG_CONFIG
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.no_dead_strip	_jc42_write
.subsections_via_symbols
