	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bq24190_check_status
_bq24190_check_status:                  ## @bq24190_check_status
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_BQ24190_REG_SS_CHRG_STAT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_BQ24190_REG_F_BAT_FAULT_MASK@GOTPCREL(%rip), %rcx
	movq	_BQ24190_REG_F_NTC_FAULT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	orl	(%rcx), %r12d
	movl	$0, -44(%rbp)
	movl	$0, -48(%rbp)
	movq	_BQ24190_REG_SS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	callq	_bq24190_read
	testl	%eax, %eax
	js	LBB0_4
## %bb.1:
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	xorl	%ebx, %ebx
	movq	_BQ24190_REG_F@GOTPCREL(%rip), %r13
	leaq	-48(%rbp), %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movq	%r14, %rdi
	movq	%r15, %rdx
	callq	_bq24190_read
	testl	%eax, %eax
	js	LBB0_3
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	-48(%rbp), %eax
	testl	%eax, %eax
	setne	%cl
	notb	%bl
	testb	%cl, %bl
	movb	$1, %bl
	jne	LBB0_2
## %bb.7:
	movq	_BQ24190_REG_F_CHRG_FAULT_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$1, %edx
	shll	%cl, %edx
	cmpl	%edx, %eax
	jne	LBB0_10
## %bb.8:
	movq	_BQ24190_REG_SS_PG_STAT_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, -44(%rbp)
	jne	LBB0_10
## %bb.9:
	movl	$0, -48(%rbp)
	xorl	%eax, %eax
LBB0_10:
	xorl	%r15d, %r15d
	movl	$0, %ebx
	cmpl	(%r14), %eax
	je	LBB0_12
## %bb.11:
	movl	8(%r14), %edi
	movq	_BQ24190_REG_F_BOOST_FAULT_MASK@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	setne	%dl
	movq	_BQ24190_REG_F_CHRG_FAULT_MASK@GOTPCREL(%rip), %rsi
	xorl	%ecx, %ecx
	movl	(%rsi), %esi
	andl	%eax, %esi
	setne	%cl
	xorl	%r8d, %r8d
	movq	_BQ24190_REG_F_BAT_FAULT_MASK@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	andl	%eax, %esi
	setne	%r8b
	xorl	%r9d, %r9d
	movq	_BQ24190_REG_F_NTC_FAULT_MASK@GOTPCREL(%rip), %rsi
	andl	(%rsi), %eax
	setne	%r9b
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_warn
	leaq	32(%r14), %r13
	movq	%r13, %rdi
	callq	_mutex_lock
	movl	-48(%rbp), %eax
	movl	(%r14), %ecx
	xorl	%eax, %ecx
	xorl	%ebx, %ebx
	testl	%r12d, %ecx
	setne	%bl
	notl	%r12d
	xorl	%r15d, %r15d
	testl	%r12d, %ecx
	setne	%r15b
	movl	%eax, (%r14)
	movq	%r13, %rdi
	callq	_mutex_unlock
LBB0_12:
	movl	-44(%rbp), %eax
	movl	4(%r14), %edx
	cmpl	%edx, %eax
	je	LBB0_18
## %bb.13:
	movq	_BQ24190_REG_SS_PG_STAT_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%edx, %ecx
	je	LBB0_17
## %bb.14:
	andl	%eax, %ecx
	jne	LBB0_17
## %bb.15:
	movq	_BQ24190_REG_ISC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BQ24190_REG_ISC_EN_HIZ_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_BQ24190_REG_ISC_EN_HIZ_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	xorl	%r8d, %r8d
	callq	_bq24190_write_mask
	testl	%eax, %eax
	jns	LBB0_17
## %bb.16:
	movl	8(%r14), %edi
	leaq	L_.str.3(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
LBB0_17:
	movl	-44(%rbp), %eax
	movl	4(%r14), %ecx
	xorl	%eax, %ecx
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	testl	%esi, %ecx
	movl	$1, %edx
	cmovnel	%edx, %ebx
	notl	%esi
	testl	%esi, %ecx
	cmovnel	%edx, %r15d
	movl	%eax, 4(%r14)
LBB0_18:
	orl	%ebx, %r15d
	je	LBB0_20
## %bb.19:
	movq	24(%r14), %rdi
	callq	_power_supply_changed
	movl	-44(%rbp), %esi
	movq	%r14, %rdi
	callq	_bq24190_configure_usb_otg
LBB0_20:
	testl	%ebx, %ebx
	je	LBB0_23
## %bb.21:
	movq	16(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_23
## %bb.22:
	callq	_power_supply_changed
LBB0_23:
	movl	8(%r14), %edi
	movl	-44(%rbp), %edx
	movl	-48(%rbp), %ecx
	leaq	L_.str.4(%rip), %rsi
	callq	_dev_dbg
	jmp	LBB0_24
LBB0_4:
	movl	8(%r14), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_5
LBB0_3:
	movl	8(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_5:
	movl	%eax, %edx
	callq	_dev_err
LBB0_24:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BQ24190_REG_SS_CHRG_STAT_MASK,4,2 ## @BQ24190_REG_SS_CHRG_STAT_MASK
	.comm	_BQ24190_REG_F_BAT_FAULT_MASK,4,2 ## @BQ24190_REG_F_BAT_FAULT_MASK
	.comm	_BQ24190_REG_F_NTC_FAULT_MASK,4,2 ## @BQ24190_REG_F_NTC_FAULT_MASK
	.comm	_BQ24190_REG_SS,4,2             ## @BQ24190_REG_SS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't read SS reg: %d\n"

	.comm	_BQ24190_REG_F,4,2              ## @BQ24190_REG_F
L_.str.1:                               ## @.str.1
	.asciz	"Can't read F reg: %d\n"

	.comm	_BQ24190_REG_F_CHRG_FAULT_SHIFT,4,2 ## @BQ24190_REG_F_CHRG_FAULT_SHIFT
	.comm	_BQ24190_REG_SS_PG_STAT_MASK,4,2 ## @BQ24190_REG_SS_PG_STAT_MASK
L_.str.2:                               ## @.str.2
	.asciz	"Fault: boost %d, charge %d, battery %d, ntc %d\n"

	.comm	_BQ24190_REG_F_BOOST_FAULT_MASK,4,2 ## @BQ24190_REG_F_BOOST_FAULT_MASK
	.comm	_BQ24190_REG_F_CHRG_FAULT_MASK,4,2 ## @BQ24190_REG_F_CHRG_FAULT_MASK
	.comm	_BQ24190_REG_ISC,4,2            ## @BQ24190_REG_ISC
	.comm	_BQ24190_REG_ISC_EN_HIZ_MASK,4,2 ## @BQ24190_REG_ISC_EN_HIZ_MASK
	.comm	_BQ24190_REG_ISC_EN_HIZ_SHIFT,4,2 ## @BQ24190_REG_ISC_EN_HIZ_SHIFT
L_.str.3:                               ## @.str.3
	.asciz	"Can't access ISC reg: %d\n"

L_.str.4:                               ## @.str.4
	.asciz	"ss_reg: 0x%02x, f_reg: 0x%02x\n"

	.no_dead_strip	_bq24190_check_status
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bq24190_check_status
_bq24190_check_status:                  ; @bq24190_check_status
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
Lloh0:
	adrp	x8, _BQ24190_REG_SS_CHRG_STAT_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BQ24190_REG_SS_CHRG_STAT_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
Lloh3:
	adrp	x22, _BQ24190_REG_F_BAT_FAULT_MASK@GOTPAGE
Lloh4:
	ldr	x22, [x22, _BQ24190_REG_F_BAT_FAULT_MASK@GOTPAGEOFF]
	ldr	w23, [x22]
Lloh5:
	adrp	x20, _BQ24190_REG_F_NTC_FAULT_MASK@GOTPAGE
Lloh6:
	ldr	x20, [x20, _BQ24190_REG_F_NTC_FAULT_MASK@GOTPAGEOFF]
	ldr	w24, [x20]
	str	xzr, [sp, #8]
Lloh7:
	adrp	x8, _BQ24190_REG_SS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _BQ24190_REG_SS@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_bq24190_read
	tbnz	w0, #31, LBB0_10
; %bb.1:
Lloh10:
	adrp	x25, _BQ24190_REG_F@GOTPAGE
Lloh11:
	ldr	x25, [x25, _BQ24190_REG_F@GOTPAGEOFF]
	ldr	w1, [x25]
	add	x2, sp, #8
	mov	x0, x19
	bl	_bq24190_read
	tbnz	w0, #31, LBB0_11
; %bb.2:
	ldr	w8, [sp, #8]
	cbz	w8, LBB0_5
; %bb.3:
	ldr	w1, [x25]
	add	x2, sp, #8
	mov	x0, x19
	bl	_bq24190_read
	tbnz	w0, #31, LBB0_11
; %bb.4:
	ldr	w8, [sp, #8]
LBB0_5:
Lloh12:
	adrp	x9, _BQ24190_REG_F_CHRG_FAULT_SHIFT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _BQ24190_REG_F_CHRG_FAULT_SHIFT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	mov	w10, #1
	lsl	w9, w10, w9
	cmp	w8, w9
	b.ne	LBB0_8
; %bb.6:
	ldr	w9, [sp, #12]
Lloh15:
	adrp	x10, _BQ24190_REG_SS_PG_STAT_MASK@GOTPAGE
Lloh16:
	ldr	x10, [x10, _BQ24190_REG_SS_PG_STAT_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
	tst	w10, w9
	b.ne	LBB0_8
; %bb.7:
	mov	w8, #0
	str	wzr, [sp, #8]
LBB0_8:
	ldr	w9, [x19]
	cmp	w8, w9
	b.ne	LBB0_12
; %bb.9:
	mov	w23, #0
	mov	w22, #0
	b	LBB0_13
LBB0_10:
	mov	x2, x0
	ldr	w0, [x19, #8]
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_24
LBB0_11:
	mov	x2, x0
	ldr	w0, [x19, #8]
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_24
LBB0_12:
	orr	w23, w24, w23
	ldr	w0, [x19, #8]
Lloh22:
	adrp	x9, _BQ24190_REG_F_BOOST_FAULT_MASK@GOTPAGE
Lloh23:
	ldr	x9, [x9, _BQ24190_REG_F_BOOST_FAULT_MASK@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w2, ne
Lloh25:
	adrp	x9, _BQ24190_REG_F_CHRG_FAULT_MASK@GOTPAGE
Lloh26:
	ldr	x9, [x9, _BQ24190_REG_F_CHRG_FAULT_MASK@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w3, ne
	ldr	w9, [x22]
	tst	w9, w8
	cset	w4, ne
	ldr	w9, [x20]
	tst	w9, w8
	cset	w5, ne
Lloh28:
	adrp	x1, l_.str.2@PAGE
Lloh29:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_warn
	add	x20, x19, #32
	mov	x0, x20
	bl	_mutex_lock
	ldr	w8, [x19]
	ldr	w9, [sp, #8]
	eor	w8, w9, w8
	tst	w8, w23
	cset	w22, ne
	bics	wzr, w8, w23
	cset	w23, ne
	str	w9, [x19]
	mov	x0, x20
	bl	_mutex_unlock
LBB0_13:
	ldr	w8, [sp, #12]
	ldr	w9, [x19, #4]
	cmp	w8, w9
	b.eq	LBB0_18
; %bb.14:
Lloh30:
	adrp	x10, _BQ24190_REG_SS_PG_STAT_MASK@GOTPAGE
Lloh31:
	ldr	x10, [x10, _BQ24190_REG_SS_PG_STAT_MASK@GOTPAGEOFF]
Lloh32:
	ldr	w10, [x10]
	and	w9, w10, w9
	and	w8, w10, w8
	cmp	w9, #0
	ccmp	w8, #0, #0, ne
	b.ne	LBB0_17
; %bb.15:
Lloh33:
	adrp	x8, _BQ24190_REG_ISC@GOTPAGE
Lloh34:
	ldr	x8, [x8, _BQ24190_REG_ISC@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
Lloh36:
	adrp	x8, _BQ24190_REG_ISC_EN_HIZ_MASK@GOTPAGE
Lloh37:
	ldr	x8, [x8, _BQ24190_REG_ISC_EN_HIZ_MASK@GOTPAGEOFF]
Lloh38:
	ldr	w2, [x8]
Lloh39:
	adrp	x8, _BQ24190_REG_ISC_EN_HIZ_SHIFT@GOTPAGE
Lloh40:
	ldr	x8, [x8, _BQ24190_REG_ISC_EN_HIZ_SHIFT@GOTPAGEOFF]
Lloh41:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w4, #0
	bl	_bq24190_write_mask
	tbz	w0, #31, LBB0_17
; %bb.16:
	mov	x2, x0
	ldr	w0, [x19, #8]
Lloh42:
	adrp	x1, l_.str.3@PAGE
Lloh43:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
LBB0_17:
	ldr	w8, [x19, #4]
	ldr	w9, [sp, #12]
	eor	w8, w9, w8
	tst	w8, w21
	csinc	w22, w22, wzr, eq
	bics	wzr, w8, w21
	csinc	w23, w23, wzr, eq
	str	w9, [x19, #4]
LBB0_18:
	orr	w8, w22, w23
	cbz	w8, LBB0_20
; %bb.19:
	ldr	x0, [x19, #24]
	bl	_power_supply_changed
	ldr	w1, [sp, #12]
	mov	x0, x19
	bl	_bq24190_configure_usb_otg
LBB0_20:
	cbz	w22, LBB0_23
; %bb.21:
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_23
; %bb.22:
	bl	_power_supply_changed
LBB0_23:
	ldr	w0, [x19, #8]
	ldp	w3, w2, [sp, #8]
Lloh44:
	adrp	x1, l_.str.4@PAGE
Lloh45:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_dbg
LBB0_24:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpAdd	Lloh44, Lloh45
	.cfi_endproc
                                        ; -- End function
	.comm	_BQ24190_REG_SS_CHRG_STAT_MASK,4,2 ; @BQ24190_REG_SS_CHRG_STAT_MASK
	.comm	_BQ24190_REG_F_BAT_FAULT_MASK,4,2 ; @BQ24190_REG_F_BAT_FAULT_MASK
	.comm	_BQ24190_REG_F_NTC_FAULT_MASK,4,2 ; @BQ24190_REG_F_NTC_FAULT_MASK
	.comm	_BQ24190_REG_SS,4,2             ; @BQ24190_REG_SS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't read SS reg: %d\n"

	.comm	_BQ24190_REG_F,4,2              ; @BQ24190_REG_F
l_.str.1:                               ; @.str.1
	.asciz	"Can't read F reg: %d\n"

	.comm	_BQ24190_REG_F_CHRG_FAULT_SHIFT,4,2 ; @BQ24190_REG_F_CHRG_FAULT_SHIFT
	.comm	_BQ24190_REG_SS_PG_STAT_MASK,4,2 ; @BQ24190_REG_SS_PG_STAT_MASK
l_.str.2:                               ; @.str.2
	.asciz	"Fault: boost %d, charge %d, battery %d, ntc %d\n"

	.comm	_BQ24190_REG_F_BOOST_FAULT_MASK,4,2 ; @BQ24190_REG_F_BOOST_FAULT_MASK
	.comm	_BQ24190_REG_F_CHRG_FAULT_MASK,4,2 ; @BQ24190_REG_F_CHRG_FAULT_MASK
	.comm	_BQ24190_REG_ISC,4,2            ; @BQ24190_REG_ISC
	.comm	_BQ24190_REG_ISC_EN_HIZ_MASK,4,2 ; @BQ24190_REG_ISC_EN_HIZ_MASK
	.comm	_BQ24190_REG_ISC_EN_HIZ_SHIFT,4,2 ; @BQ24190_REG_ISC_EN_HIZ_SHIFT
l_.str.3:                               ; @.str.3
	.asciz	"Can't access ISC reg: %d\n"

l_.str.4:                               ; @.str.4
	.asciz	"ss_reg: 0x%02x, f_reg: 0x%02x\n"

	.no_dead_strip	_bq24190_check_status
.subsections_via_symbols
