	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bq24257_get_chip_state
_bq24257_get_chip_state:                ## @bq24257_get_chip_state
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	_F_STAT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_bq24257_field_read
	testl	%eax, %eax
	js	LBB0_8
## %bb.1:
	movl	%eax, (%r14)
	movq	_F_FAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_bq24257_field_read
	testl	%eax, %eax
	js	LBB0_8
## %bb.2:
	movl	%eax, 4(%r14)
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.3:
	callq	_gpiod_get_value_cansleep
	xorl	%ecx, %ecx
	testl	%eax, %eax
	sete	%cl
	movl	%ecx, 8(%r14)
	jmp	LBB0_7
LBB0_4:
	addl	$-128, %eax
	cmpl	$2, %eax
	ja	LBB0_6
## %bb.5:
	movl	$0, 8(%r14)
	jmp	LBB0_7
LBB0_6:
	movl	$1, 8(%r14)
LBB0_7:
	xorl	%eax, %eax
LBB0_8:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_F_STAT,4,2                     ## @F_STAT
	.comm	_F_FAULT,4,2                    ## @F_FAULT
	.no_dead_strip	_bq24257_get_chip_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bq24257_get_chip_state
_bq24257_get_chip_state:                ; @bq24257_get_chip_state
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _F_STAT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _F_STAT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_bq24257_field_read
	tbnz	w0, #31, LBB0_8
; %bb.1:
	str	w0, [x19]
Lloh3:
	adrp	x8, _F_FAULT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _F_FAULT@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_bq24257_field_read
	tbnz	w0, #31, LBB0_8
; %bb.2:
	str	w0, [x19, #4]
	ldr	x8, [x20]
	cbz	x8, LBB0_4
; %bb.3:
	mov	x0, x8
	bl	_gpiod_get_value_cansleep
	mov	x8, x0
	mov	w0, #0
	cmp	w8, #0
	cset	w8, eq
	b	LBB0_7
LBB0_4:
	sub	w8, w0, #128
	cmp	w8, #2
	b.hi	LBB0_6
; %bb.5:
	mov	w0, #0
	str	wzr, [x19, #8]
	b	LBB0_8
LBB0_6:
	mov	w0, #0
	mov	w8, #1
LBB0_7:
	str	w8, [x19, #8]
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_F_STAT,4,2                     ; @F_STAT
	.comm	_F_FAULT,4,2                    ; @F_FAULT
	.no_dead_strip	_bq24257_get_chip_state
.subsections_via_symbols
