	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bq24190_battery_get_status
_bq24190_battery_get_status:            ## @bq24190_battery_get_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r12
	leaq	4(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movl	(%r12), %r13d
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movq	_BQ24190_REG_F_CHRG_FAULT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_BQ24190_REG_F_CHRG_FAULT_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_BQ24190_REG_SS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	movq	%r12, %rdi
	callq	_bq24190_read
	testl	%eax, %eax
	js	LBB0_12
## %bb.1:
	andl	%r13d, %ebx
	movl	%r15d, %ecx
	sarl	%cl, %ebx
	movl	-44(%rbp), %edx
	movq	_BQ24190_REG_SS_PG_STAT_MASK@GOTPCREL(%rip), %rcx
	testl	%edx, (%rcx)
	je	LBB0_7
## %bb.2:
	testl	%ebx, %ebx
	jne	LBB0_7
## %bb.3:
	movq	_BQ24190_REG_SS_CHRG_STAT_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %edx
	movq	_BQ24190_REG_SS_CHRG_STAT_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %edx
	leal	-1(%rdx), %ecx
	cmpl	$2, %ecx
	jb	LBB0_8
## %bb.4:
	cmpl	$3, %edx
	je	LBB0_9
## %bb.5:
	testl	%edx, %edx
	jne	LBB0_13
## %bb.6:
	movq	_POWER_SUPPLY_STATUS_NOT_CHARGING@GOTPCREL(%rip), %rcx
	jmp	LBB0_10
LBB0_7:
	movq	_POWER_SUPPLY_STATUS_DISCHARGING@GOTPCREL(%rip), %rcx
	jmp	LBB0_10
LBB0_8:
	movq	_POWER_SUPPLY_STATUS_CHARGING@GOTPCREL(%rip), %rcx
	jmp	LBB0_10
LBB0_9:
	movq	_POWER_SUPPLY_STATUS_FULL@GOTPCREL(%rip), %rcx
LBB0_10:
	movl	(%rcx), %ecx
	testl	%eax, %eax
	jne	LBB0_12
LBB0_11:
	movl	%ecx, (%r14)
	xorl	%eax, %eax
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
                                        ## implicit-def: $ecx
	testl	%eax, %eax
	jne	LBB0_12
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_BQ24190_REG_F_CHRG_FAULT_MASK,4,2 ## @BQ24190_REG_F_CHRG_FAULT_MASK
	.comm	_BQ24190_REG_F_CHRG_FAULT_SHIFT,4,2 ## @BQ24190_REG_F_CHRG_FAULT_SHIFT
	.comm	_BQ24190_REG_SS,4,2             ## @BQ24190_REG_SS
	.comm	_BQ24190_REG_SS_PG_STAT_MASK,4,2 ## @BQ24190_REG_SS_PG_STAT_MASK
	.comm	_POWER_SUPPLY_STATUS_DISCHARGING,4,2 ## @POWER_SUPPLY_STATUS_DISCHARGING
	.comm	_BQ24190_REG_SS_CHRG_STAT_MASK,4,2 ## @BQ24190_REG_SS_CHRG_STAT_MASK
	.comm	_BQ24190_REG_SS_CHRG_STAT_SHIFT,4,2 ## @BQ24190_REG_SS_CHRG_STAT_SHIFT
	.comm	_POWER_SUPPLY_STATUS_NOT_CHARGING,4,2 ## @POWER_SUPPLY_STATUS_NOT_CHARGING
	.comm	_POWER_SUPPLY_STATUS_CHARGING,4,2 ## @POWER_SUPPLY_STATUS_CHARGING
	.comm	_POWER_SUPPLY_STATUS_FULL,4,2   ## @POWER_SUPPLY_STATUS_FULL
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_bq24190_battery_get_status
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bq24190_battery_get_status
_bq24190_battery_get_status:            ; @bq24190_battery_get_status
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x1
	mov	x20, x0
	add	x21, x0, #4
	mov	x0, x21
	bl	_mutex_lock
	ldr	w22, [x20]
	mov	x0, x21
	bl	_mutex_unlock
Lloh0:
	adrp	x8, _BQ24190_REG_F_CHRG_FAULT_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BQ24190_REG_F_CHRG_FAULT_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
Lloh3:
	adrp	x8, _BQ24190_REG_F_CHRG_FAULT_SHIFT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BQ24190_REG_F_CHRG_FAULT_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w23, [x8]
Lloh6:
	adrp	x8, _BQ24190_REG_SS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BQ24190_REG_SS@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x20
	bl	_bq24190_read
	tbnz	w0, #31, LBB0_11
; %bb.1:
	and	w8, w21, w22
	asr	w9, w8, w23
	ldr	w8, [sp, #12]
Lloh9:
	adrp	x10, _BQ24190_REG_SS_PG_STAT_MASK@GOTPAGE
Lloh10:
	ldr	x10, [x10, _BQ24190_REG_SS_PG_STAT_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	and	w10, w10, w8
	cmp	w10, #0
	ccmp	w9, #0, #0, ne
	b.eq	LBB0_3
; %bb.2:
Lloh12:
	adrp	x8, _POWER_SUPPLY_STATUS_DISCHARGING@GOTPAGE
Lloh13:
	ldr	x8, [x8, _POWER_SUPPLY_STATUS_DISCHARGING@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cbnz	w0, LBB0_11
	b	LBB0_10
LBB0_3:
Lloh15:
	adrp	x9, _BQ24190_REG_SS_CHRG_STAT_MASK@GOTPAGE
Lloh16:
	ldr	x9, [x9, _BQ24190_REG_SS_CHRG_STAT_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh18:
	adrp	x9, _BQ24190_REG_SS_CHRG_STAT_SHIFT@GOTPAGE
Lloh19:
	ldr	x9, [x9, _BQ24190_REG_SS_CHRG_STAT_SHIFT@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	asr	w8, w8, w9
	sub	w9, w8, #1
	cmp	w9, #2
	b.lo	LBB0_7
; %bb.4:
	cmp	w8, #3
	b.eq	LBB0_8
; %bb.5:
	cbnz	w8, LBB0_9
; %bb.6:
Lloh21:
	adrp	x8, _POWER_SUPPLY_STATUS_NOT_CHARGING@GOTPAGE
Lloh22:
	ldr	x8, [x8, _POWER_SUPPLY_STATUS_NOT_CHARGING@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	cbnz	w0, LBB0_11
	b	LBB0_10
LBB0_7:
Lloh24:
	adrp	x8, _POWER_SUPPLY_STATUS_CHARGING@GOTPAGE
Lloh25:
	ldr	x8, [x8, _POWER_SUPPLY_STATUS_CHARGING@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	cbnz	w0, LBB0_11
	b	LBB0_10
LBB0_8:
Lloh27:
	adrp	x8, _POWER_SUPPLY_STATUS_FULL@GOTPAGE
Lloh28:
	ldr	x8, [x8, _POWER_SUPPLY_STATUS_FULL@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	cbnz	w0, LBB0_11
	b	LBB0_10
LBB0_9:
Lloh30:
	adrp	x8, _EIO@GOTPAGE
Lloh31:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	neg	w0, w8
                                        ; implicit-def: $w8
	cbnz	w0, LBB0_11
LBB0_10:
	str	w8, [x19]
LBB0_11:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_BQ24190_REG_F_CHRG_FAULT_MASK,4,2 ; @BQ24190_REG_F_CHRG_FAULT_MASK
	.comm	_BQ24190_REG_F_CHRG_FAULT_SHIFT,4,2 ; @BQ24190_REG_F_CHRG_FAULT_SHIFT
	.comm	_BQ24190_REG_SS,4,2             ; @BQ24190_REG_SS
	.comm	_BQ24190_REG_SS_PG_STAT_MASK,4,2 ; @BQ24190_REG_SS_PG_STAT_MASK
	.comm	_POWER_SUPPLY_STATUS_DISCHARGING,4,2 ; @POWER_SUPPLY_STATUS_DISCHARGING
	.comm	_BQ24190_REG_SS_CHRG_STAT_MASK,4,2 ; @BQ24190_REG_SS_CHRG_STAT_MASK
	.comm	_BQ24190_REG_SS_CHRG_STAT_SHIFT,4,2 ; @BQ24190_REG_SS_CHRG_STAT_SHIFT
	.comm	_POWER_SUPPLY_STATUS_NOT_CHARGING,4,2 ; @POWER_SUPPLY_STATUS_NOT_CHARGING
	.comm	_POWER_SUPPLY_STATUS_CHARGING,4,2 ; @POWER_SUPPLY_STATUS_CHARGING
	.comm	_POWER_SUPPLY_STATUS_FULL,4,2   ; @POWER_SUPPLY_STATUS_FULL
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_bq24190_battery_get_status
.subsections_via_symbols
