	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function max8997_battery_probe
_max8997_battery_probe:                 ## @max8997_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, %r14
	movl	(%rdi), %edi
	callq	_dev_get_drvdata
	movq	%rax, %r15
	movl	4(%rax), %edi
	callq	_dev_get_platdata
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r12
	movl	(%rax), %eax
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:
	addl	$-50, %eax
	cltq
	imulq	$1717986919, %rax, %rax         ## imm = 0x66666667
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$34, %rax
	addl	%ecx, %eax
	xorl	%edx, %edx
	testl	%eax, %eax
	cmovgl	%eax, %edx
	cmpl	$15, %edx
	movl	$15, %eax
	cmovael	%eax, %edx
	movl	(%r15), %edi
	movq	_MAX8997_REG_MBCCTRL5@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$15, %ecx
	callq	_max8997_update_reg
	testl	%eax, %eax
	js	LBB0_5
LBB0_6:
	movslq	4(%r12), %rdx
	cmpq	$8, %rdx
	jae	LBB0_7
## %bb.8:
	movl	$225, %eax
	btl	%edx, %eax
	jb	LBB0_9
LBB0_7:
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_15
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_15
LBB0_9:
	leaq	l_switch.table.max8997_battery_probe(%rip), %rax
	movl	(%rax,%rdx,4), %edx
	movl	(%r15), %edi
	movq	_MAX8997_REG_MBCCTRL1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$112, %ecx
	callq	_max8997_update_reg
	testl	%eax, %eax
	js	LBB0_5
## %bb.10:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	$24, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_11
## %bb.12:
	movq	%rax, %rbx
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_platform_set_drvdata
	movq	%r14, 16(%rbx)
	movq	%r15, 8(%rbx)
	movq	%rbx, -40(%rbp)
	movq	_max8997_battery_desc@GOTPCREL(%rip), %rsi
	leaq	-40(%rbp), %rdx
	movq	%r14, %rdi
	callq	_devm_power_supply_register
	movl	%eax, (%rbx)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_13
## %bb.14:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movl	(%rbx), %edi
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_15
LBB0_5:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_15:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_13:
	xorl	%ebx, %ebx
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MAX8997_REG_MBCCTRL5,4,2       ## @MAX8997_REG_MBCCTRL5
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot use i2c bus.\n"

	.comm	_MAX8997_REG_MBCCTRL1,4,2       ## @MAX8997_REG_MBCCTRL1
L_.str.1:                               ## @.str.1
	.asciz	"incorrect timeout value (%d)\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_max8997_battery_desc,4,2       ## @max8997_battery_desc
L_.str.2:                               ## @.str.2
	.asciz	"failed: power supply register\n"

	.no_dead_strip	_max8997_battery_probe
	.section	__TEXT,__const
	.p2align	2                               ## @switch.table.max8997_battery_probe
l_switch.table.max8997_battery_probe:
	.long	112                             ## 0x70
	.long	32                              ## 0x20
	.long	32                              ## 0x20
	.long	32                              ## 0x20
	.long	32                              ## 0x20
	.long	32                              ## 0x20
	.long	48                              ## 0x30
	.long	64                              ## 0x40

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function max8997_battery_probe
_max8997_battery_probe:                 ; @max8997_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	x19, x0
	ldr	w0, [x0]
	bl	_dev_get_drvdata
	mov	x20, x0
	ldr	w0, [x0, #4]
	bl	_dev_get_platdata
	cbz	x0, LBB0_6
; %bb.1:
	mov	x22, x0
	ldr	w8, [x0]
	cbz	w8, LBB0_3
; %bb.2:
	sub	w8, w8, #50
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #34
	add	w8, w8, w9
	cmp	w8, #0
	csel	w8, w8, wzr, gt
	mov	w9, #15
	cmp	w8, #15
	csel	w2, w8, w9, lo
	ldr	w0, [x20]
Lloh0:
	adrp	x8, _MAX8997_REG_MBCCTRL5@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX8997_REG_MBCCTRL5@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w3, #15
	bl	_max8997_update_reg
	tbnz	w0, #31, LBB0_12
LBB0_3:
	ldrsw	x8, [x22, #4]
	cmp	w8, #8
	b.hs	LBB0_5
; %bb.4:
	mov	w9, #225
	lsr	w9, w9, w8
	tbnz	w9, #0, LBB0_8
LBB0_5:
	str	x8, [sp]
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_err
LBB0_6:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_13
LBB0_8:
Lloh7:
	adrp	x9, l_switch.table.max8997_battery_probe@PAGE
Lloh8:
	add	x9, x9, l_switch.table.max8997_battery_probe@PAGEOFF
	ldr	w2, [x9, x8, lsl #2]
	ldr	w0, [x20]
Lloh9:
	adrp	x8, _MAX8997_REG_MBCCTRL1@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MAX8997_REG_MBCCTRL1@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	w3, #112
	bl	_max8997_update_reg
	tbnz	w0, #31, LBB0_12
; %bb.9:
Lloh12:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #24
	bl	_devm_kzalloc
	cbz	x0, LBB0_14
; %bb.10:
	mov	x21, x0
	mov	x0, x19
	mov	x1, x21
	bl	_platform_set_drvdata
	stp	x20, x19, [x21, #8]
	str	x21, [sp, #8]
Lloh15:
	adrp	x1, _max8997_battery_desc@GOTPAGE
Lloh16:
	ldr	x1, [x1, _max8997_battery_desc@GOTPAGEOFF]
	add	x2, sp, #8
	mov	x0, x19
	bl	_devm_power_supply_register
	str	w0, [x21]
	bl	_IS_ERR
	cbz	x0, LBB0_15
; %bb.11:
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	ldr	w0, [x21]
	bl	_PTR_ERR
	mov	x21, x0
	b	LBB0_13
LBB0_12:
	mov	x21, x0
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
LBB0_13:
	mov	x0, x21
	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:
Lloh21:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_7
LBB0_15:
	mov	w21, #0
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MAX8997_REG_MBCCTRL5,4,2       ; @MAX8997_REG_MBCCTRL5
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot use i2c bus.\n"

	.comm	_MAX8997_REG_MBCCTRL1,4,2       ; @MAX8997_REG_MBCCTRL1
l_.str.1:                               ; @.str.1
	.asciz	"incorrect timeout value (%d)\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_max8997_battery_desc,4,2       ; @max8997_battery_desc
l_.str.2:                               ; @.str.2
	.asciz	"failed: power supply register\n"

	.no_dead_strip	_max8997_battery_probe
	.section	__TEXT,__const
	.p2align	2                               ; @switch.table.max8997_battery_probe
l_switch.table.max8997_battery_probe:
	.long	112                             ; 0x70
	.long	32                              ; 0x20
	.long	32                              ; 0x20
	.long	32                              ; 0x20
	.long	32                              ; 0x20
	.long	32                              ; 0x20
	.long	48                              ; 0x30
	.long	64                              ; 0x40

.subsections_via_symbols
