	.file	"extr_wm831x_power.c_wm831x_bat_check_status.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	wm831x_bat_check_status, @function
wm831x_bat_check_status:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rsi
	mov	esi, DWORD PTR WM831X_SYSTEM_STATUS[rip]
	call	wm831x_reg_read@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L1
	and	r12d, DWORD PTR WM831X_PWR_SRC_BATT[rip]
	je	.L3
	mov	eax, DWORD PTR POWER_SUPPLY_STATUS_DISCHARGING[rip]
	xor	r12d, r12d
	mov	DWORD PTR [rbx], eax
.L1:
	mov	eax, r12d
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	mov	esi, DWORD PTR WM831X_CHARGER_STATUS[rip]
	mov	rdi, rbp
	call	wm831x_reg_read@PLT
	test	eax, eax
	js	.L7
	and	eax, DWORD PTR WM831X_CHG_STATE_MASK[rip]
	cmp	eax, 129
	je	.L4
	and	eax, -3
	cmp	eax, 128
	je	.L11
	mov	eax, DWORD PTR POWER_SUPPLY_STATUS_UNKNOWN[rip]
	mov	DWORD PTR [rbx], eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L4:
	mov	eax, DWORD PTR POWER_SUPPLY_STATUS_NOT_CHARGING[rip]
	mov	DWORD PTR [rbx], eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L11:
	mov	eax, DWORD PTR POWER_SUPPLY_STATUS_CHARGING[rip]
	mov	DWORD PTR [rbx], eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L7:
	mov	r12d, eax
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	wm831x_bat_check_status, .-wm831x_bat_check_status
	.comm	WM831X_SYSTEM_STATUS,4,4
	.comm	WM831X_PWR_SRC_BATT,4,4
	.comm	WM831X_CHG_STATE_MASK,4,4
	.comm	WM831X_CHARGER_STATUS,4,4
	.comm	POWER_SUPPLY_STATUS_UNKNOWN,4,4
	.comm	POWER_SUPPLY_STATUS_NOT_CHARGING,4,4
	.comm	POWER_SUPPLY_STATUS_DISCHARGING,4,4
	.comm	POWER_SUPPLY_STATUS_CHARGING,4,4
	.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_wm831x_power.c_wm831x_bat_check_status.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	wm831x_bat_check_status, %function
wm831x_bat_check_status:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L12
	push	{r4, r5, r6, lr}
	mov	r5, r1
	ldr	r1, [r3]
	mov	r6, r0
	bl	wm831x_reg_read
	subs	r4, r0, #0
	blt	.L1
	ldr	r3, .L12+4
	ldr	r3, [r3]
	ands	r4, r4, r3
	beq	.L3
	mov	r4, #0
	ldr	r3, .L12+8
	ldr	r3, [r3]
	str	r3, [r5]
.L1:
	mov	r0, r4
	pop	{r4, r5, r6, pc}
.L3:
	ldr	r3, .L12+12
	mov	r0, r6
	ldr	r1, [r3]
	bl	wm831x_reg_read
	cmp	r0, #0
	movlt	r4, r0
	blt	.L1
	ldr	r3, .L12+16
	ldr	r3, [r3]
	and	r0, r0, r3
	cmp	r0, #129
	beq	.L4
	bic	r0, r0, #2
	cmp	r0, #128
	beq	.L11
	ldr	r3, .L12+20
	ldr	r3, [r3]
	str	r3, [r5]
	b	.L1
.L4:
	ldr	r3, .L12+24
	ldr	r3, [r3]
	str	r3, [r5]
	b	.L1
.L11:
	ldr	r3, .L12+28
	ldr	r3, [r3]
	str	r3, [r5]
	b	.L1
.L13:
	.align	2
.L12:
	.word	WM831X_SYSTEM_STATUS
	.word	WM831X_PWR_SRC_BATT
	.word	POWER_SUPPLY_STATUS_DISCHARGING
	.word	WM831X_CHARGER_STATUS
	.word	WM831X_CHG_STATE_MASK
	.word	POWER_SUPPLY_STATUS_UNKNOWN
	.word	POWER_SUPPLY_STATUS_NOT_CHARGING
	.word	POWER_SUPPLY_STATUS_CHARGING
	.size	wm831x_bat_check_status, .-wm831x_bat_check_status
	.comm	WM831X_SYSTEM_STATUS,4,4
	.comm	WM831X_PWR_SRC_BATT,4,4
	.comm	WM831X_CHG_STATE_MASK,4,4
	.comm	WM831X_CHARGER_STATUS,4,4
	.comm	POWER_SUPPLY_STATUS_UNKNOWN,4,4
	.comm	POWER_SUPPLY_STATUS_NOT_CHARGING,4,4
	.comm	POWER_SUPPLY_STATUS_DISCHARGING,4,4
	.comm	POWER_SUPPLY_STATUS_CHARGING,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
