	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function max14577_init_constant_voltage
_max14577_init_constant_voltage:        ## @max14577_init_constant_voltage
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	_MAXIM_CHARGER_CONSTANT_VOLTAGE_MIN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	cmpl	%esi, %ecx
	ja	LBB0_7
## %bb.1:
	movq	_MAXIM_CHARGER_CONSTANT_VOLTAGE_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%esi, %eax
	jae	LBB0_2
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	popq	%rbp
	retq
LBB0_2:
	xorl	%edx, %edx
	cmpl	$4200000, %esi                  ## imm = 0x401640
	je	LBB0_6
## %bb.3:
	movl	$31, %edx
	cmpl	%esi, %eax
	je	LBB0_6
## %bb.4:
	cmpl	$4280000, %esi                  ## imm = 0x414EC0
	ja	LBB0_7
## %bb.5:
	movl	%esi, %eax
	subl	%ecx, %eax
	movq	_MAXIM_CHARGER_CONSTANT_VOLTAGE_STEP@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	divl	(%rcx)
	movl	%eax, %edx
	cmpl	$4180001, %esi                  ## imm = 0x3FC821
	adcl	$0, %edx
LBB0_6:
	movq	_CHGCTRL3_MBCCVWRC_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %edx
	movq	(%rdi), %rax
	movl	(%rax), %edi
	movq	_MAX14577_CHG_REG_CHG_CTRL3@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	popq	%rbp
	jmp	_max14577_write_reg             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MAXIM_CHARGER_CONSTANT_VOLTAGE_MIN,4,2 ## @MAXIM_CHARGER_CONSTANT_VOLTAGE_MIN
	.comm	_MAXIM_CHARGER_CONSTANT_VOLTAGE_MAX,4,2 ## @MAXIM_CHARGER_CONSTANT_VOLTAGE_MAX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MAXIM_CHARGER_CONSTANT_VOLTAGE_STEP,4,2 ## @MAXIM_CHARGER_CONSTANT_VOLTAGE_STEP
	.comm	_CHGCTRL3_MBCCVWRC_SHIFT,4,2    ## @CHGCTRL3_MBCCVWRC_SHIFT
	.comm	_MAX14577_CHG_REG_CHG_CTRL3,4,2 ## @MAX14577_CHG_REG_CHG_CTRL3
	.no_dead_strip	_max14577_init_constant_voltage
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function max14577_init_constant_voltage
_max14577_init_constant_voltage:        ; @max14577_init_constant_voltage
	.cfi_startproc
; %bb.0:
Lloh0:
	adrp	x8, _MAXIM_CHARGER_CONSTANT_VOLTAGE_MIN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAXIM_CHARGER_CONSTANT_VOLTAGE_MIN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.hi	LBB0_2
; %bb.1:
Lloh3:
	adrp	x9, _MAXIM_CHARGER_CONSTANT_VOLTAGE_MAX@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MAXIM_CHARGER_CONSTANT_VOLTAGE_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w9, w1
	b.hs	LBB0_3
LBB0_2:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	ret
LBB0_3:
	mov	w10, #5696
	movk	w10, #64, lsl #16
	cmp	w1, w10
	b.ne	LBB0_5
; %bb.4:
	mov	w8, #0
	b	LBB0_9
LBB0_5:
	cmp	w9, w1
	b.ne	LBB0_7
; %bb.6:
	mov	w8, #31
	b	LBB0_9
LBB0_7:
	mov	w9, #20160
	movk	w9, #65, lsl #16
	cmp	w1, w9
	b.hi	LBB0_2
; %bb.8:
Lloh9:
	adrp	x9, _MAXIM_CHARGER_CONSTANT_VOLTAGE_STEP@GOTPAGE
Lloh10:
	ldr	x9, [x9, _MAXIM_CHARGER_CONSTANT_VOLTAGE_STEP@GOTPAGEOFF]
	sub	w8, w1, w8
Lloh11:
	ldr	w9, [x9]
	udiv	w8, w8, w9
	mov	w9, #51233
	movk	w9, #63, lsl #16
	cmp	w1, w9
	cinc	w8, w8, lo
LBB0_9:
Lloh12:
	adrp	x9, _CHGCTRL3_MBCCVWRC_SHIFT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _CHGCTRL3_MBCCVWRC_SHIFT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	lsl	w2, w8, w9
	ldr	x8, [x0]
	ldr	w0, [x8]
Lloh15:
	adrp	x8, _MAX14577_CHG_REG_CHG_CTRL3@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MAX14577_CHG_REG_CHG_CTRL3@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	b	_max14577_write_reg
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_MAXIM_CHARGER_CONSTANT_VOLTAGE_MIN,4,2 ; @MAXIM_CHARGER_CONSTANT_VOLTAGE_MIN
	.comm	_MAXIM_CHARGER_CONSTANT_VOLTAGE_MAX,4,2 ; @MAXIM_CHARGER_CONSTANT_VOLTAGE_MAX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MAXIM_CHARGER_CONSTANT_VOLTAGE_STEP,4,2 ; @MAXIM_CHARGER_CONSTANT_VOLTAGE_STEP
	.comm	_CHGCTRL3_MBCCVWRC_SHIFT,4,2    ; @CHGCTRL3_MBCCVWRC_SHIFT
	.comm	_MAX14577_CHG_REG_CHG_CTRL3,4,2 ; @MAX14577_CHG_REG_CHG_CTRL3
	.no_dead_strip	_max14577_init_constant_voltage
.subsections_via_symbols
