	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function abx500_chargalg_algorithm
_abx500_chargalg_algorithm:             ## @abx500_chargalg_algorithm
	.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
	subq	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_power_supply_class@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	152(%rbx), %edx
	movq	_abx500_chargalg_get_ext_psy_data@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%esi, %esi
	callq	_class_for_each_device
	movq	%rbx, %rdi
	callq	_abx500_chargalg_end_of_charge
	movq	%rbx, %rdi
	callq	_abx500_chargalg_check_temp
	movq	%rbx, %rdi
	callq	_abx500_chargalg_check_charger_voltage
	movq	%rbx, %rdi
	callq	_abx500_chargalg_check_charger_connection
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_abx500_chargalg_check_current_step_status
	movl	276(%rbx), %edi
	callq	_is_ab8500
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rbx, %rdi
	callq	_abx500_chargalg_check_charger_enable
	testl	%eax, %eax
	jns	LBB0_3
## %bb.2:
	movl	272(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
LBB0_3:
	testl	%r14d, %r14d
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_6
## %bb.4:
	cmpq	$0, 144(%rbx)
	je	LBB0_8
## %bb.5:
	movq	168(%rbx), %rax
	cmpl	$0, 20(%rax)
	je	LBB0_6
LBB0_8:
	movl	(%rbx), %eax
	movl	%eax, %ecx
	andl	$-2, %ecx
	cmpl	$136, %ecx
	je	LBB0_36
## %bb.9:
	cmpl	$0, 16(%rbx)
	je	LBB0_11
## %bb.10:
	movl	$138, %esi
	cmpl	$139, %eax
	jne	LBB0_35
	jmp	LBB0_36
LBB0_6:
	cmpl	$151, (%rbx)
	je	LBB0_36
## %bb.7:
	movl	$0, 16(%rbx)
	movl	$150, %esi
LBB0_35:
	movq	%rbx, %rdi
	callq	_abx500_chargalg_state_to
LBB0_36:
	movl	272(%rbx), %edi
	movl	192(%rbx), %edx
	movl	188(%rbx), %ecx
	movl	184(%rbx), %r8d
	movl	180(%rbx), %r9d
	movl	176(%rbx), %eax
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	movq	_states@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	(%rbx), %rsi
	movl	(%rax,%rsi,4), %eax
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	movl	256(%rbx), %eax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movl	208(%rbx), %eax
	movq	_AC_CHG@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r12d
	movl	%r12d, %r10d
	andl	%eax, %r10d
	movq	_USB_CHG@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	andl	%esi, %eax
	movl	212(%rbx), %r15d
	andl	%r15d, %r12d
	andl	%esi, %r15d
	movl	132(%rbx), %esi
	movq	%rsi, -88(%rbp)                 ## 8-byte Spill
	movl	4(%rbx), %esi
	movq	%rsi, -96(%rbp)                 ## 8-byte Spill
	movl	128(%rbx), %esi
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movl	252(%rbx), %esi
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movl	248(%rbx), %esi
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movl	244(%rbx), %esi
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movl	240(%rbx), %r11d
	movl	236(%rbx), %r13d
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	232(%rsi), %r14d
	subq	$8, %rsp
	leaq	L_.str.1(%rip), %rsi
	pushq	%r14
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	pushq	%r13
	pushq	%r11
	pushq	-56(%rbp)                       ## 8-byte Folded Reload
	pushq	-64(%rbp)                       ## 8-byte Folded Reload
	pushq	-72(%rbp)                       ## 8-byte Folded Reload
	pushq	-80(%rbp)                       ## 8-byte Folded Reload
	pushq	-88(%rbp)                       ## 8-byte Folded Reload
	pushq	%r15
	pushq	%r12
	pushq	%rax
	pushq	%r10
	pushq	160(%r14)
	pushq	-104(%rbp)                      ## 8-byte Folded Reload
	pushq	-112(%rbp)                      ## 8-byte Folded Reload
	pushq	-96(%rbp)                       ## 8-byte Folded Reload
	pushq	-120(%rbp)                      ## 8-byte Folded Reload
	callq	_dev_dbg
	addq	$144, %rsp
	movl	(%r14), %eax
	leal	-128(%rax), %ecx
	cmpl	$27, %ecx
	ja	LBB0_87
## %bb.37:
	leaq	LJTI0_0(%rip), %rdx
	movslq	(%rdx,%rcx,4), %rcx
	addq	%rdx, %rcx
	jmpq	*%rcx
LBB0_79:
	movq	%r14, %rdi
	callq	_abx500_chargalg_stop_charging
	movq	%r14, %rdi
	movl	$129, %esi
	callq	_abx500_chargalg_state_to
LBB0_80:
	cmpq	$0, 40(%r14)
	jne	LBB0_86
## %bb.81:
	cmpq	$0, 32(%r14)
	jne	LBB0_86
	jmp	LBB0_84
LBB0_11:
	cmpq	$0, 120(%rbx)
	je	LBB0_13
## %bb.12:
	movl	$154, %esi
	cmpl	$155, %eax
	jne	LBB0_35
	jmp	LBB0_36
LBB0_69:
	movq	%r14, %rdi
	callq	_abx500_chargalg_hold_charging
	movq	%r14, %rdi
	movl	$131, %esi
	callq	_abx500_chargalg_state_to
LBB0_70:
	movl	176(%r14), %eax
	movq	168(%r14), %rcx
	movq	8(%rcx), %rdx
	imulq	$44, (%rcx), %rcx
	cmpl	36(%rdx,%rcx), %eax
	jle	LBB0_84
	jmp	LBB0_86
LBB0_82:
	movq	%r14, %rdi
	callq	_abx500_chargalg_stop_charging
	movq	%r14, %rdi
	movl	$133, %esi
	callq	_abx500_chargalg_state_to
LBB0_83:
	cmpq	$0, 24(%r14)
	jne	LBB0_86
	jmp	LBB0_84
LBB0_77:
	movq	168(%r14), %rax
	movq	8(%rax), %rcx
	imulq	$44, (%rax), %rax
	movl	12(%rcx,%rax), %edx
	movl	16(%rcx,%rax), %esi
	movq	%r14, %rdi
	callq	_abx500_chargalg_start_charging
	movq	%r14, %rdi
	callq	_abx500_chargalg_stop_maintenance_timer
	movq	_POWER_SUPPLY_STATUS_CHARGING@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 160(%r14)
	movq	%r14, %rdi
	movl	$135, %esi
	callq	_abx500_chargalg_state_to
	movl	152(%r14), %edi
	callq	_power_supply_changed
LBB0_78:
	cmpq	$0, 48(%r14)
	jne	LBB0_86
	jmp	LBB0_84
LBB0_39:
	cmpl	$0, 268(%r14)
	je	LBB0_41
## %bb.40:
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_abx500_chargalg_ac_en
LBB0_41:
	cmpl	$0, 264(%r14)
	je	LBB0_43
## %bb.42:
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_abx500_chargalg_usb_en
LBB0_43:
	movq	%r14, %rdi
	callq	_abx500_chargalg_stop_safety_timer
	movq	%r14, %rdi
	callq	_abx500_chargalg_stop_maintenance_timer
	movq	_POWER_SUPPLY_STATUS_NOT_CHARGING@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 160(%r14)
	movl	$0, 4(%r14)
	movq	%r14, %rdi
	movl	$137, %esi
	callq	_abx500_chargalg_state_to
	jmp	LBB0_44
LBB0_59:
	movq	%r14, %rdi
	callq	_abx500_chargalg_stop_charging
	movq	%r14, %rdi
	movl	$139, %esi
	jmp	LBB0_85
LBB0_50:
	movq	%r14, %rdi
	callq	_abx500_chargalg_stop_charging
	movq	%r14, %rdi
	movl	$141, %esi
	callq	_abx500_chargalg_state_to
LBB0_51:
	cmpq	$0, 96(%r14)
	jne	LBB0_86
## %bb.52:
	cmpq	$0, 88(%r14)
	jne	LBB0_86
## %bb.53:
	cmpq	$0, 80(%r14)
	jne	LBB0_86
## %bb.54:
	cmpq	$0, 224(%r14)
	je	LBB0_86
## %bb.55:
	cmpq	$0, 216(%r14)
	jne	LBB0_84
	jmp	LBB0_86
LBB0_60:
	movl	200(%r14), %eax
	movq	_CHARGALG_CURR_STEP_LOW@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_62
## %bb.61:
	movq	%r14, %rdi
	callq	_abx500_chargalg_stop_charging
	jmp	LBB0_63
LBB0_64:
	movq	%r14, %rdi
	callq	_handle_maxim_chg_curr
	movq	160(%r14), %rax
	movq	_POWER_SUPPLY_STATUS_FULL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_86
## %bb.65:
	cmpl	$0, 4(%r14)
	je	LBB0_86
## %bb.66:
	movq	168(%r14), %rax
	cmpl	$0, 16(%rax)
	je	LBB0_68
## %bb.67:
	movq	%r14, %rdi
	movl	$130, %esi
	jmp	LBB0_85
LBB0_74:
	movq	168(%r14), %rax
	movq	8(%rax), %rcx
	imulq	$44, (%rax), %rax
	movl	24(%rcx,%rax), %esi
	movq	%r14, %rdi
	callq	_abx500_chargalg_start_maintenance_timer
	movq	168(%r14), %rax
	movq	8(%rax), %rcx
	imulq	$44, (%rax), %rax
	movl	8(%rcx,%rax), %edx
	movl	20(%rcx,%rax), %esi
	movq	%r14, %rdi
	callq	_abx500_chargalg_start_charging
	movq	%r14, %rdi
	movl	$145, %esi
	callq	_abx500_chargalg_state_to
	movl	152(%r14), %edi
	callq	_power_supply_changed
LBB0_75:
	cmpl	$0, 56(%r14)
	je	LBB0_86
## %bb.76:
	movq	%r14, %rdi
	callq	_abx500_chargalg_stop_maintenance_timer
	jmp	LBB0_84
LBB0_71:
	movq	%r14, %rdi
	callq	_abx500_chargalg_stop_safety_timer
	movq	168(%r14), %rax
	movq	8(%rax), %rcx
	imulq	$44, (%rax), %rax
	movl	32(%rcx,%rax), %esi
	movq	%r14, %rdi
	callq	_abx500_chargalg_start_maintenance_timer
	movq	168(%r14), %rax
	movq	8(%rax), %rcx
	imulq	$44, (%rax), %rax
	movl	4(%rcx,%rax), %edx
	movl	28(%rcx,%rax), %esi
	movq	%r14, %rdi
	callq	_abx500_chargalg_start_charging
	movq	%r14, %rdi
	movl	$147, %esi
	callq	_abx500_chargalg_state_to
	movl	152(%r14), %edi
	callq	_power_supply_changed
LBB0_72:
	cmpl	$0, 56(%r14)
	je	LBB0_86
## %bb.73:
	movq	%r14, %rdi
	callq	_abx500_chargalg_stop_maintenance_timer
	movq	%r14, %rdi
	movl	$144, %esi
	jmp	LBB0_85
LBB0_47:
	movq	%r14, %rdi
	callq	_abx500_chargalg_stop_charging
	movq	%r14, %rdi
	movl	$149, %esi
	callq	_abx500_chargalg_state_to
LBB0_48:
	cmpq	$0, 112(%r14)
	jne	LBB0_86
## %bb.49:
	cmpq	$0, 104(%r14)
	jne	LBB0_86
	jmp	LBB0_84
LBB0_38:
	movq	%r14, %rdi
	callq	_abx500_chargalg_stop_charging
	movq	_POWER_SUPPLY_STATUS_DISCHARGING@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 160(%r14)
	movq	%r14, %rdi
	movl	$151, %esi
	jmp	LBB0_85
LBB0_56:
	movq	%r14, %rdi
	callq	_abx500_chargalg_stop_charging
	movq	%r14, %rdi
	movl	$153, %esi
	callq	_abx500_chargalg_state_to
LBB0_57:
	cmpq	$0, 72(%r14)
	jne	LBB0_86
## %bb.58:
	cmpq	$0, 64(%r14)
	jne	LBB0_86
	jmp	LBB0_84
LBB0_45:
	movq	%r14, %rdi
	callq	_abx500_chargalg_stop_charging
	movq	%r14, %rdi
	movl	$155, %esi
	callq	_abx500_chargalg_state_to
LBB0_46:
	cmpq	$0, 120(%r14)
	jne	LBB0_86
LBB0_84:
	movq	%r14, %rdi
	movl	$142, %esi
LBB0_85:
	callq	_abx500_chargalg_state_to
LBB0_86:
	movl	(%r14), %eax
LBB0_87:
	addl	$-142, %eax
	cmpl	$4, %eax
	ja	LBB0_89
## %bb.88:
	movl	$21, %ecx
	btl	%eax, %ecx
	jae	LBB0_89
## %bb.90:
	movl	12(%r14), %edi
	addq	$8, %r14
	movq	%r14, %rsi
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_queue_work                     ## TAILCALL
LBB0_89:
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	cmpq	$0, 72(%rbx)
	jne	LBB0_15
## %bb.14:
	cmpq	$0, 64(%rbx)
	je	LBB0_18
LBB0_15:
	cmpl	$153, %eax
	je	LBB0_36
## %bb.16:
	cmpl	$0, 136(%rbx)
	jne	LBB0_36
## %bb.17:
	movl	$152, %esi
	jmp	LBB0_35
LBB0_62:
	movq	168(%r14), %rcx
	imulq	$44, (%rcx), %rsi
	movq	8(%rcx), %rcx
	imull	(%rcx,%rsi), %eax
	movq	_CHARGALG_CURR_STEP_HIGH@GOTPCREL(%rip), %rdi
	cltd
	idivl	(%rdi)
	movl	40(%rcx,%rsi), %esi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_abx500_chargalg_start_charging
LBB0_63:
	movq	%r14, %rdi
	movl	$143, %esi
	callq	_abx500_chargalg_state_to
	movq	%r14, %rdi
	callq	_abx500_chargalg_start_safety_timer
	movq	%r14, %rdi
	callq	_abx500_chargalg_stop_maintenance_timer
	movq	%r14, %rdi
	callq	_init_maxim_chg_curr
	movq	_POWER_SUPPLY_STATUS_CHARGING@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 160(%r14)
	movl	$0, 196(%r14)
	movl	$0, 4(%r14)
LBB0_44:
	movl	152(%r14), %edi
	callq	_power_supply_changed
	jmp	LBB0_86
LBB0_18:
	cmpq	$0, 96(%rbx)
	jne	LBB0_23
## %bb.19:
	cmpq	$0, 88(%rbx)
	jne	LBB0_23
## %bb.20:
	cmpq	$0, 80(%rbx)
	je	LBB0_21
LBB0_23:
	movl	$140, %esi
	cmpl	$141, %eax
	jne	LBB0_35
	jmp	LBB0_36
LBB0_68:
	movq	%r14, %rdi
	movl	$146, %esi
	jmp	LBB0_85
LBB0_21:
	cmpq	$0, 224(%rbx)
	je	LBB0_23
## %bb.22:
	cmpq	$0, 216(%rbx)
	je	LBB0_23
## %bb.24:
	cmpq	$0, 112(%rbx)
	jne	LBB0_26
## %bb.25:
	cmpq	$0, 104(%rbx)
	je	LBB0_27
LBB0_26:
	movl	$148, %esi
	cmpl	$149, %eax
	jne	LBB0_35
	jmp	LBB0_36
LBB0_27:
	cmpq	$0, 24(%rbx)
	je	LBB0_30
## %bb.28:
	movl	$132, %esi
	cmpl	$133, %eax
	jmp	LBB0_29
LBB0_30:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpq	$0, 40(%rcx)
	jne	LBB0_32
## %bb.31:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpq	$0, 32(%rcx)
	je	LBB0_33
LBB0_32:
	movl	$128, %esi
	cmpl	$129, %eax
LBB0_29:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_35
	jmp	LBB0_36
LBB0_33:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	cmpq	$0, 48(%rbx)
	je	LBB0_36
## %bb.34:
	movl	$134, %esi
	cmpl	$135, %eax
	jne	LBB0_35
	jmp	LBB0_36
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_79, LBB0_79-LJTI0_0
.set L0_0_set_80, LBB0_80-LJTI0_0
.set L0_0_set_69, LBB0_69-LJTI0_0
.set L0_0_set_70, LBB0_70-LJTI0_0
.set L0_0_set_82, LBB0_82-LJTI0_0
.set L0_0_set_83, LBB0_83-LJTI0_0
.set L0_0_set_77, LBB0_77-LJTI0_0
.set L0_0_set_78, LBB0_78-LJTI0_0
.set L0_0_set_39, LBB0_39-LJTI0_0
.set L0_0_set_87, LBB0_87-LJTI0_0
.set L0_0_set_59, LBB0_59-LJTI0_0
.set L0_0_set_50, LBB0_50-LJTI0_0
.set L0_0_set_51, LBB0_51-LJTI0_0
.set L0_0_set_60, LBB0_60-LJTI0_0
.set L0_0_set_64, LBB0_64-LJTI0_0
.set L0_0_set_74, LBB0_74-LJTI0_0
.set L0_0_set_75, LBB0_75-LJTI0_0
.set L0_0_set_71, LBB0_71-LJTI0_0
.set L0_0_set_72, LBB0_72-LJTI0_0
.set L0_0_set_47, LBB0_47-LJTI0_0
.set L0_0_set_48, LBB0_48-LJTI0_0
.set L0_0_set_38, LBB0_38-LJTI0_0
.set L0_0_set_56, LBB0_56-LJTI0_0
.set L0_0_set_57, LBB0_57-LJTI0_0
.set L0_0_set_45, LBB0_45-LJTI0_0
.set L0_0_set_46, LBB0_46-LJTI0_0
LJTI0_0:
	.long	L0_0_set_79
	.long	L0_0_set_80
	.long	L0_0_set_69
	.long	L0_0_set_70
	.long	L0_0_set_82
	.long	L0_0_set_83
	.long	L0_0_set_77
	.long	L0_0_set_78
	.long	L0_0_set_39
	.long	L0_0_set_87
	.long	L0_0_set_59
	.long	L0_0_set_87
	.long	L0_0_set_50
	.long	L0_0_set_51
	.long	L0_0_set_60
	.long	L0_0_set_64
	.long	L0_0_set_74
	.long	L0_0_set_75
	.long	L0_0_set_71
	.long	L0_0_set_72
	.long	L0_0_set_47
	.long	L0_0_set_48
	.long	L0_0_set_38
	.long	L0_0_set_87
	.long	L0_0_set_56
	.long	L0_0_set_57
	.long	L0_0_set_45
	.long	L0_0_set_46
	.end_data_region
                                        ## -- End function
	.comm	_power_supply_class,4,2         ## @power_supply_class
	.comm	_abx500_chargalg_get_ext_psy_data,4,2 ## @abx500_chargalg_get_ext_psy_data
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Checking charger is enabled error: Returned Value %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"[CHARGALG] Vb %d Ib_avg %d Ib_inst %d Tb %d Cap %d Maint %d State %s Active_chg %d Chg_status %d AC %d USB %d AC_online %d USB_online %d AC_CV %d USB_CV %d AC_I %d USB_I %d AC_Vset %d AC_Iset %d USB_Vset %d USB_Iset %d\n"

	.comm	_states,8,3                     ## @states
	.comm	_AC_CHG,4,2                     ## @AC_CHG
	.comm	_USB_CHG,4,2                    ## @USB_CHG
	.comm	_POWER_SUPPLY_STATUS_DISCHARGING,8,3 ## @POWER_SUPPLY_STATUS_DISCHARGING
	.comm	_POWER_SUPPLY_STATUS_NOT_CHARGING,8,3 ## @POWER_SUPPLY_STATUS_NOT_CHARGING
	.comm	_CHARGALG_CURR_STEP_LOW,4,2     ## @CHARGALG_CURR_STEP_LOW
	.comm	_CHARGALG_CURR_STEP_HIGH,4,2    ## @CHARGALG_CURR_STEP_HIGH
	.comm	_POWER_SUPPLY_STATUS_CHARGING,8,3 ## @POWER_SUPPLY_STATUS_CHARGING
	.comm	_POWER_SUPPLY_STATUS_FULL,8,3   ## @POWER_SUPPLY_STATUS_FULL
	.no_dead_strip	_abx500_chargalg_algorithm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function abx500_chargalg_algorithm
_abx500_chargalg_algorithm:             ; @abx500_chargalg_algorithm
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _power_supply_class@GOTPAGE
Lloh1:
	ldr	x8, [x8, _power_supply_class@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldr	w2, [x19, #152]
Lloh3:
	adrp	x8, _abx500_chargalg_get_ext_psy_data@GOTPAGE
Lloh4:
	ldr	x8, [x8, _abx500_chargalg_get_ext_psy_data@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	mov	x1, #0
	bl	_class_for_each_device
	mov	x0, x19
	bl	_abx500_chargalg_end_of_charge
	mov	x0, x19
	bl	_abx500_chargalg_check_temp
	mov	x0, x19
	bl	_abx500_chargalg_check_charger_voltage
	mov	x0, x19
	bl	_abx500_chargalg_check_charger_connection
	mov	x20, x0
	mov	x0, x19
	bl	_abx500_chargalg_check_current_step_status
	ldr	w0, [x19, #276]
	bl	_is_ab8500
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_abx500_chargalg_check_charger_enable
	tbnz	w0, #31, LBB0_9
LBB0_2:
	cbz	w20, LBB0_10
LBB0_3:
	ldr	x8, [x19, #144]
	cbz	x8, LBB0_5
; %bb.4:
	ldr	x8, [x19, #168]
	ldr	w8, [x8, #20]
	cbz	w8, LBB0_10
LBB0_5:
	ldr	w8, [x19]
	and	w9, w8, #0xfffffffe
	cmp	w9, #136
	b.eq	LBB0_13
; %bb.6:
	ldr	w9, [x19, #16]
	cbz	w9, LBB0_18
; %bb.7:
	cmp	w8, #139
	b.eq	LBB0_13
; %bb.8:
	mov	w1, #138
	b	LBB0_12
LBB0_9:
	mov	x2, x0
	ldr	w0, [x19, #272]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	cbnz	w20, LBB0_3
LBB0_10:
	ldr	w8, [x19]
	cmp	w8, #151
	b.eq	LBB0_13
; %bb.11:
	str	wzr, [x19, #16]
	mov	w1, #150
LBB0_12:
	mov	x0, x19
	bl	_abx500_chargalg_state_to
LBB0_13:
	ldr	w0, [x19, #272]
	ldp	w3, w2, [x19, #188]
	ldp	w5, w4, [x19, #180]
	ldr	w6, [x19, #176]
Lloh8:
	adrp	x8, _states@GOTPAGE
Lloh9:
	ldr	x8, [x8, _states@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	ldp	w9, w7, [x19]
                                        ; kill: def $w9 killed $w9 def $x9
	sxtw	x9, w9
	ldr	w8, [x8, x9, lsl #2]
	ldp	w17, w9, [x19, #252]
	ldr	x10, [x19, #160]
Lloh11:
	adrp	x11, _AC_CHG@GOTPAGE
Lloh12:
	ldr	x11, [x11, _AC_CHG@GOTPAGEOFF]
Lloh13:
	ldr	w11, [x11]
	ldp	w12, w13, [x19, #208]
	and	w14, w11, w12
Lloh14:
	adrp	x15, _USB_CHG@GOTPAGE
Lloh15:
	ldr	x15, [x15, _USB_CHG@GOTPAGEOFF]
Lloh16:
	ldr	w15, [x15]
	and	w12, w15, w12
	and	w11, w13, w11
	and	w13, w13, w15
	ldp	w16, w15, [x19, #128]
	ldp	w20, w1, [x19, #244]
	ldp	w22, w21, [x19, #236]
	ldr	w23, [x19, #232]
	stp	w22, w23, [sp, #56]
	stp	w20, w21, [sp, #48]
	stp	w17, w1, [sp, #40]
	stp	w15, w16, [sp, #32]
	stp	w11, w13, [sp, #24]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	stp	w14, w12, [sp, #16]
	str	x10, [sp, #8]
	stp	w8, w9, [sp]
	bl	_dev_dbg
	ldr	w8, [x19]
	sub	w9, w8, #128
	cmp	w9, #27
	b.hi	LBB0_63
; %bb.14:
Lloh19:
	adrp	x10, lJTI0_0@PAGE
Lloh20:
	add	x10, x10, lJTI0_0@PAGEOFF
	adr	x11, LBB0_15
	ldrb	w12, [x10, x9]
	add	x11, x11, x12, lsl #2
	br	x11
LBB0_15:
	mov	x0, x19
	bl	_abx500_chargalg_stop_charging
	mov	x0, x19
	mov	w1, #129
	bl	_abx500_chargalg_state_to
LBB0_16:
	ldr	x8, [x19, #40]
	cbnz	x8, LBB0_62
; %bb.17:
	ldr	x8, [x19, #32]
	cbnz	x8, LBB0_62
	b	LBB0_60
LBB0_18:
	ldr	x9, [x19, #120]
	cbz	x9, LBB0_67
; %bb.19:
	cmp	w8, #155
	b.eq	LBB0_13
; %bb.20:
	mov	w1, #154
	b	LBB0_12
LBB0_21:
	mov	x0, x19
	bl	_abx500_chargalg_hold_charging
	mov	x0, x19
	mov	w1, #131
	bl	_abx500_chargalg_state_to
LBB0_22:
	ldr	w8, [x19, #176]
	ldr	x9, [x19, #168]
	ldp	x9, x10, [x9]
	mov	w11, #44
	madd	x9, x9, x11, x10
	ldr	w9, [x9, #36]
	cmp	w8, w9
	b.le	LBB0_60
	b	LBB0_62
LBB0_23:
	mov	x0, x19
	bl	_abx500_chargalg_stop_charging
	mov	x0, x19
	mov	w1, #133
	bl	_abx500_chargalg_state_to
LBB0_24:
	ldr	x8, [x19, #24]
	cbnz	x8, LBB0_62
	b	LBB0_60
LBB0_25:
	ldr	x8, [x19, #168]
	ldp	x8, x9, [x8]
	mov	w10, #44
	madd	x8, x8, x10, x9
	ldp	w2, w1, [x8, #12]
	mov	x0, x19
	bl	_abx500_chargalg_start_charging
	mov	x0, x19
	bl	_abx500_chargalg_stop_maintenance_timer
Lloh21:
	adrp	x8, _POWER_SUPPLY_STATUS_CHARGING@GOTPAGE
Lloh22:
	ldr	x8, [x8, _POWER_SUPPLY_STATUS_CHARGING@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	str	x8, [x19, #160]
	mov	x0, x19
	mov	w1, #135
	bl	_abx500_chargalg_state_to
	ldr	w0, [x19, #152]
	bl	_power_supply_changed
LBB0_26:
	ldr	x8, [x19, #48]
	cbnz	x8, LBB0_62
	b	LBB0_60
LBB0_27:
	ldr	w8, [x19, #268]
	cbz	w8, LBB0_29
; %bb.28:
	mov	x0, x19
	mov	w1, #0
	mov	w2, #0
	mov	w3, #0
	bl	_abx500_chargalg_ac_en
LBB0_29:
	ldr	w8, [x19, #264]
	cbz	w8, LBB0_31
; %bb.30:
	mov	x0, x19
	mov	w1, #0
	mov	w2, #0
	mov	w3, #0
	bl	_abx500_chargalg_usb_en
LBB0_31:
	mov	x0, x19
	bl	_abx500_chargalg_stop_safety_timer
	mov	x0, x19
	bl	_abx500_chargalg_stop_maintenance_timer
Lloh24:
	adrp	x8, _POWER_SUPPLY_STATUS_NOT_CHARGING@GOTPAGE
Lloh25:
	ldr	x8, [x8, _POWER_SUPPLY_STATUS_NOT_CHARGING@GOTPAGEOFF]
Lloh26:
	ldr	x8, [x8]
	str	x8, [x19, #160]
	str	wzr, [x19, #4]
	mov	x0, x19
	mov	w1, #137
	bl	_abx500_chargalg_state_to
	b	LBB0_74
LBB0_32:
	mov	x0, x19
	bl	_abx500_chargalg_stop_charging
	mov	x0, x19
	mov	w1, #139
	b	LBB0_61
LBB0_33:
	mov	x0, x19
	bl	_abx500_chargalg_stop_charging
	mov	x0, x19
	mov	w1, #141
	bl	_abx500_chargalg_state_to
LBB0_34:
	ldr	x8, [x19, #96]
	cbnz	x8, LBB0_62
; %bb.35:
	ldr	x8, [x19, #88]
	cbnz	x8, LBB0_62
; %bb.36:
	ldr	x8, [x19, #80]
	cbnz	x8, LBB0_62
; %bb.37:
	ldr	x8, [x19, #224]
	cbz	x8, LBB0_62
; %bb.38:
	ldr	x8, [x19, #216]
	cbnz	x8, LBB0_60
	b	LBB0_62
LBB0_39:
	ldr	w8, [x19, #200]
Lloh27:
	adrp	x9, _CHARGALG_CURR_STEP_LOW@GOTPAGE
Lloh28:
	ldr	x9, [x9, _CHARGALG_CURR_STEP_LOW@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_72
; %bb.40:
	mov	x0, x19
	bl	_abx500_chargalg_stop_charging
	b	LBB0_73
LBB0_41:
	mov	x0, x19
	bl	_handle_maxim_chg_curr
	ldr	x8, [x19, #160]
Lloh30:
	adrp	x9, _POWER_SUPPLY_STATUS_FULL@GOTPAGE
Lloh31:
	ldr	x9, [x9, _POWER_SUPPLY_STATUS_FULL@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_62
; %bb.42:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_62
; %bb.43:
	ldr	x8, [x19, #168]
	ldr	w8, [x8, #16]
	cbz	w8, LBB0_80
; %bb.44:
	mov	x0, x19
	mov	w1, #130
	b	LBB0_61
LBB0_45:
	ldr	x8, [x19, #168]
	ldp	x8, x9, [x8]
	mov	w20, #44
	madd	x8, x8, x20, x9
	ldr	w1, [x8, #24]
	mov	x0, x19
	bl	_abx500_chargalg_start_maintenance_timer
	ldr	x8, [x19, #168]
	ldp	x8, x9, [x8]
	madd	x8, x8, x20, x9
	ldr	w1, [x8, #20]
	ldr	w2, [x8, #8]
	mov	x0, x19
	bl	_abx500_chargalg_start_charging
	mov	x0, x19
	mov	w1, #145
	bl	_abx500_chargalg_state_to
	ldr	w0, [x19, #152]
	bl	_power_supply_changed
LBB0_46:
	ldr	w8, [x19, #56]
	cbz	w8, LBB0_62
; %bb.47:
	mov	x0, x19
	bl	_abx500_chargalg_stop_maintenance_timer
	b	LBB0_60
LBB0_48:
	mov	x0, x19
	bl	_abx500_chargalg_stop_safety_timer
	ldr	x8, [x19, #168]
	ldp	x8, x9, [x8]
	mov	w20, #44
	madd	x8, x8, x20, x9
	ldr	w1, [x8, #32]
	mov	x0, x19
	bl	_abx500_chargalg_start_maintenance_timer
	ldr	x8, [x19, #168]
	ldp	x8, x9, [x8]
	madd	x8, x8, x20, x9
	ldr	w1, [x8, #28]
	ldr	w2, [x8, #4]
	mov	x0, x19
	bl	_abx500_chargalg_start_charging
	mov	x0, x19
	mov	w1, #147
	bl	_abx500_chargalg_state_to
	ldr	w0, [x19, #152]
	bl	_power_supply_changed
LBB0_49:
	ldr	w8, [x19, #56]
	cbz	w8, LBB0_62
; %bb.50:
	mov	x0, x19
	bl	_abx500_chargalg_stop_maintenance_timer
	mov	x0, x19
	mov	w1, #144
	b	LBB0_61
LBB0_51:
	mov	x0, x19
	bl	_abx500_chargalg_stop_charging
	mov	x0, x19
	mov	w1, #149
	bl	_abx500_chargalg_state_to
LBB0_52:
	ldr	x8, [x19, #112]
	cbnz	x8, LBB0_62
; %bb.53:
	ldr	x8, [x19, #104]
	cbnz	x8, LBB0_62
	b	LBB0_60
LBB0_54:
	mov	x0, x19
	bl	_abx500_chargalg_stop_charging
Lloh33:
	adrp	x8, _POWER_SUPPLY_STATUS_DISCHARGING@GOTPAGE
Lloh34:
	ldr	x8, [x8, _POWER_SUPPLY_STATUS_DISCHARGING@GOTPAGEOFF]
Lloh35:
	ldr	x8, [x8]
	str	x8, [x19, #160]
	mov	x0, x19
	mov	w1, #151
	b	LBB0_61
LBB0_55:
	mov	x0, x19
	bl	_abx500_chargalg_stop_charging
	mov	x0, x19
	mov	w1, #153
	bl	_abx500_chargalg_state_to
LBB0_56:
	ldr	x8, [x19, #72]
	cbnz	x8, LBB0_62
; %bb.57:
	ldr	x8, [x19, #64]
	cbnz	x8, LBB0_62
	b	LBB0_60
LBB0_58:
	mov	x0, x19
	bl	_abx500_chargalg_stop_charging
	mov	x0, x19
	mov	w1, #155
	bl	_abx500_chargalg_state_to
LBB0_59:
	ldr	x8, [x19, #120]
	cbnz	x8, LBB0_62
LBB0_60:
	mov	x0, x19
	mov	w1, #142
LBB0_61:
	bl	_abx500_chargalg_state_to
LBB0_62:
	ldr	w8, [x19]
LBB0_63:
	sub	w8, w8, #142
	cmp	w8, #4
	b.hi	LBB0_66
; %bb.64:
	mov	w9, #1
	lsl	w8, w9, w8
	mov	w9, #21
	tst	w8, w9
	b.eq	LBB0_66
; %bb.65:
	ldr	w0, [x19, #12]
	add	x1, x19, #8
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_queue_work
LBB0_66:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_67:
	ldr	x9, [x19, #72]
	cbnz	x9, LBB0_69
; %bb.68:
	ldr	x9, [x19, #64]
	cbz	x9, LBB0_75
LBB0_69:
	cmp	w8, #153
	b.eq	LBB0_13
; %bb.70:
	ldr	w8, [x19, #136]
	cbnz	w8, LBB0_13
; %bb.71:
	mov	w1, #152
	b	LBB0_12
LBB0_72:
	ldr	x9, [x19, #168]
	ldp	x9, x10, [x9]
	mov	w11, #44
	madd	x9, x9, x11, x10
	ldr	w10, [x9]
	mul	w8, w10, w8
Lloh36:
	adrp	x10, _CHARGALG_CURR_STEP_HIGH@GOTPAGE
Lloh37:
	ldr	x10, [x10, _CHARGALG_CURR_STEP_HIGH@GOTPAGEOFF]
Lloh38:
	ldr	w10, [x10]
	sdiv	w2, w8, w10
	ldr	w1, [x9, #40]
	mov	x0, x19
	bl	_abx500_chargalg_start_charging
LBB0_73:
	mov	x0, x19
	mov	w1, #143
	bl	_abx500_chargalg_state_to
	mov	x0, x19
	bl	_abx500_chargalg_start_safety_timer
	mov	x0, x19
	bl	_abx500_chargalg_stop_maintenance_timer
	mov	x0, x19
	bl	_init_maxim_chg_curr
Lloh39:
	adrp	x8, _POWER_SUPPLY_STATUS_CHARGING@GOTPAGE
Lloh40:
	ldr	x8, [x8, _POWER_SUPPLY_STATUS_CHARGING@GOTPAGEOFF]
Lloh41:
	ldr	x8, [x8]
	str	x8, [x19, #160]
	str	wzr, [x19, #196]
	str	wzr, [x19, #4]
LBB0_74:
	ldr	w0, [x19, #152]
	bl	_power_supply_changed
	b	LBB0_62
LBB0_75:
	ldr	x9, [x19, #96]
	cbnz	x9, LBB0_78
; %bb.76:
	ldr	x9, [x19, #88]
	cbnz	x9, LBB0_78
; %bb.77:
	ldr	x9, [x19, #80]
	cbz	x9, LBB0_81
LBB0_78:
	cmp	w8, #141
	b.eq	LBB0_13
; %bb.79:
	mov	w1, #140
	b	LBB0_12
LBB0_80:
	mov	x0, x19
	mov	w1, #146
	b	LBB0_61
LBB0_81:
	ldr	x9, [x19, #224]
	cbz	x9, LBB0_78
; %bb.82:
	ldr	x9, [x19, #216]
	cbz	x9, LBB0_78
; %bb.83:
	ldr	x9, [x19, #112]
	cbnz	x9, LBB0_85
; %bb.84:
	ldr	x9, [x19, #104]
	cbz	x9, LBB0_87
LBB0_85:
	cmp	w8, #149
	b.eq	LBB0_13
; %bb.86:
	mov	w1, #148
	b	LBB0_12
LBB0_87:
	ldr	x9, [x19, #24]
	cbz	x9, LBB0_90
; %bb.88:
	cmp	w8, #133
	b.eq	LBB0_13
; %bb.89:
	mov	w1, #132
	b	LBB0_12
LBB0_90:
	ldr	x9, [x19, #40]
	cbnz	x9, LBB0_92
; %bb.91:
	ldr	x9, [x19, #32]
	cbz	x9, LBB0_94
LBB0_92:
	cmp	w8, #129
	b.eq	LBB0_13
; %bb.93:
	mov	w1, #128
	b	LBB0_12
LBB0_94:
	ldr	x9, [x19, #48]
	cbz	x9, LBB0_13
; %bb.95:
	cmp	w8, #135
	b.eq	LBB0_13
; %bb.96:
	mov	w1, #134
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_15-LBB0_15)>>2
	.byte	(LBB0_16-LBB0_15)>>2
	.byte	(LBB0_21-LBB0_15)>>2
	.byte	(LBB0_22-LBB0_15)>>2
	.byte	(LBB0_23-LBB0_15)>>2
	.byte	(LBB0_24-LBB0_15)>>2
	.byte	(LBB0_25-LBB0_15)>>2
	.byte	(LBB0_26-LBB0_15)>>2
	.byte	(LBB0_27-LBB0_15)>>2
	.byte	(LBB0_63-LBB0_15)>>2
	.byte	(LBB0_32-LBB0_15)>>2
	.byte	(LBB0_63-LBB0_15)>>2
	.byte	(LBB0_33-LBB0_15)>>2
	.byte	(LBB0_34-LBB0_15)>>2
	.byte	(LBB0_39-LBB0_15)>>2
	.byte	(LBB0_41-LBB0_15)>>2
	.byte	(LBB0_45-LBB0_15)>>2
	.byte	(LBB0_46-LBB0_15)>>2
	.byte	(LBB0_48-LBB0_15)>>2
	.byte	(LBB0_49-LBB0_15)>>2
	.byte	(LBB0_51-LBB0_15)>>2
	.byte	(LBB0_52-LBB0_15)>>2
	.byte	(LBB0_54-LBB0_15)>>2
	.byte	(LBB0_63-LBB0_15)>>2
	.byte	(LBB0_55-LBB0_15)>>2
	.byte	(LBB0_56-LBB0_15)>>2
	.byte	(LBB0_58-LBB0_15)>>2
	.byte	(LBB0_59-LBB0_15)>>2
                                        ; -- End function
	.comm	_power_supply_class,4,2         ; @power_supply_class
	.comm	_abx500_chargalg_get_ext_psy_data,4,2 ; @abx500_chargalg_get_ext_psy_data
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Checking charger is enabled error: Returned Value %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"[CHARGALG] Vb %d Ib_avg %d Ib_inst %d Tb %d Cap %d Maint %d State %s Active_chg %d Chg_status %d AC %d USB %d AC_online %d USB_online %d AC_CV %d USB_CV %d AC_I %d USB_I %d AC_Vset %d AC_Iset %d USB_Vset %d USB_Iset %d\n"

	.comm	_states,8,3                     ; @states
	.comm	_AC_CHG,4,2                     ; @AC_CHG
	.comm	_USB_CHG,4,2                    ; @USB_CHG
	.comm	_POWER_SUPPLY_STATUS_DISCHARGING,8,3 ; @POWER_SUPPLY_STATUS_DISCHARGING
	.comm	_POWER_SUPPLY_STATUS_NOT_CHARGING,8,3 ; @POWER_SUPPLY_STATUS_NOT_CHARGING
	.comm	_CHARGALG_CURR_STEP_LOW,4,2     ; @CHARGALG_CURR_STEP_LOW
	.comm	_CHARGALG_CURR_STEP_HIGH,4,2    ; @CHARGALG_CURR_STEP_HIGH
	.comm	_POWER_SUPPLY_STATUS_CHARGING,8,3 ; @POWER_SUPPLY_STATUS_CHARGING
	.comm	_POWER_SUPPLY_STATUS_FULL,8,3   ; @POWER_SUPPLY_STATUS_FULL
	.no_dead_strip	_abx500_chargalg_algorithm
.subsections_via_symbols
