	.file	"extr_max8903_charger.c_max8903_usbin.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Connected"
.LC1:
	.string	"Disconnected"
.LC2:
	.string	"USB Charger %s.\n"
	.text
	.p2align 4
	.type	max8903_usbin, @function
max8903_usbin:
.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
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	r12, QWORD PTR 32[rsi]
	mov	rbx, rsi
	mov	edi, DWORD PTR 4[r12]
	call	gpio_get_value@PLT
	test	rax, rax
	mov	rbp, rax
	sete	al
	movzx	eax, al
	cmp	DWORD PTR [rbx], eax
	je	.L10
	mov	DWORD PTR [rbx], eax
	mov	edi, DWORD PTR [r12]
	call	gpio_is_valid@PLT
	test	rax, rax
	je	.L4
	xor	esi, esi
	test	rbp, rbp
	je	.L5
	xor	esi, esi
	cmp	QWORD PTR 16[rbx], 0
	sete	sil
.L5:
	mov	edi, DWORD PTR [r12]
	call	gpio_set_value@PLT
.L4:
	test	rbp, rbp
	lea	rax, .LC1[rip]
	mov	edi, DWORD PTR 24[rbx]
	lea	rdx, .LC0[rip]
	cmovne	rdx, rax
	lea	rsi, .LC2[rip]
	call	dev_dbg@PLT
	cmp	QWORD PTR 16[rbx], 0
	mov	edx, DWORD PTR 8[rbx]
	je	.L7
	mov	eax, DWORD PTR POWER_SUPPLY_TYPE_MAINS[rip]
	mov	DWORD PTR 8[rbx], eax
.L8:
	cmp	edx, eax
	je	.L10
	mov	edi, DWORD PTR 4[rbx]
	call	power_supply_changed@PLT
.L10:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, DWORD PTR IRQ_HANDLED[rip]
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	mov	eax, DWORD PTR [rbx]
	test	eax, eax
	je	.L9
	mov	eax, DWORD PTR POWER_SUPPLY_TYPE_USB[rip]
	mov	DWORD PTR 8[rbx], eax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	mov	eax, DWORD PTR POWER_SUPPLY_TYPE_BATTERY[rip]
	mov	DWORD PTR 8[rbx], eax
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	max8903_usbin, .-max8903_usbin
	.comm	POWER_SUPPLY_TYPE_USB,4,4
	.comm	POWER_SUPPLY_TYPE_MAINS,4,4
	.comm	POWER_SUPPLY_TYPE_BATTERY,4,4
	.comm	IRQ_HANDLED,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_max8903_charger.c_max8903_usbin.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Connected\000"
	.align	2
.LC1:
	.ascii	"Disconnected\000"
	.align	2
.LC2:
	.ascii	"USB Charger %s.\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	max8903_usbin, %function
max8903_usbin:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r6, [r1, #20]
	mov	r4, r1
	ldr	r0, [r6, #4]
	bl	gpio_get_value
	clz	r3, r0
	ldr	r2, [r4]
	lsr	r3, r3, #5
	cmp	r2, r3
	beq	.L10
	mov	r5, r0
	str	r3, [r4]
	ldr	r0, [r6]
	bl	gpio_is_valid
	cmp	r0, #0
	beq	.L4
	cmp	r5, #0
	ldrne	r1, [r4, #12]
	moveq	r1, r5
	clzne	r1, r1
	ldr	r0, [r6]
	lsrne	r1, r1, #5
	bl	gpio_set_value
.L4:
	ldr	r3, .L19
	cmp	r5, #0
	ldr	r2, .L19+4
	ldr	r1, .L19+8
	movne	r2, r3
	ldr	r0, [r4, #16]
	bl	dev_dbg
	ldr	r3, [r4, #12]
	ldr	r2, [r4, #8]
	cmp	r3, #0
	bne	.L18
	ldr	r3, [r4]
	cmp	r3, #0
	ldrne	r3, .L19+12
	ldreq	r3, .L19+16
	ldr	r3, [r3]
	str	r3, [r4, #8]
.L8:
	cmp	r2, r3
	beq	.L10
	ldr	r0, [r4, #4]
	bl	power_supply_changed
.L10:
	ldr	r3, .L19+20
	ldr	r0, [r3]
	pop	{r4, r5, r6, pc}
.L18:
	ldr	r3, .L19+24
	ldr	r3, [r3]
	str	r3, [r4, #8]
	b	.L8
.L20:
	.align	2
.L19:
	.word	.LC1
	.word	.LC0
	.word	.LC2
	.word	POWER_SUPPLY_TYPE_USB
	.word	POWER_SUPPLY_TYPE_BATTERY
	.word	IRQ_HANDLED
	.word	POWER_SUPPLY_TYPE_MAINS
	.size	max8903_usbin, .-max8903_usbin
	.comm	POWER_SUPPLY_TYPE_USB,4,4
	.comm	POWER_SUPPLY_TYPE_MAINS,4,4
	.comm	POWER_SUPPLY_TYPE_BATTERY,4,4
	.comm	IRQ_HANDLED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
