	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smb347_get_charging_status
_smb347_get_charging_status:            ## @smb347_get_charging_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	callq	_smb347_is_ps_online
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	(%rbx), %edi
	movq	_STAT_C@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-12(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	js	LBB0_11
## %bb.3:
	movl	-12(%rbp), %edx
	movq	_STAT_C_CHARGER_ERROR@GOTPCREL(%rip), %rcx
	movq	_POWER_SUPPLY_STATUS_NOT_CHARGING@GOTPCREL(%rip), %rax
	testl	%edx, (%rcx)
	jne	LBB0_10
## %bb.4:
	movq	_STAT_C_HOLDOFF_STAT@GOTPCREL(%rip), %rcx
	testl	%edx, (%rcx)
	jne	LBB0_10
## %bb.5:
	movq	_STAT_C_CHG_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%edx, %eax
	movq	_STAT_C_CHG_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shrl	%cl, %eax
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movq	_POWER_SUPPLY_STATUS_CHARGING@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_1:
	movq	_POWER_SUPPLY_STATUS_DISCHARGING@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_7:
	movq	_STAT_C_CHG_TERM@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	jne	LBB0_8
## %bb.9:
	movq	_POWER_SUPPLY_STATUS_NOT_CHARGING@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_8:
	movq	_POWER_SUPPLY_STATUS_FULL@GOTPCREL(%rip), %rax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_POWER_SUPPLY_STATUS_DISCHARGING,4,2 ## @POWER_SUPPLY_STATUS_DISCHARGING
	.comm	_STAT_C,4,2                     ## @STAT_C
	.comm	_STAT_C_CHARGER_ERROR,4,2       ## @STAT_C_CHARGER_ERROR
	.comm	_STAT_C_HOLDOFF_STAT,4,2        ## @STAT_C_HOLDOFF_STAT
	.comm	_POWER_SUPPLY_STATUS_NOT_CHARGING,4,2 ## @POWER_SUPPLY_STATUS_NOT_CHARGING
	.comm	_STAT_C_CHG_MASK,4,2            ## @STAT_C_CHG_MASK
	.comm	_STAT_C_CHG_SHIFT,4,2           ## @STAT_C_CHG_SHIFT
	.comm	_POWER_SUPPLY_STATUS_CHARGING,4,2 ## @POWER_SUPPLY_STATUS_CHARGING
	.comm	_STAT_C_CHG_TERM,4,2            ## @STAT_C_CHG_TERM
	.comm	_POWER_SUPPLY_STATUS_FULL,4,2   ## @POWER_SUPPLY_STATUS_FULL
	.no_dead_strip	_smb347_get_charging_status
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smb347_get_charging_status
_smb347_get_charging_status:            ; @smb347_get_charging_status
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	bl	_smb347_is_ps_online
	cbz	w0, LBB0_4
; %bb.1:
	ldr	w0, [x19]
Lloh0:
	adrp	x8, _STAT_C@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STAT_C@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_regmap_read
	tbnz	w0, #31, LBB0_6
; %bb.2:
	ldr	w9, [sp, #12]
Lloh3:
	adrp	x8, _STAT_C_CHARGER_ERROR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _STAT_C_CHARGER_ERROR@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w9
	b.eq	LBB0_7
; %bb.3:
Lloh6:
	adrp	x8, _POWER_SUPPLY_STATUS_NOT_CHARGING@GOTPAGE
Lloh7:
	ldr	x8, [x8, _POWER_SUPPLY_STATUS_NOT_CHARGING@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
Lloh8:
	adrp	x8, _POWER_SUPPLY_STATUS_DISCHARGING@GOTPAGE
Lloh9:
	ldr	x8, [x8, _POWER_SUPPLY_STATUS_DISCHARGING@GOTPAGEOFF]
LBB0_5:
	ldr	w0, [x8]
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_7:
Lloh10:
	adrp	x8, _STAT_C_HOLDOFF_STAT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _STAT_C_HOLDOFF_STAT@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x8]
Lloh13:
	adrp	x8, _POWER_SUPPLY_STATUS_NOT_CHARGING@GOTPAGE
Lloh14:
	ldr	x8, [x8, _POWER_SUPPLY_STATUS_NOT_CHARGING@GOTPAGEOFF]
	tst	w10, w9
	b.ne	LBB0_5
; %bb.8:
Lloh15:
	adrp	x10, _STAT_C_CHG_MASK@GOTPAGE
Lloh16:
	ldr	x10, [x10, _STAT_C_CHG_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
	and	w10, w10, w9
Lloh18:
	adrp	x11, _STAT_C_CHG_SHIFT@GOTPAGE
Lloh19:
	ldr	x11, [x11, _STAT_C_CHG_SHIFT@GOTPAGEOFF]
Lloh20:
	ldr	w11, [x11]
	lsr	w10, w10, w11
	cbz	w10, LBB0_10
; %bb.9:
Lloh21:
	adrp	x8, _POWER_SUPPLY_STATUS_CHARGING@GOTPAGE
Lloh22:
	ldr	x8, [x8, _POWER_SUPPLY_STATUS_CHARGING@GOTPAGEOFF]
	b	LBB0_5
LBB0_10:
Lloh23:
	adrp	x10, _STAT_C_CHG_TERM@GOTPAGE
Lloh24:
	ldr	x10, [x10, _STAT_C_CHG_TERM@GOTPAGEOFF]
Lloh25:
	ldr	w10, [x10]
Lloh26:
	adrp	x11, _POWER_SUPPLY_STATUS_FULL@GOTPAGE
Lloh27:
	ldr	x11, [x11, _POWER_SUPPLY_STATUS_FULL@GOTPAGEOFF]
	tst	w10, w9
	csel	x8, x8, x11, eq
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_POWER_SUPPLY_STATUS_DISCHARGING,4,2 ; @POWER_SUPPLY_STATUS_DISCHARGING
	.comm	_STAT_C,4,2                     ; @STAT_C
	.comm	_STAT_C_CHARGER_ERROR,4,2       ; @STAT_C_CHARGER_ERROR
	.comm	_STAT_C_HOLDOFF_STAT,4,2        ; @STAT_C_HOLDOFF_STAT
	.comm	_POWER_SUPPLY_STATUS_NOT_CHARGING,4,2 ; @POWER_SUPPLY_STATUS_NOT_CHARGING
	.comm	_STAT_C_CHG_MASK,4,2            ; @STAT_C_CHG_MASK
	.comm	_STAT_C_CHG_SHIFT,4,2           ; @STAT_C_CHG_SHIFT
	.comm	_POWER_SUPPLY_STATUS_CHARGING,4,2 ; @POWER_SUPPLY_STATUS_CHARGING
	.comm	_STAT_C_CHG_TERM,4,2            ; @STAT_C_CHG_TERM
	.comm	_POWER_SUPPLY_STATUS_FULL,4,2   ; @POWER_SUPPLY_STATUS_FULL
	.no_dead_strip	_smb347_get_charging_status
.subsections_via_symbols
