	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function adt7411_write_in_chan
_adt7411_write_in_chan:                 ## @adt7411_write_in_chan
	.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, %r12
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, %r13d
	movq	%rdi, %rbx
	callq	_dev_get_drvdata
	movq	%rax, %r14
	movq	8(%rax), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	4(%r14), %rdi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movq	%rbx, %rdi
	callq	_adt7411_update_vref
	testl	%eax, %eax
	js	LBB0_7
## %bb.1:
	movl	(%r14), %eax
	movl	%eax, %ecx
	shll	$8, %ecx
	subl	%eax, %ecx
	leal	255(%rcx), %edx
	testl	%ecx, %ecx
	cmovnsl	%ecx, %edx
	sarl	$8, %edx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_clamp_val
	shlq	$8, %rax
	movl	(%r14), %esi
	movq	%rax, %rdi
	callq	_DIV_ROUND_CLOSEST
	movq	%rax, %rbx
	cmpl	$129, %r13d
	je	LBB0_5
## %bb.2:
	cmpl	$128, %r13d
	jne	LBB0_4
## %bb.3:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_ADT7411_REG_IN_LOW
	jmp	LBB0_6
LBB0_5:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_ADT7411_REG_IN_HIGH
LBB0_6:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	movq	%rbx, %rdx
	callq	_i2c_smbus_write_byte_data
LBB0_7:
	movl	%eax, %r15d
	jmp	LBB0_8
LBB0_4:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_8:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.no_dead_strip	_adt7411_write_in_chan
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function adt7411_write_in_chan
_adt7411_write_in_chan:                 ; @adt7411_write_in_chan
	.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	x23, x3
	mov	x21, x2
	mov	x22, x1
	mov	x25, x0
	bl	_dev_get_drvdata
	mov	x24, x0
	ldr	x20, [x0, #8]
	add	x19, x0, #4
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x25
	bl	_adt7411_update_vref
	tbnz	w0, #31, LBB0_6
; %bb.1:
	ldr	w8, [x24]
	lsl	w9, w8, #8
	sub	w8, w9, w8
	add	w9, w8, #255
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w2, w8, #8
	mov	x0, x23
	mov	w1, #0
	bl	_clamp_val
	lsl	x0, x0, #8
	ldr	w1, [x24]
	bl	_DIV_ROUND_CLOSEST
	mov	x23, x0
	cmp	w22, #129
	b.eq	LBB0_4
; %bb.2:
	cmp	w22, #128
	b.ne	LBB0_7
; %bb.3:
	mov	x0, x21
	bl	_ADT7411_REG_IN_LOW
	b	LBB0_5
LBB0_4:
	mov	x0, x21
	bl	_ADT7411_REG_IN_HIGH
LBB0_5:
	mov	x1, x0
	mov	x0, x20
	mov	x2, x23
	bl	_i2c_smbus_write_byte_data
LBB0_6:
	mov	x25, x0
	b	LBB0_8
LBB0_7:
Lloh0:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w25, w8
LBB0_8:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x25
	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
	.cfi_endproc
                                        ; -- End function
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.no_dead_strip	_adt7411_write_in_chan
.subsections_via_symbols
