	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bq27xxx_battery_i2c_read
_bq27xxx_battery_i2c_read:              ## @bq27xxx_battery_i2c_read
	.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
	subq	$88, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movl	%esi, -108(%rbp)
	movl	(%rdi), %edi
	callq	_to_i2c_client
	movl	(%rax), %ebx
	testl	%ebx, %ebx
	je	LBB0_1
## %bb.2:
	movl	4(%rax), %eax
	movl	%eax, -72(%rbp)
	movq	$0, -80(%rbp)
	leaq	-108(%rbp), %rcx
	movq	%rcx, -96(%rbp)
	movl	$4, -88(%rbp)
	movl	%eax, -40(%rbp)
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	-104(%rbp), %rax
	movq	%rax, -64(%rbp)
	xorl	%eax, %eax
	cmpl	$1, %r14d
	adcl	$1, %eax
	movl	%eax, -56(%rbp)
	leaq	-96(%rbp), %r15
	movq	%r15, %rdi
	callq	_ARRAY_SIZE
	movl	%ebx, %edi
	movq	%r15, %rsi
	movl	%eax, %edx
	callq	_i2c_transfer
	testl	%eax, %eax
	js	LBB0_6
## %bb.3:
	testl	%r14d, %r14d
	je	LBB0_4
## %bb.5:
	movl	-104(%rbp), %eax
	jmp	LBB0_6
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_6
LBB0_4:
	leaq	-104(%rbp), %rdi
	callq	_get_unaligned_le16
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-32(%rbp), %rcx
	jne	LBB0_8
## %bb.7:
	addq	$88, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_I2C_M_RD,8,3                   ## @I2C_M_RD
	.no_dead_strip	_bq27xxx_battery_i2c_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bq27xxx_battery_i2c_read
_bq27xxx_battery_i2c_read:              ; @bq27xxx_battery_i2c_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x2
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
	str	w1, [sp, #12]
	ldr	w0, [x0]
	bl	_to_i2c_client
	ldr	w20, [x0]
	cbz	w20, LBB0_4
; %bb.1:
	ldr	w8, [x0, #4]
	str	w8, [sp, #48]
	str	xzr, [sp, #40]
	add	x9, sp, #12
	str	x9, [sp, #24]
	mov	w9, #4
	str	w9, [sp, #32]
	str	w8, [sp, #80]
Lloh3:
	adrp	x8, _I2C_M_RD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _I2C_M_RD@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	str	x8, [sp, #72]
	add	x8, sp, #16
	str	x8, [sp, #56]
	cmp	w19, #0
	mov	w8, #1
	cinc	w8, w8, eq
	str	w8, [sp, #64]
	add	x0, sp, #24
	bl	_ARRAY_SIZE
	mov	x2, x0
	add	x1, sp, #24
	mov	x0, x20
	bl	_i2c_transfer
	tbnz	w0, #31, LBB0_6
; %bb.2:
	cbz	w19, LBB0_5
; %bb.3:
	ldr	w0, [sp, #16]
	b	LBB0_6
LBB0_4:
Lloh6:
	adrp	x8, _ENODEV@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_5:
	add	x0, sp, #16
	bl	_get_unaligned_le16
LBB0_6:
	ldur	x8, [x29, #-24]
Lloh9:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh10:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.7:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_I2C_M_RD,8,3                   ; @I2C_M_RD
	.no_dead_strip	_bq27xxx_battery_i2c_read
.subsections_via_symbols
