	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_charger_current
_set_charger_current:                   ## @set_charger_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	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	addl	$-50, %esi
	cmpl	$1550, %esi                     ## imm = 0x60E
	ja	LBB0_2
## %bb.1:
	movq	%rdx, %rbx
	testq	%rdx, %rdx
	je	LBB0_2
## %bb.4:
	movq	%rdi, %r14
	movzwl	%si, %eax
	shrl	%eax
	imull	$5243, %eax, %r15d              ## imm = 0x147B
	shrl	$17, %r15d
	movl	(%rdi), %edi
	movq	_PM8607_CHG_CTRL2@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	callq	_pm860x_reg_read
	andl	$31, %eax
	imull	$50, %eax, %eax
	addl	$50, %eax
	movl	%eax, (%rbx)
	movl	(%r14), %edi
	movl	(%r12), %esi
	movl	$31, %edx
	movl	%r15d, %ecx
	callq	_pm860x_set_bits
	movl	%eax, %ecx
	sarl	$31, %ecx
	andl	%ecx, %eax
	jmp	LBB0_3
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_3:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PM8607_CHG_CTRL2,4,2           ## @PM8607_CHG_CTRL2
	.no_dead_strip	_set_charger_current
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_charger_current
_set_charger_current:                   ; @set_charger_current
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	sub	w8, w1, #50
	cmp	w8, #1550
	ccmp	x2, #0, #4, ls
	b.ne	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_3
LBB0_2:
	mov	x19, x2
	mov	x20, x0
	ubfx	w8, w8, #1, #15
	mov	w9, #5243
	mul	w8, w8, w9
	lsr	w21, w8, #17
	ldr	w0, [x0]
Lloh3:
	adrp	x22, _PM8607_CHG_CTRL2@GOTPAGE
Lloh4:
	ldr	x22, [x22, _PM8607_CHG_CTRL2@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_pm860x_reg_read
	and	w8, w0, #0x1f
	mov	w9, #50
	mul	w8, w8, w9
	add	w8, w8, #50
	str	w8, [x19]
	ldr	w0, [x20]
	ldr	w1, [x22]
	mov	w2, #31
	mov	x3, x21
	bl	_pm860x_set_bits
	cmp	w0, #0
	csel	w0, w0, wzr, lt
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PM8607_CHG_CTRL2,4,2           ; @PM8607_CHG_CTRL2
	.no_dead_strip	_set_charger_current
.subsections_via_symbols
