	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function da9030_battery_probe
_da9030_battery_probe:                  ## @da9030_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	$0, -48(%rbp)
	movq	8(%rdi), %rbx
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.3:
	cmpl	$1499, (%rbx)                   ## imm = 0x5DB
	jg	LBB0_1
## %bb.4:
	movl	$-4351, %eax                    ## imm = 0xEF01
	addl	4(%rbx), %eax
	cmpl	$-352, %eax                     ## imm = 0xFEA0
	ja	LBB0_5
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%rdi, %r13
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$48, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %r14
	movl	(%r13), %eax
	movl	%eax, 16(%r14)
	movq	24(%rbx), %rax
	imull	$1000, %eax, %ecx               ## imm = 0x3E8
	testq	%rax, %rax
	movl	$10000, %edi                    ## imm = 0x2710
	cmovnel	%ecx, %edi
	callq	_msecs_to_jiffies
	movl	%eax, 32(%r14)
	movl	(%rbx), %eax
	movl	%eax, (%r14)
	movl	4(%rbx), %eax
	movl	%eax, 4(%r14)
	movl	16(%rbx), %eax
	movl	%eax, 44(%r14)
	movl	12(%rbx), %eax
	movl	%eax, 40(%r14)
	movl	8(%rbx), %eax
	movl	%eax, 36(%r14)
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_da9030_battery_convert_thresholds
	movq	%r14, %rdi
	callq	_da9030_battery_charger_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.8:
	leaq	8(%r14), %r15
	movq	_da9030_charging_monitor@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_INIT_DELAYED_WORK
	movl	32(%r14), %esi
	movq	%r15, %rdi
	callq	_schedule_delayed_work
	movq	_da9030_battery_event@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r14)
	movq	_DA9030_EVENT_CHDET@GOTPCREL(%rip), %rax
	movq	_DA9030_EVENT_VBATMON@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	leaq	12(%r14), %r12
	movq	_DA9030_EVENT_CHIOVER@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movl	16(%r14), %edi
	movq	_DA9030_EVENT_TBAT@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r12, %rsi
	callq	_da903x_register_notifier
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.9:
	movq	%r14, %rdi
	callq	_da9030_battery_setup_psy
	movq	%r14, -48(%rbp)
	movq	%r14, %rsi
	addq	$28, %rsi
	leaq	-48(%rbp), %rdx
	movq	%r13, %rdi
	callq	_power_supply_register
	movl	%eax, 24(%r14)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_13
## %bb.10:
	movl	24(%r14), %edi
	callq	_PTR_ERR
	movl	%eax, %ebx
	movl	16(%r14), %edi
	movq	_DA9030_EVENT_VBATMON@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_DA9030_EVENT_CHDET@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_DA9030_EVENT_CHIOVER@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_DA9030_EVENT_TBAT@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r12, %rsi
	callq	_da903x_unregister_notifier
LBB0_11:
	movq	%r15, %rdi
	callq	_cancel_delayed_work
	jmp	LBB0_12
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_13:
	movq	%r14, %rdi
	callq	_da9030_bat_create_debugfs
	movl	%eax, 20(%r14)
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_platform_set_drvdata
	xorl	%ebx, %ebx
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_da9030_charging_monitor,4,2    ## @da9030_charging_monitor
	.comm	_da9030_battery_event,4,2       ## @da9030_battery_event
	.comm	_DA9030_EVENT_CHDET,4,2         ## @DA9030_EVENT_CHDET
	.comm	_DA9030_EVENT_VBATMON,4,2       ## @DA9030_EVENT_VBATMON
	.comm	_DA9030_EVENT_CHIOVER,4,2       ## @DA9030_EVENT_CHIOVER
	.comm	_DA9030_EVENT_TBAT,4,2          ## @DA9030_EVENT_TBAT
	.no_dead_strip	_da9030_battery_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function da9030_battery_probe
_da9030_battery_probe:                  ; @da9030_battery_probe
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	str	xzr, [sp, #8]
	ldr	x21, [x0, #8]
	cbz	x21, LBB0_3
; %bb.1:
	ldr	w8, [x21]
	cmp	w8, #1499
	b.gt	LBB0_3
; %bb.2:
	ldr	w8, [x21, #4]
	mov	w9, #-4351
	add	w8, w8, w9
	cmn	w8, #352
	b.hi	LBB0_6
LBB0_3:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_5:
	mov	x0, x23
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_6:
	mov	x19, x0
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	w1, #48
	bl	_devm_kzalloc
	cbz	x0, LBB0_12
; %bb.7:
	mov	x20, x0
	ldr	w8, [x19]
	str	w8, [x0, #16]
	ldr	x8, [x21, #24]
	mov	w9, #1000
	mul	w9, w8, w9
	cmp	x8, #0
	mov	w8, #10000
	csel	w0, w8, w9, eq
	bl	_msecs_to_jiffies
	str	w0, [x20, #32]
	ldr	d0, [x21]
	str	d0, [x20]
	ldr	w8, [x21, #16]
	str	w8, [x20, #44]
	ldr	d0, [x21, #8]
	stur	d0, [x20, #36]
	mov	x0, x20
	mov	x1, x21
	bl	_da9030_battery_convert_thresholds
	mov	x0, x20
	bl	_da9030_battery_charger_init
	mov	x23, x0
	cbnz	w0, LBB0_5
; %bb.8:
	add	x21, x20, #8
Lloh5:
	adrp	x8, _da9030_charging_monitor@GOTPAGE
Lloh6:
	ldr	x8, [x8, _da9030_charging_monitor@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_INIT_DELAYED_WORK
	ldr	w1, [x20, #32]
	mov	x0, x21
	bl	_schedule_delayed_work
Lloh8:
	adrp	x8, _da9030_battery_event@GOTPAGE
Lloh9:
	ldr	x8, [x8, _da9030_battery_event@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	mov	x22, x20
	str	w8, [x22, #12]!
	ldr	w0, [x22, #4]
Lloh11:
	adrp	x24, _DA9030_EVENT_CHDET@GOTPAGE
Lloh12:
	ldr	x24, [x24, _DA9030_EVENT_CHDET@GOTPAGEOFF]
	ldr	w8, [x24]
Lloh13:
	adrp	x25, _DA9030_EVENT_VBATMON@GOTPAGE
Lloh14:
	ldr	x25, [x25, _DA9030_EVENT_VBATMON@GOTPAGEOFF]
	ldr	w9, [x25]
	orr	w8, w9, w8
Lloh15:
	adrp	x26, _DA9030_EVENT_CHIOVER@GOTPAGE
Lloh16:
	ldr	x26, [x26, _DA9030_EVENT_CHIOVER@GOTPAGEOFF]
	ldr	w9, [x26]
	orr	w8, w8, w9
Lloh17:
	adrp	x27, _DA9030_EVENT_TBAT@GOTPAGE
Lloh18:
	ldr	x27, [x27, _DA9030_EVENT_TBAT@GOTPAGEOFF]
	ldr	w9, [x27]
	orr	w2, w8, w9
	mov	x1, x22
	bl	_da903x_register_notifier
	mov	x23, x0
	cbnz	w0, LBB0_11
; %bb.9:
	mov	x0, x20
	bl	_da9030_battery_setup_psy
	str	x20, [sp, #8]
	add	x1, x20, #28
	add	x2, sp, #8
	mov	x0, x19
	bl	_power_supply_register
	str	w0, [x20, #24]
	bl	_IS_ERR
	cbz	x0, LBB0_13
; %bb.10:
	ldr	w0, [x20, #24]
	bl	_PTR_ERR
	mov	x23, x0
	ldr	w0, [x20, #16]
	ldr	w8, [x24]
	ldr	w9, [x25]
	orr	w8, w9, w8
	ldr	w9, [x26]
	orr	w8, w8, w9
	ldr	w9, [x27]
	orr	w2, w8, w9
	mov	x1, x22
	bl	_da903x_unregister_notifier
LBB0_11:
	mov	x0, x21
	bl	_cancel_delayed_work
	b	LBB0_5
LBB0_12:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_4
LBB0_13:
	mov	x0, x20
	bl	_da9030_bat_create_debugfs
	str	w0, [x20, #20]
	mov	x0, x19
	mov	x1, x20
	bl	_platform_set_drvdata
	mov	w23, #0
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_da9030_charging_monitor,4,2    ; @da9030_charging_monitor
	.comm	_da9030_battery_event,4,2       ; @da9030_battery_event
	.comm	_DA9030_EVENT_CHDET,4,2         ; @DA9030_EVENT_CHDET
	.comm	_DA9030_EVENT_VBATMON,4,2       ; @DA9030_EVENT_VBATMON
	.comm	_DA9030_EVENT_CHIOVER,4,2       ; @DA9030_EVENT_CHIOVER
	.comm	_DA9030_EVENT_TBAT,4,2          ; @DA9030_EVENT_TBAT
	.no_dead_strip	_da9030_battery_probe
.subsections_via_symbols
