	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bq27xxx_battery_read_dm_block
_bq27xxx_battery_read_dm_block:         ## @bq27xxx_battery_read_dm_block
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movl	$0, (%rsi)
	movq	_BQ27XXX_DM_CLASS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	16(%r15), %edx
	movl	$1, %ecx
	callq	_bq27xxx_write
	testl	%eax, %eax
	js	LBB0_6
## %bb.1:
	movq	_BQ27XXX_DM_BLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	12(%r15), %edx
	movq	%r14, %rdi
	movl	$1, %ecx
	callq	_bq27xxx_write
	testl	%eax, %eax
	js	LBB0_6
## %bb.2:
	movl	$1, %edi
	callq	_BQ27XXX_MSLEEP
	movq	_BQ27XXX_DM_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r15), %edx
	movq	_BQ27XXX_DM_SZ@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	callq	_bq27xxx_read_block
	testl	%eax, %eax
	js	LBB0_6
## %bb.3:
	movq	_BQ27XXX_DM_CKSUM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_bq27xxx_read
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_10
## %bb.4:
	movl	%ebx, %ebx
	movq	%r15, %rdi
	callq	_bq27xxx_battery_checksum_dm_block
	cmpq	%rbx, %rax
	jne	LBB0_9
## %bb.5:
	movq	$1, (%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_6:
	movl	%eax, %ebx
LBB0_10:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_err
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_BQ27XXX_DM_CLASS,4,2           ## @BQ27XXX_DM_CLASS
	.comm	_BQ27XXX_DM_BLOCK,4,2           ## @BQ27XXX_DM_BLOCK
	.comm	_BQ27XXX_DM_DATA,4,2            ## @BQ27XXX_DM_DATA
	.comm	_BQ27XXX_DM_SZ,4,2              ## @BQ27XXX_DM_SZ
	.comm	_BQ27XXX_DM_CKSUM,4,2           ## @BQ27XXX_DM_CKSUM
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bus error reading chip memory: %d\n"

	.no_dead_strip	_bq27xxx_battery_read_dm_block
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function bq27xxx_battery_read_dm_block
lCPI0_0:
	.long	1                               ; 0x1
	.long	0                               ; 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_bq27xxx_battery_read_dm_block:         ; @bq27xxx_battery_read_dm_block
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x19, x0
	str	wzr, [x1]
Lloh0:
	adrp	x8, _BQ27XXX_DM_CLASS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BQ27XXX_DM_CLASS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldr	w2, [x20, #16]
	mov	w3, #1
	bl	_bq27xxx_write
	tbnz	w0, #31, LBB0_6
; %bb.1:
Lloh3:
	adrp	x8, _BQ27XXX_DM_BLOCK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BQ27XXX_DM_BLOCK@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	ldr	w2, [x20, #12]
	mov	x0, x19
	mov	w3, #1
	bl	_bq27xxx_write
	tbnz	w0, #31, LBB0_6
; %bb.2:
	mov	w0, #1
	bl	_BQ27XXX_MSLEEP
Lloh6:
	adrp	x8, _BQ27XXX_DM_DATA@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BQ27XXX_DM_DATA@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	ldr	w2, [x20, #8]
Lloh9:
	adrp	x8, _BQ27XXX_DM_SZ@GOTPAGE
Lloh10:
	ldr	x8, [x8, _BQ27XXX_DM_SZ@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_bq27xxx_read_block
	tbnz	w0, #31, LBB0_6
; %bb.3:
Lloh12:
	adrp	x8, _BQ27XXX_DM_CKSUM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BQ27XXX_DM_CKSUM@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_bq27xxx_read
	mov	x21, x0
	tbnz	w0, #31, LBB0_7
; %bb.4:
	mov	x0, x20
	bl	_bq27xxx_battery_checksum_dm_block
	cmp	x0, w21, uxtw
	b.ne	LBB0_9
; %bb.5:
	mov	w21, #0
Lloh15:
	adrp	x8, lCPI0_0@PAGE
Lloh16:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x20]
	b	LBB0_8
LBB0_6:
	mov	x21, x0
LBB0_7:
	ldr	w0, [x19]
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dev_err
LBB0_8:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_9:
Lloh19:
	adrp	x8, _EINVAL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdr	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_BQ27XXX_DM_CLASS,4,2           ; @BQ27XXX_DM_CLASS
	.comm	_BQ27XXX_DM_BLOCK,4,2           ; @BQ27XXX_DM_BLOCK
	.comm	_BQ27XXX_DM_DATA,4,2            ; @BQ27XXX_DM_DATA
	.comm	_BQ27XXX_DM_SZ,4,2              ; @BQ27XXX_DM_SZ
	.comm	_BQ27XXX_DM_CKSUM,4,2           ; @BQ27XXX_DM_CKSUM
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bus error reading chip memory: %d\n"

	.no_dead_strip	_bq27xxx_battery_read_dm_block
.subsections_via_symbols
