	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_charge_current
_set_charge_current:                    ## @set_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	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	cmpl	$501, %esi                      ## imm = 0x1F5
	jl	LBB0_2
## %bb.1:
	movl	4(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_warn
	movq	_MAX_WARM_CHG_CURR_SEL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -36(%rbp)
	xorl	%r15d, %r15d
	jmp	LBB0_8
LBB0_2:
	cmpl	$9, %ebx
	jg	LBB0_4
## %bb.3:
	movl	4(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_err
	movq	_MIN_CHG_CURR_SEL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -36(%rbp)
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_8
LBB0_4:
	movq	_warm_charge_curr@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	%r15, %rdi
	callq	_ARRAY_SIZE
	leaq	-36(%rbp), %rcx
	leaq	-40(%rbp), %r8
	movq	%r15, %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	callq	_find_selector_for_value_low
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %r15d
	movq	_MIN_CHG_CURR_SEL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -36(%rbp)
	jmp	LBB0_8
LBB0_6:
	xorl	%r15d, %r15d
	cmpl	$0, -40(%rbp)
	jne	LBB0_8
## %bb.7:
	movl	4(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_warn
LBB0_8:
	movl	(%r14), %edi
	movq	_BD70528_REG_CHG_CHG_CURR_WARM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BD70528_MASK_CHG_CHG_CURR@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movl	-36(%rbp), %ecx
	callq	_regmap_update_bits
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	4(%r14), %edi
	leaq	L_.str.3(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_err
LBB0_10:
	movl	-36(%rbp), %ecx
	movq	_MAX_COLD_CHG_CURR_SEL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jbe	LBB0_12
## %bb.11:
	movl	%eax, -36(%rbp)
	movl	%eax, %ecx
LBB0_12:
	testl	%ebx, %ebx
	jne	LBB0_14
## %bb.13:
	movl	(%r14), %edi
	movq	_BD70528_REG_CHG_CHG_CURR_COLD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %edx
	callq	_regmap_update_bits
	movl	%eax, %ebx
LBB0_14:
	testl	%r15d, %r15d
	cmovnel	%r15d, %ebx
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Requested charge current %u exceed maximum (500mA)\n"

	.comm	_MAX_WARM_CHG_CURR_SEL,4,2      ## @MAX_WARM_CHG_CURR_SEL
L_.str.1:                               ## @.str.1
	.asciz	"Requested charge current %u smaller than min (10mA)\n"

	.comm	_MIN_CHG_CURR_SEL,4,2           ## @MIN_CHG_CURR_SEL
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_warm_charge_curr,8,3           ## @warm_charge_curr
L_.str.2:                               ## @.str.2
	.asciz	"Unsupported charge current %u mA\n"

	.comm	_BD70528_REG_CHG_CHG_CURR_WARM,4,2 ## @BD70528_REG_CHG_CHG_CURR_WARM
	.comm	_BD70528_MASK_CHG_CHG_CURR,4,2  ## @BD70528_MASK_CHG_CHG_CURR
L_.str.3:                               ## @.str.3
	.asciz	"Charge current write failure (%d)\n"

	.comm	_MAX_COLD_CHG_CURR_SEL,4,2      ## @MAX_COLD_CHG_CURR_SEL
	.comm	_BD70528_REG_CHG_CHG_CURR_COLD,4,2 ## @BD70528_REG_CHG_CHG_CURR_COLD
	.no_dead_strip	_set_charge_current
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_charge_current
_set_charge_current:                    ; @set_charge_current
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x21, x1
	mov	x19, x0
	cmp	w1, #501
	b.lt	LBB0_2
; %bb.1:
	ldr	w0, [x19, #4]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dev_warn
	mov	w20, #0
Lloh2:
	adrp	x8, _MAX_WARM_CHG_CURR_SEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MAX_WARM_CHG_CURR_SEL@GOTPAGEOFF]
	b	LBB0_6
LBB0_2:
	cmp	w21, #9
	b.gt	LBB0_4
; %bb.3:
	ldr	w0, [x19, #4]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x21
	bl	_dev_err
Lloh6:
	adrp	x8, _MIN_CHG_CURR_SEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MIN_CHG_CURR_SEL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [sp, #12]
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_7
LBB0_4:
Lloh12:
	adrp	x8, _warm_charge_curr@GOTPAGE
Lloh13:
	ldr	x8, [x8, _warm_charge_curr@GOTPAGEOFF]
Lloh14:
	ldr	x20, [x8]
	mov	x0, x20
	bl	_ARRAY_SIZE
	mov	x1, x0
	add	x3, sp, #12
	add	x4, sp, #8
	mov	x0, x20
	mov	x2, x21
	bl	_find_selector_for_value_low
	cbz	w0, LBB0_14
; %bb.5:
	mov	x20, x0
Lloh15:
	adrp	x8, _MIN_CHG_CURR_SEL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MIN_CHG_CURR_SEL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	str	w8, [sp, #12]
LBB0_7:
Lloh17:
	adrp	x8, _BD70528_REG_CHG_CHG_CURR_WARM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _BD70528_REG_CHG_CHG_CURR_WARM@GOTPAGEOFF]
	ldr	w0, [x19]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x22, _BD70528_MASK_CHG_CHG_CURR@GOTPAGE
Lloh21:
	ldr	x22, [x22, _BD70528_MASK_CHG_CHG_CURR@GOTPAGEOFF]
	ldr	w2, [x22]
	ldr	w3, [sp, #12]
	bl	_regmap_update_bits
	mov	x21, x0
	cbz	w0, LBB0_9
; %bb.8:
	ldr	w0, [x19, #4]
Lloh22:
	adrp	x1, l_.str.3@PAGE
Lloh23:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x2, x21
	bl	_dev_err
LBB0_9:
	ldr	w3, [sp, #12]
Lloh24:
	adrp	x8, _MAX_COLD_CHG_CURR_SEL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _MAX_COLD_CHG_CURR_SEL@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	cmp	w3, w8
	b.ls	LBB0_11
; %bb.10:
	str	w8, [sp, #12]
	mov	x3, x8
LBB0_11:
	cbnz	w21, LBB0_13
; %bb.12:
	ldr	w0, [x19]
Lloh27:
	adrp	x8, _BD70528_REG_CHG_CHG_CURR_COLD@GOTPAGE
Lloh28:
	ldr	x8, [x8, _BD70528_REG_CHG_CHG_CURR_COLD@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	ldr	w2, [x22]
	bl	_regmap_update_bits
	mov	x21, x0
LBB0_13:
	cmp	w20, #0
	csel	w0, w21, w20, eq
	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
	add	sp, sp, #64
	ret
LBB0_14:
	ldr	w8, [sp, #8]
	cbnz	w8, LBB0_16
; %bb.15:
	ldr	w0, [x19, #4]
Lloh30:
	adrp	x1, l_.str.2@PAGE
Lloh31:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x21
	bl	_dev_warn
LBB0_16:
	mov	w20, #0
	b	LBB0_7
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Requested charge current %u exceed maximum (500mA)\n"

	.comm	_MAX_WARM_CHG_CURR_SEL,4,2      ; @MAX_WARM_CHG_CURR_SEL
l_.str.1:                               ; @.str.1
	.asciz	"Requested charge current %u smaller than min (10mA)\n"

	.comm	_MIN_CHG_CURR_SEL,4,2           ; @MIN_CHG_CURR_SEL
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_warm_charge_curr,8,3           ; @warm_charge_curr
l_.str.2:                               ; @.str.2
	.asciz	"Unsupported charge current %u mA\n"

	.comm	_BD70528_REG_CHG_CHG_CURR_WARM,4,2 ; @BD70528_REG_CHG_CHG_CURR_WARM
	.comm	_BD70528_MASK_CHG_CHG_CURR,4,2  ; @BD70528_MASK_CHG_CHG_CURR
l_.str.3:                               ; @.str.3
	.asciz	"Charge current write failure (%d)\n"

	.comm	_MAX_COLD_CHG_CURR_SEL,4,2      ; @MAX_COLD_CHG_CURR_SEL
	.comm	_BD70528_REG_CHG_CHG_CURR_COLD,4,2 ; @BD70528_REG_CHG_CHG_CURR_COLD
	.no_dead_strip	_set_charge_current
.subsections_via_symbols
