	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nct7802_write_voltage
_nct7802_write_voltage:                 ## @nct7802_write_voltage
	.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	%rdi, %r14
	movq	_REG_VOLTAGE_LIMIT_MSB_SHIFT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%edx, %rbx
	movq	-8(%rax,%rbx,8), %rax
	movslq	%esi, %r13
	movl	(%rax,%r13,4), %r12d
	movq	_nct7802_vmul@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movl	(%rax,%r13,4), %eax
	movl	%eax, %edx
	shll	$10, %edx
	subl	%eax, %edx
	movq	%rcx, %rdi
	xorl	%esi, %esi
	callq	_clamp_val
	movq	(%r15), %rcx
	movl	(%rcx,%r13,4), %esi
	movq	%rax, %rdi
	callq	_DIV_ROUND_CLOSEST
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	4(%r14), %edi
	movq	_REG_VOLTAGE_LIMIT_LSB@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-8(%rax,%rbx,8), %rax
	movl	(%rax,%r13,4), %esi
	movzbl	%r15b, %edx
	callq	_regmap_write
	testl	%eax, %eax
	js	LBB0_2
## %bb.1:
	movl	4(%r14), %edi
	movq	_REG_VOLTAGE_LIMIT_MSB@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%r13,4), %esi
	movb	$8, %cl
	subb	%r12b, %cl
	movl	$768, %edx                      ## imm = 0x300
	shrl	%cl, %edx
	andl	$768, %r15d                     ## imm = 0x300
	shrq	%cl, %r15
	movq	%r15, %rcx
	callq	_regmap_update_bits
LBB0_2:
	movl	%eax, %ebx
	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
                                        ## -- End function
	.comm	_REG_VOLTAGE_LIMIT_MSB_SHIFT,8,3 ## @REG_VOLTAGE_LIMIT_MSB_SHIFT
	.comm	_nct7802_vmul,8,3               ## @nct7802_vmul
	.comm	_REG_VOLTAGE_LIMIT_LSB,8,3      ## @REG_VOLTAGE_LIMIT_LSB
	.comm	_REG_VOLTAGE_LIMIT_MSB,8,3      ## @REG_VOLTAGE_LIMIT_MSB
	.no_dead_strip	_nct7802_write_voltage
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nct7802_write_voltage
_nct7802_write_voltage:                 ; @nct7802_write_voltage
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _REG_VOLTAGE_LIMIT_MSB_SHIFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REG_VOLTAGE_LIMIT_MSB_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	sub	w9, w2, #1
	sbfiz	x22, x9, #3, #32
	ldr	x8, [x8, x22]
	sbfiz	x24, x20, #2, #32
	ldr	w23, [x8, x24]
Lloh3:
	adrp	x21, _nct7802_vmul@GOTPAGE
Lloh4:
	ldr	x21, [x21, _nct7802_vmul@GOTPAGEOFF]
	ldr	x8, [x21]
	ldr	w8, [x8, x24]
	lsl	w9, w8, #10
	sub	w2, w9, w8
	mov	x0, x3
	mov	w1, #0
	bl	_clamp_val
	ldr	x8, [x21]
	ldr	w1, [x8, x24]
	bl	_DIV_ROUND_CLOSEST
	mov	x21, x0
	mov	x0, x19
	bl	_mutex_lock
	ldr	w0, [x19, #4]
Lloh5:
	adrp	x8, _REG_VOLTAGE_LIMIT_LSB@GOTPAGE
Lloh6:
	ldr	x8, [x8, _REG_VOLTAGE_LIMIT_LSB@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	ldr	x8, [x8, x22]
	ldr	w1, [x8, x24]
	and	x2, x21, #0xff
	bl	_regmap_write
	tbnz	w0, #31, LBB0_2
; %bb.1:
	sxtw	x8, w20
	mov	w9, #8
	sub	w9, w9, w23
	ldr	w0, [x19, #4]
Lloh8:
	adrp	x10, _REG_VOLTAGE_LIMIT_MSB@GOTPAGE
Lloh9:
	ldr	x10, [x10, _REG_VOLTAGE_LIMIT_MSB@GOTPAGEOFF]
Lloh10:
	ldr	x10, [x10]
	ldr	w1, [x10, x8, lsl #2]
	mov	w8, #768
	lsr	w2, w8, w9
	and	x8, x21, #0x300
	lsr	x3, x8, x9
	bl	_regmap_update_bits
LBB0_2:
	mov	x22, x0
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x22
	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	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_VOLTAGE_LIMIT_MSB_SHIFT,8,3 ; @REG_VOLTAGE_LIMIT_MSB_SHIFT
	.comm	_nct7802_vmul,8,3               ; @nct7802_vmul
	.comm	_REG_VOLTAGE_LIMIT_LSB,8,3      ; @REG_VOLTAGE_LIMIT_LSB
	.comm	_REG_VOLTAGE_LIMIT_MSB,8,3      ; @REG_VOLTAGE_LIMIT_MSB
	.no_dead_strip	_nct7802_write_voltage
.subsections_via_symbols
