	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function max8998_battery_probe
_max8998_battery_probe:                 ## @max8998_battery_probe
	.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
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	callq	_dev_get_drvdata
	movq	8(%rax), %r12
	testq	%r12, %r12
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	$24, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r15
	movq	%rbx, (%rax)
	movq	%r14, 16(%rax)
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_platform_set_drvdata
	movq	16(%r15), %rax
	movq	(%rax), %r14
	movl	(%r12), %eax
	leal	-10(%rax), %ecx
	cmpl	$35, %ecx
	ja	LBB0_6
## %bb.5:
	movq	_MAX8998_REG_CHGR1@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movzbl	%al, %eax
	imull	$205, %eax, %edx
	shrl	$5, %edx
	andl	$-32, %edx
	addl	$-64, %edx
	movq	%r14, %rdi
	movl	$224, %ecx
	callq	_max8998_update_reg
	jmp	LBB0_8
LBB0_1:
	movslq	(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_35
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_35
LBB0_6:
	movq	(%r15), %rdi
	testl	%eax, %eax
	je	LBB0_7
## %bb.14:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_15
LBB0_7:
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_dbg
LBB0_8:
	movl	4(%r12), %eax
	cmpl	$99, %eax
	jle	LBB0_9
## %bb.16:
	cmpl	$200, %eax
	je	LBB0_22
## %bb.17:
	cmpl	$150, %eax
	je	LBB0_21
## %bb.18:
	cmpl	$100, %eax
	jne	LBB0_24
## %bb.19:
	movq	_MAX8998_REG_CHGR1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$8, %edx
	jmp	LBB0_20
LBB0_9:
	cmpl	$-1, %eax
	je	LBB0_23
## %bb.10:
	testl	%eax, %eax
	jne	LBB0_24
## %bb.11:
	movq	(%r15), %rdi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_dbg
	jmp	LBB0_12
LBB0_22:
	movq	_MAX8998_REG_CHGR1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$16, %edx
	jmp	LBB0_20
LBB0_21:
	movq	_MAX8998_REG_CHGR1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	jmp	LBB0_20
LBB0_23:
	movq	_MAX8998_REG_CHGR1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$24, %edx
LBB0_20:
	movl	$24, %ecx
	callq	_max8998_update_reg
LBB0_12:
	movl	8(%r12), %eax
	incl	%eax
	cmpl	$8, %eax
	ja	LBB0_30
## %bb.13:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_29:
	movq	_MAX8998_REG_CHGR2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$48, %edx
	jmp	LBB0_26
LBB0_24:
	movq	(%r15), %rdi
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_15
LBB0_31:
	movq	(%r15), %rdi
	leaq	L_.str.5(%rip), %rsi
	callq	_dev_dbg
	jmp	LBB0_32
LBB0_30:
	movq	(%r15), %rdi
	leaq	L_.str.6(%rip), %rsi
LBB0_15:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_35
LBB0_25:
	movq	_MAX8998_REG_CHGR2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	jmp	LBB0_26
LBB0_27:
	movq	_MAX8998_REG_CHGR2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$16, %edx
	jmp	LBB0_26
LBB0_28:
	movq	_MAX8998_REG_CHGR2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$32, %edx
LBB0_26:
	movl	$48, %ecx
	callq	_max8998_update_reg
LBB0_32:
	movq	%r15, -40(%rbp)
	movq	(%r15), %rdi
	movq	_max8998_battery_desc@GOTPCREL(%rip), %rsi
	leaq	-40(%rbp), %rdx
	callq	_devm_power_supply_register
	movl	%eax, 8(%r15)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_33
## %bb.34:
	movl	8(%r15), %edi
	callq	_PTR_ERR
	movl	%eax, %ebx
	movq	(%r15), %rdi
	leaq	L_.str.7(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_35
LBB0_33:
	xorl	%ebx, %ebx
LBB0_35:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_29, LBB0_29-LJTI0_0
.set L0_0_set_31, LBB0_31-LJTI0_0
.set L0_0_set_30, LBB0_30-LJTI0_0
.set L0_0_set_25, LBB0_25-LJTI0_0
.set L0_0_set_27, LBB0_27-LJTI0_0
.set L0_0_set_28, LBB0_28-LJTI0_0
LJTI0_0:
	.long	L0_0_set_29
	.long	L0_0_set_31
	.long	L0_0_set_30
	.long	L0_0_set_30
	.long	L0_0_set_30
	.long	L0_0_set_30
	.long	L0_0_set_25
	.long	L0_0_set_27
	.long	L0_0_set_28
	.end_data_region
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No platform init data supplied\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MAX8998_REG_CHGR1,4,2          ## @MAX8998_REG_CHGR1
L_.str.1:                               ## @.str.1
	.asciz	"EOC value not set: leave it unchanged.\n"

L_.str.2:                               ## @.str.2
	.asciz	"Invalid EOC value\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.3:                               ## @.str.3
	.asciz	"Restart Level not set: leave it unchanged.\n"

L_.str.4:                               ## @.str.4
	.asciz	"Invalid Restart Level\n"

	.comm	_MAX8998_REG_CHGR2,4,2          ## @MAX8998_REG_CHGR2
L_.str.5:                               ## @.str.5
	.asciz	"Full Timeout not set: leave it unchanged.\n"

L_.str.6:                               ## @.str.6
	.asciz	"Invalid Full Timeout value\n"

	.comm	_max8998_battery_desc,4,2       ## @max8998_battery_desc
L_.str.7:                               ## @.str.7
	.asciz	"failed: power supply register: %d\n"

	.no_dead_strip	_max8998_battery_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function max8998_battery_probe
_max8998_battery_probe:                 ; @max8998_battery_probe
	.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	x20, x0
	ldr	w0, [x0]
	bl	_dev_get_drvdata
	ldr	x22, [x0, #8]
	cbz	x22, LBB0_4
; %bb.1:
	mov	x21, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x20
	mov	w1, #24
	bl	_devm_kzalloc
	cbz	x0, LBB0_5
; %bb.2:
	mov	x19, x0
	str	x20, [x0]
	str	x21, [x0, #16]
	mov	x0, x20
	mov	x1, x19
	bl	_platform_set_drvdata
	ldr	x8, [x19, #16]
	ldr	x20, [x8]
	ldr	w8, [x22]
	sub	w9, w8, #10
	cmp	w9, #35
	b.hi	LBB0_6
; %bb.3:
Lloh3:
	adrp	x9, _MAX8998_REG_CHGR1@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MAX8998_REG_CHGR1@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x9]
	and	w8, w8, #0xff
	mov	w9, #205
	mul	w8, w8, w9
	lsr	w8, w8, #5
	and	w8, w8, #0x7e0
	sub	w2, w8, #64
	mov	x0, x20
	mov	w3, #224
	bl	_max8998_update_reg
	b	LBB0_9
LBB0_4:
	ldrsw	x0, [x20]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh8:
	adrp	x8, _ENODEV@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_28
LBB0_5:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_28
LBB0_6:
	ldr	x0, [x19]
	cbz	w8, LBB0_8
; %bb.7:
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_27
LBB0_8:
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
LBB0_9:
	ldr	w8, [x22, #4]
	cmp	w8, #99
	b.le	LBB0_14
; %bb.10:
	cmp	w8, #200
	b.eq	LBB0_17
; %bb.11:
	cmp	w8, #150
	b.eq	LBB0_18
; %bb.12:
	cmp	w8, #100
	b.ne	LBB0_24
; %bb.13:
Lloh16:
	adrp	x8, _MAX8998_REG_CHGR1@GOTPAGE
Lloh17:
	ldr	x8, [x8, _MAX8998_REG_CHGR1@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #8
	b	LBB0_20
LBB0_14:
	cmn	w8, #1
	b.eq	LBB0_19
; %bb.15:
	cbnz	w8, LBB0_24
; %bb.16:
	ldr	x0, [x19]
Lloh19:
	adrp	x1, l_.str.3@PAGE
Lloh20:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_dbg
	b	LBB0_21
LBB0_17:
Lloh21:
	adrp	x8, _MAX8998_REG_CHGR1@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MAX8998_REG_CHGR1@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #16
	b	LBB0_20
LBB0_18:
Lloh24:
	adrp	x8, _MAX8998_REG_CHGR1@GOTPAGE
Lloh25:
	ldr	x8, [x8, _MAX8998_REG_CHGR1@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	b	LBB0_20
LBB0_19:
Lloh27:
	adrp	x8, _MAX8998_REG_CHGR1@GOTPAGE
Lloh28:
	ldr	x8, [x8, _MAX8998_REG_CHGR1@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #24
LBB0_20:
	mov	w3, #24
	bl	_max8998_update_reg
LBB0_21:
	ldr	w8, [x22, #8]
	add	w8, w8, #1
	cmp	w8, #8
	b.hi	LBB0_26
; %bb.22:
Lloh30:
	adrp	x9, lJTI0_0@PAGE
Lloh31:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_23
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_23:
Lloh32:
	adrp	x8, _MAX8998_REG_CHGR2@GOTPAGE
Lloh33:
	ldr	x8, [x8, _MAX8998_REG_CHGR2@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #48
	b	LBB0_33
LBB0_24:
	ldr	x0, [x19]
Lloh35:
	adrp	x1, l_.str.4@PAGE
Lloh36:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_27
LBB0_25:
	ldr	x0, [x19]
Lloh37:
	adrp	x1, l_.str.5@PAGE
Lloh38:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_dev_dbg
	b	LBB0_34
LBB0_26:
	ldr	x0, [x19]
Lloh39:
	adrp	x1, l_.str.6@PAGE
Lloh40:
	add	x1, x1, l_.str.6@PAGEOFF
LBB0_27:
	bl	_dev_err
Lloh41:
	adrp	x8, _EINVAL@GOTPAGE
Lloh42:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_28:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_29:
	mov	x0, x20
	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_30:
Lloh43:
	adrp	x8, _MAX8998_REG_CHGR2@GOTPAGE
Lloh44:
	ldr	x8, [x8, _MAX8998_REG_CHGR2@GOTPAGEOFF]
Lloh45:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	b	LBB0_33
LBB0_31:
Lloh46:
	adrp	x8, _MAX8998_REG_CHGR2@GOTPAGE
Lloh47:
	ldr	x8, [x8, _MAX8998_REG_CHGR2@GOTPAGEOFF]
Lloh48:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #16
	b	LBB0_33
LBB0_32:
Lloh49:
	adrp	x8, _MAX8998_REG_CHGR2@GOTPAGE
Lloh50:
	ldr	x8, [x8, _MAX8998_REG_CHGR2@GOTPAGEOFF]
Lloh51:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #32
LBB0_33:
	mov	w3, #48
	bl	_max8998_update_reg
LBB0_34:
	str	x19, [sp, #8]
	ldr	x0, [x19]
Lloh52:
	adrp	x1, _max8998_battery_desc@GOTPAGE
Lloh53:
	ldr	x1, [x1, _max8998_battery_desc@GOTPAGEOFF]
	add	x2, sp, #8
	bl	_devm_power_supply_register
	str	w0, [x19, #8]
	bl	_IS_ERR
	cbz	x0, LBB0_36
; %bb.35:
	ldr	w0, [x19, #8]
	bl	_PTR_ERR
	mov	x20, x0
	ldr	x0, [x19]
	str	x20, [sp]
Lloh54:
	adrp	x1, l_.str.7@PAGE
Lloh55:
	add	x1, x1, l_.str.7@PAGEOFF
	bl	_dev_err
	b	LBB0_29
LBB0_36:
	mov	w20, #0
	b	LBB0_29
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGot	Lloh52, Lloh53
	.loh AdrpAdd	Lloh54, Lloh55
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_23-LBB0_23)>>2
	.byte	(LBB0_25-LBB0_23)>>2
	.byte	(LBB0_26-LBB0_23)>>2
	.byte	(LBB0_26-LBB0_23)>>2
	.byte	(LBB0_26-LBB0_23)>>2
	.byte	(LBB0_26-LBB0_23)>>2
	.byte	(LBB0_30-LBB0_23)>>2
	.byte	(LBB0_31-LBB0_23)>>2
	.byte	(LBB0_32-LBB0_23)>>2
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No platform init data supplied\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MAX8998_REG_CHGR1,4,2          ; @MAX8998_REG_CHGR1
l_.str.1:                               ; @.str.1
	.asciz	"EOC value not set: leave it unchanged.\n"

l_.str.2:                               ; @.str.2
	.asciz	"Invalid EOC value\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.3:                               ; @.str.3
	.asciz	"Restart Level not set: leave it unchanged.\n"

l_.str.4:                               ; @.str.4
	.asciz	"Invalid Restart Level\n"

	.comm	_MAX8998_REG_CHGR2,4,2          ; @MAX8998_REG_CHGR2
l_.str.5:                               ; @.str.5
	.asciz	"Full Timeout not set: leave it unchanged.\n"

l_.str.6:                               ; @.str.6
	.asciz	"Invalid Full Timeout value\n"

	.comm	_max8998_battery_desc,4,2       ; @max8998_battery_desc
l_.str.7:                               ; @.str.7
	.asciz	"failed: power supply register: %d\n"

	.no_dead_strip	_max8998_battery_probe
.subsections_via_symbols
