	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bq27xxx_write_block
_bq27xxx_write_block:                   ## @bq27xxx_write_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
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	movq	%rdi, %r15
	movq	(%rdi), %rax
	movslq	%esi, %r14
	movq	(%rax,%r14,8), %rsi
	movq	_INVALID_REG_ADDR@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	jne	LBB0_4
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	16(%r15), %rax
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%r15, %rdi
	callq	*%rax
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_8
## %bb.7:
	movl	8(%r15), %edi
	movq	(%r15), %rax
	movq	(%rax,%r14,8), %rdx
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %ecx
	callq	_dev_dbg
	jmp	LBB0_8
LBB0_5:
	movq	_EPERM@GOTPCREL(%rip), %rax
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_INVALID_REG_ADDR,8,3           ## @INVALID_REG_ADDR
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EPERM,4,2                      ## @EPERM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to write_bulk register 0x%02x (index %d)\n"

	.no_dead_strip	_bq27xxx_write_block
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bq27xxx_write_block
_bq27xxx_write_block:                   ; @bq27xxx_write_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
	cbz	x0, LBB0_2
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x0]
	ldr	x1, [x8, w1, sxtw #3]
Lloh0:
	adrp	x8, _INVALID_REG_ADDR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _INVALID_REG_ADDR@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x1, x8
	b.ne	LBB0_5
LBB0_2:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_4:
	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_5:
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_8
; %bb.6:
	mov	x0, x20
	blr	x8
	mov	x21, x0
	tbz	w0, #31, LBB0_4
; %bb.7:
	sxtw	x8, w19
	ldr	w0, [x20, #8]
	ldr	x9, [x20]
	ldr	x2, [x9, x8, lsl #3]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x3, x19
	bl	_dev_dbg
	b	LBB0_4
LBB0_8:
Lloh7:
	adrp	x8, _EPERM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_INVALID_REG_ADDR,8,3           ; @INVALID_REG_ADDR
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EPERM,4,2                      ; @EPERM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to write_bulk register 0x%02x (index %d)\n"

	.no_dead_strip	_bq27xxx_write_block
.subsections_via_symbols
