	.file	"extr_bq27xxx_battery.c_bq27xxx_battery_read_dm_block.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"bus error reading chip memory: %d\n"
	.text
	.p2align 4
	.type	bq27xxx_battery_read_dm_block, @function
bq27xxx_battery_read_dm_block:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	ecx, 1
	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	edx, DWORD PTR 16[rsi]
	mov	DWORD PTR [rsi], 0
	mov	esi, DWORD PTR BQ27XXX_DM_CLASS[rip]
	call	bq27xxx_write@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L2
	mov	edx, DWORD PTR 12[rbx]
	mov	esi, DWORD PTR BQ27XXX_DM_BLOCK[rip]
	mov	ecx, 1
	mov	rdi, rbp
	call	bq27xxx_write@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L2
	mov	edi, 1
	call	BQ27XXX_MSLEEP@PLT
	mov	edx, DWORD PTR 8[rbx]
	mov	ecx, DWORD PTR BQ27XXX_DM_SZ[rip]
	mov	rdi, rbp
	mov	esi, DWORD PTR BQ27XXX_DM_DATA[rip]
	call	bq27xxx_read_block@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L2
	mov	esi, DWORD PTR BQ27XXX_DM_CKSUM[rip]
	mov	edx, 1
	mov	rdi, rbp
	call	bq27xxx_read@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L2
	mov	rdi, rbx
	call	bq27xxx_battery_checksum_dm_block@PLT
	mov	r8, rax
	movsx	rax, r12d
	cmp	rax, r8
	je	.L3
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
	.p2align 4,,10
	.p2align 3
.L2:
	mov	edi, DWORD PTR 0[rbp]
	mov	edx, r12d
	lea	rsi, .LC0[rip]
	call	dev_err@PLT
.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	QWORD PTR [rbx], 1
	xor	r12d, r12d
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	bq27xxx_battery_read_dm_block, .-bq27xxx_battery_read_dm_block
	.comm	EINVAL,4,4
	.comm	BQ27XXX_DM_SZ,4,4
	.comm	BQ27XXX_DM_DATA,4,4
	.comm	BQ27XXX_DM_CLASS,4,4
	.comm	BQ27XXX_DM_CKSUM,4,4
	.comm	BQ27XXX_DM_BLOCK,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_bq27xxx_battery.c_bq27xxx_battery_read_dm_block.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"bus error reading chip memory: %d\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	bq27xxx_battery_read_dm_block, %function
bq27xxx_battery_read_dm_block:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r7, #0
	ldr	r3, .L7
	ldr	r2, [r1, #16]
	str	r7, [r1]
	mov	r5, r1
	ldr	r1, [r3]
	mov	r3, #1
	mov	r6, r0
	bl	bq27xxx_write
	subs	r4, r0, #0
	blt	.L2
	ldr	r2, .L7+4
	mov	r3, #1
	ldr	r1, [r2]
	mov	r0, r6
	ldr	r2, [r5, #12]
	bl	bq27xxx_write
	subs	r4, r0, #0
	blt	.L2
	mov	r0, #1
	bl	BQ27XXX_MSLEEP
	ldr	r2, .L7+8
	ldr	r3, .L7+12
	ldr	r1, [r2]
	mov	r0, r6
	ldr	r3, [r3]
	ldr	r2, [r5, #8]
	bl	bq27xxx_read_block
	subs	r4, r0, #0
	blt	.L2
	ldr	r3, .L7+16
	mov	r2, #1
	mov	r0, r6
	ldr	r1, [r3]
	bl	bq27xxx_read
	subs	r4, r0, #0
	blt	.L2
	mov	r0, r5
	bl	bq27xxx_battery_checksum_dm_block
	cmp	r0, r4
	beq	.L3
	ldr	r3, .L7+20
	ldr	r4, [r3]
	rsb	r4, r4, #0
.L2:
	mov	r2, r4
	ldr	r0, [r6]
	ldr	r1, .L7+24
	bl	dev_err
.L1:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L3:
	mov	r3, #1
	mov	r4, r7
	str	r7, [r5, #4]
	str	r3, [r5]
	b	.L1
.L8:
	.align	2
.L7:
	.word	BQ27XXX_DM_CLASS
	.word	BQ27XXX_DM_BLOCK
	.word	BQ27XXX_DM_DATA
	.word	BQ27XXX_DM_SZ
	.word	BQ27XXX_DM_CKSUM
	.word	EINVAL
	.word	.LC0
	.size	bq27xxx_battery_read_dm_block, .-bq27xxx_battery_read_dm_block
	.comm	EINVAL,4,4
	.comm	BQ27XXX_DM_SZ,4,4
	.comm	BQ27XXX_DM_DATA,4,4
	.comm	BQ27XXX_DM_CLASS,4,4
	.comm	BQ27XXX_DM_CKSUM,4,4
	.comm	BQ27XXX_DM_BLOCK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
