	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function axp20x_set_max_constant_charge_current
_axp20x_set_max_constant_charge_current: ## @axp20x_set_max_constant_charge_current
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %eax
	movq	8(%rdi), %rdx
	movl	(%rdx), %ecx
	movl	4(%rdx), %esi
	subl	%ecx, %eax
	cltd
	idivl	%esi
	testl	%eax, %eax
	js	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	movq	_AXP20X_CHRG_CTRL1_TGT_CURR@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jg	LBB0_2
## %bb.3:
	movq	%rdi, %r14
	imull	%esi, %ebx
	addl	%ecx, %ebx
	cmpl	(%rdi), %ebx
	jle	LBB0_5
## %bb.4:
	movl	4(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
	movl	%ebx, (%r14)
	jmp	LBB0_7
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_8
LBB0_5:
	movl	%ebx, (%r14)
	leaq	-20(%rbp), %rsi
	movq	%r14, %rdi
	callq	_axp20x_get_constant_charge_current
	cmpl	%ebx, -20(%rbp)
	jle	LBB0_7
## %bb.6:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_axp20x_set_constant_charge_current
LBB0_7:
	xorl	%eax, %eax
LBB0_8:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AXP20X_CHRG_CTRL1_TGT_CURR,4,2 ## @AXP20X_CHRG_CTRL1_TGT_CURR
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Setting max constant charge current higher than previously defined. Note that increasing the constant charge current may damage your battery.\n"

	.no_dead_strip	_axp20x_set_max_constant_charge_current
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function axp20x_set_max_constant_charge_current
_axp20x_set_max_constant_charge_current: ; @axp20x_set_max_constant_charge_current
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x9, [x0, #8]
	ldp	w8, w9, [x9]
	sub	w10, w1, w8
	sdiv	w10, w10, w9
	tbnz	w10, #31, LBB0_4
; %bb.1:
Lloh0:
	adrp	x11, _AXP20X_CHRG_CTRL1_TGT_CURR@GOTPAGE
Lloh1:
	ldr	x11, [x11, _AXP20X_CHRG_CTRL1_TGT_CURR@GOTPAGEOFF]
Lloh2:
	ldr	w11, [x11]
	cmp	w10, w11
	b.gt	LBB0_4
; %bb.2:
	mov	x19, x0
	madd	w20, w10, w9, w8
	ldr	w8, [x0]
	cmp	w20, w8
	b.le	LBB0_5
; %bb.3:
	ldr	w0, [x19, #4]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
	mov	w0, #0
	str	w20, [x19]
	b	LBB0_8
LBB0_4:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_5:
	str	w20, [x19]
	add	x1, sp, #12
	mov	x0, x19
	bl	_axp20x_get_constant_charge_current
	ldr	w8, [sp, #12]
	cmp	w8, w20
	b.le	LBB0_7
; %bb.6:
	mov	x0, x19
	mov	x1, x20
	bl	_axp20x_set_constant_charge_current
LBB0_7:
	mov	w0, #0
LBB0_8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_AXP20X_CHRG_CTRL1_TGT_CURR,4,2 ; @AXP20X_CHRG_CTRL1_TGT_CURR
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Setting max constant charge current higher than previously defined. Note that increasing the constant charge current may damage your battery.\n"

	.no_dead_strip	_axp20x_set_max_constant_charge_current
.subsections_via_symbols
