	.file	"extr_sharpsl_pm.c_sharpsl_battery_thread.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Warning: Cannot read main battery!\n"
	.align 8
.LC1:
	.string	"Battery: voltage: %d, status: %d, percentage: %d, time: %ld\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"Fatal Off\n"
	.text
	.p2align 4
	.type	sharpsl_battery_thread, @function
sharpsl_battery_thread:
.LFB0:
	.cfi_startproc
	endbr64
	mov	rax, QWORD PTR sharpsl_pm[rip+40]
	test	rax, rax
	je	.L1
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	edi, DWORD PTR SHARPSL_STATUS_ACIN[rip]
	call	[QWORD PTR [rax]]
	test	eax, eax
	mov	rax, QWORD PTR APM_AC_ONLINE[rip]
	cmove	rax, QWORD PTR APM_AC_OFFLINE[rip]
	mov	QWORD PTR sharpsl_pm[rip+16], rax
	mov	rax, QWORD PTR sharpsl_pm[rip+40]
	mov	edx, DWORD PTR 24[rax]
	test	edx, edx
	je	.L18
.L5:
	mov	ebx, 7
	.p2align 4,,10
	.p2align 3
.L8:
	mov	edi, DWORD PTR SHARPSL_BATT_VOLT[rip]
	call	[QWORD PTR [rax]]
	mov	ebp, eax
	test	eax, eax
	jg	.L7
	mov	rax, QWORD PTR sharpsl_pm[rip+40]
	sub	ebx, 1
	jne	.L8
	mov	rax, QWORD PTR 16[rax]
	mov	edi, DWORD PTR sharpsl_pm[rip+12]
	lea	rsi, .LC0[rip]
	mov	ebp, DWORD PTR [rax]
	call	dev_warn@PLT
.L7:
	mov	edi, ebp
	call	sharpsl_average_value@PLT
	mov	r12d, eax
	mov	edi, eax
	call	get_apm_status@PLT
	mov	edi, r12d
	mov	r13d, eax
	call	get_percentage@PLT
	mov	r8d, eax
	mov	rax, QWORD PTR APM_AC_ONLINE[rip]
	cmp	QWORD PTR sharpsl_pm[rip+16], rax
	je	.L9
	cmp	DWORD PTR APM_BATTERY_STATUS_HIGH[rip], r13d
	je	.L9
	mov	eax, DWORD PTR sharpsl_pm[rip+24]
	cmp	eax, r8d
	jl	.L19
.L9:
	mov	DWORD PTR sharpsl_pm[rip+28], r12d
	mov	DWORD PTR sharpsl_pm[rip+32], r13d
	mov	DWORD PTR sharpsl_pm[rip+24], r8d
.L10:
	mov	r9d, DWORD PTR jiffies[rip]
	mov	edi, DWORD PTR sharpsl_pm[rip+12]
	mov	ecx, r13d
	mov	edx, r12d
	lea	rsi, .LC1[rip]
	call	dev_dbg@PLT
	mov	rax, QWORD PTR APM_AC_ONLINE[rip]
	cmp	QWORD PTR sharpsl_pm[rip+16], rax
	je	.L11
	mov	eax, DWORD PTR APM_BATTERY_STATUS_CRITICAL[rip]
	cmp	DWORD PTR sharpsl_pm[rip+32], eax
	je	.L20
.L11:
	mov	esi, DWORD PTR SHARPSL_BATCHK_TIME[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	lea	rdi, sharpsl_bat[rip]
	pop	rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_restore 12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_restore 13
	.cfi_def_cfa_offset 8
	jmp	schedule_delayed_work@PLT
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	mov	rcx, QWORD PTR CHRG_ON[rip]
	cmp	QWORD PTR sharpsl_pm[rip], rcx
	jne	.L5
	mov	edi, DWORD PTR jiffies[rip]
	mov	rsi, QWORD PTR SHARPSL_CHARGE_ON_TIME_INTERVAL[rip]
	add	rsi, QWORD PTR sharpsl_pm[rip+48]
	call	time_after@PLT
	test	rax, rax
	jne	.L6
.L16:
	mov	rax, QWORD PTR sharpsl_pm[rip+40]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L20:
	mov	eax, DWORD PTR sharpsl_pm[rip+8]
	mov	edx, DWORD PTR SHARPSL_APM_QUEUED[rip]
	test	eax, edx
	jne	.L11
	mov	edi, DWORD PTR sharpsl_pm[rip+12]
	or	eax, edx
	lea	rsi, .LC2[rip]
	mov	DWORD PTR sharpsl_pm[rip+8], eax
	call	dev_err@PLT
	mov	edi, DWORD PTR APM_CRITICAL_SUSPEND[rip]
	call	apm_queue_event@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L19:
	mov	r13d, DWORD PTR sharpsl_pm[rip+32]
	mov	r8d, eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L1:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	ret
.L6:
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -40
	.cfi_offset 6, -32
	.cfi_offset 12, -24
	.cfi_offset 13, -16
	xor	esi, esi
	lea	rdi, toggle_charger[rip]
	call	schedule_delayed_work@PLT
	jmp	.L16
	.cfi_endproc
.LFE0:
	.size	sharpsl_battery_thread, .-sharpsl_battery_thread
	.comm	toggle_charger,4,4
	.comm	sharpsl_pm,56,32
	.comm	sharpsl_bat,4,4
	.comm	jiffies,4,4
	.comm	SHARPSL_STATUS_ACIN,4,4
	.comm	SHARPSL_CHARGE_ON_TIME_INTERVAL,8,8
	.comm	SHARPSL_BL_LIMIT,4,4
	.comm	SHARPSL_BATT_VOLT,4,4
	.comm	SHARPSL_BATCHK_TIME,4,4
	.comm	SHARPSL_APM_QUEUED,4,4
	.comm	CHRG_ON,8,8
	.comm	APM_CRITICAL_SUSPEND,4,4
	.comm	APM_BATTERY_STATUS_LOW,4,4
	.comm	APM_BATTERY_STATUS_HIGH,4,4
	.comm	APM_BATTERY_STATUS_CRITICAL,4,4
	.comm	APM_AC_ONLINE,8,8
	.comm	APM_AC_OFFLINE,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_sharpsl_pm.c_sharpsl_battery_thread.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Warning: Cannot read main battery!\012\000"
	.align	2
.LC1:
	.ascii	"Battery: voltage: %d, status: %d, percentage: %d, t"
	.ascii	"ime: %ld\012\000"
	.align	2
.LC2:
	.ascii	"Fatal Off\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sharpsl_battery_thread, %function
sharpsl_battery_thread:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	ldr	r5, .L23
	sub	sp, sp, #12
	ldr	r3, [r5, #28]
	cmp	r3, #0
	beq	.L1
	ldr	r2, .L23+4
	ldr	r3, [r3]
	ldr	r0, [r2]
	blx	r3
	cmp	r0, #0
	ldreq	r3, .L23+8
	ldrne	r8, .L23+12
	ldreq	r2, [r3]
	ldr	r3, [r5, #28]
	ldrne	r2, [r8]
	ldr	r4, [r3, #12]
	ldreq	r8, .L23+12
	cmp	r4, #0
	str	r2, [r5, #12]
	beq	.L15
.L18:
	ldr	r9, .L23+16
.L5:
	mov	r6, #7
	ldr	r7, .L23+20
.L8:
	ldr	r3, [r3]
	ldr	r0, [r7]
	blx	r3
	subs	r4, r0, #0
	bgt	.L7
	subs	r6, r6, #1
	ldr	r3, [r5, #28]
	bne	.L8
	ldr	r3, [r3, #8]
	ldr	r1, .L23+24
	ldr	r0, [r5, #8]
	ldr	r4, [r3]
	bl	dev_warn
.L7:
	mov	r0, r4
	bl	sharpsl_average_value
	mov	r4, r0
	bl	get_apm_status
	mov	r6, r0
	mov	r0, r4
	bl	get_percentage
	ldr	r2, [r5, #12]
	ldr	r3, [r8]
	cmp	r2, r3
	beq	.L9
	ldr	r3, .L23+28
	ldr	r3, [r3]
	cmp	r3, r6
	beq	.L9
	ldr	r3, [r5, #16]
	cmp	r3, r0
	blt	.L21
.L9:
	str	r4, [r5, #20]
	str	r6, [r5, #24]
	str	r0, [r5, #16]
.L10:
	ldr	r3, [r9]
	mov	r2, r4
	stm	sp, {r0, r3}
	ldr	r1, .L23+32
	mov	r3, r6
	ldr	r0, [r5, #8]
	bl	dev_dbg
	ldr	r3, [r8]
	ldr	r2, [r5, #12]
	cmp	r2, r3
	beq	.L11
	ldr	r3, .L23+36
	ldr	r2, [r5, #24]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L22
.L11:
	ldr	r3, .L23+40
	ldr	r0, .L23+44
	ldr	r1, [r3]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, lr}
	b	schedule_delayed_work
.L15:
	ldr	r2, .L23+48
	ldr	r1, [r5]
	ldr	r2, [r2]
	cmp	r1, r2
	bne	.L18
	ldr	r3, .L23+52
	ldr	r1, [r5, #32]
	ldr	r3, [r3]
	ldr	r9, .L23+16
	add	r1, r1, r3
	ldr	r0, [r9]
	bl	time_after
	cmp	r0, #0
	bne	.L6
.L19:
	ldr	r3, [r5, #28]
	b	.L5
.L22:
	ldr	r2, .L23+56
	ldr	r3, [r5, #4]
	ldr	r2, [r2]
	tst	r3, r2
	bne	.L11
	orr	r3, r3, r2
	ldr	r0, [r5, #8]
	ldr	r1, .L23+60
	str	r3, [r5, #4]
	bl	dev_err
	ldr	r3, .L23+64
	ldr	r0, [r3]
	bl	apm_queue_event
	b	.L11
.L21:
	mov	r0, r3
	ldr	r6, [r5, #24]
	b	.L10
.L1:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L6:
	mov	r1, r4
	ldr	r0, .L23+68
	bl	schedule_delayed_work
	b	.L19
.L24:
	.align	2
.L23:
	.word	sharpsl_pm
	.word	SHARPSL_STATUS_ACIN
	.word	APM_AC_OFFLINE
	.word	APM_AC_ONLINE
	.word	jiffies
	.word	SHARPSL_BATT_VOLT
	.word	.LC0
	.word	APM_BATTERY_STATUS_HIGH
	.word	.LC1
	.word	APM_BATTERY_STATUS_CRITICAL
	.word	SHARPSL_BATCHK_TIME
	.word	sharpsl_bat
	.word	CHRG_ON
	.word	SHARPSL_CHARGE_ON_TIME_INTERVAL
	.word	SHARPSL_APM_QUEUED
	.word	.LC2
	.word	APM_CRITICAL_SUSPEND
	.word	toggle_charger
	.size	sharpsl_battery_thread, .-sharpsl_battery_thread
	.comm	toggle_charger,4,4
	.comm	sharpsl_pm,36,4
	.comm	sharpsl_bat,4,4
	.comm	jiffies,4,4
	.comm	SHARPSL_STATUS_ACIN,4,4
	.comm	SHARPSL_CHARGE_ON_TIME_INTERVAL,4,4
	.comm	SHARPSL_BL_LIMIT,4,4
	.comm	SHARPSL_BATT_VOLT,4,4
	.comm	SHARPSL_BATCHK_TIME,4,4
	.comm	SHARPSL_APM_QUEUED,4,4
	.comm	CHRG_ON,4,4
	.comm	APM_CRITICAL_SUSPEND,4,4
	.comm	APM_BATTERY_STATUS_LOW,4,4
	.comm	APM_BATTERY_STATUS_HIGH,4,4
	.comm	APM_BATTERY_STATUS_CRITICAL,4,4
	.comm	APM_AC_ONLINE,4,4
	.comm	APM_AC_OFFLINE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
