	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ucs1002_get_health
_ucs1002_get_health:                    ## @ucs1002_get_health
	.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	%rsi, %rbx
	movl	(%rdi), %edi
	movq	_UCS1002_REG_INTERRUPT_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-12(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	jne	LBB0_11
## %bb.1:
	movl	-12(%rbp), %ecx
	movq	_F_TSD@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_3
## %bb.2:
	movq	_POWER_SUPPLY_HEALTH_OVERHEAT@GOTPCREL(%rip), %rcx
	jmp	LBB0_10
LBB0_3:
	movq	_F_OVER_VOLT@GOTPCREL(%rip), %rdx
	movq	_F_BACK_VOLT@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	orl	(%rdx), %esi
	testl	%ecx, %esi
	je	LBB0_5
## %bb.4:
	movq	_POWER_SUPPLY_HEALTH_OVERVOLTAGE@GOTPCREL(%rip), %rcx
	jmp	LBB0_10
LBB0_5:
	movq	_F_OVER_ILIM@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_7
## %bb.6:
	movq	_POWER_SUPPLY_HEALTH_OVERCURRENT@GOTPCREL(%rip), %rcx
	jmp	LBB0_10
LBB0_7:
	movq	_F_DISCHARGE_ERR@GOTPCREL(%rip), %rdx
	movq	_F_MIN_KEEP_OUT@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	orl	(%rdx), %esi
	testl	%ecx, %esi
	jne	LBB0_8
## %bb.9:
	movq	_POWER_SUPPLY_HEALTH_GOOD@GOTPCREL(%rip), %rcx
	jmp	LBB0_10
LBB0_8:
	movq	_POWER_SUPPLY_HEALTH_UNSPEC_FAILURE@GOTPCREL(%rip), %rcx
LBB0_10:
	movl	(%rcx), %ecx
	movl	%ecx, (%rbx)
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_UCS1002_REG_INTERRUPT_STATUS,4,2 ## @UCS1002_REG_INTERRUPT_STATUS
	.comm	_F_TSD,4,2                      ## @F_TSD
	.comm	_POWER_SUPPLY_HEALTH_OVERHEAT,4,2 ## @POWER_SUPPLY_HEALTH_OVERHEAT
	.comm	_F_OVER_VOLT,4,2                ## @F_OVER_VOLT
	.comm	_F_BACK_VOLT,4,2                ## @F_BACK_VOLT
	.comm	_POWER_SUPPLY_HEALTH_OVERVOLTAGE,4,2 ## @POWER_SUPPLY_HEALTH_OVERVOLTAGE
	.comm	_F_OVER_ILIM,4,2                ## @F_OVER_ILIM
	.comm	_POWER_SUPPLY_HEALTH_OVERCURRENT,4,2 ## @POWER_SUPPLY_HEALTH_OVERCURRENT
	.comm	_F_DISCHARGE_ERR,4,2            ## @F_DISCHARGE_ERR
	.comm	_F_MIN_KEEP_OUT,4,2             ## @F_MIN_KEEP_OUT
	.comm	_POWER_SUPPLY_HEALTH_UNSPEC_FAILURE,4,2 ## @POWER_SUPPLY_HEALTH_UNSPEC_FAILURE
	.comm	_POWER_SUPPLY_HEALTH_GOOD,4,2   ## @POWER_SUPPLY_HEALTH_GOOD
	.no_dead_strip	_ucs1002_get_health
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ucs1002_get_health
_ucs1002_get_health:                    ; @ucs1002_get_health
	.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, x1
	ldr	w0, [x0]
Lloh0:
	adrp	x8, _UCS1002_REG_INTERRUPT_STATUS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _UCS1002_REG_INTERRUPT_STATUS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_regmap_read
	cbnz	w0, LBB0_9
; %bb.1:
	ldr	w8, [sp, #12]
Lloh3:
	adrp	x9, _F_TSD@GOTPAGE
Lloh4:
	ldr	x9, [x9, _F_TSD@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
Lloh6:
	adrp	x8, _POWER_SUPPLY_HEALTH_OVERHEAT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _POWER_SUPPLY_HEALTH_OVERHEAT@GOTPAGEOFF]
	b	LBB0_8
LBB0_3:
Lloh8:
	adrp	x9, _F_OVER_VOLT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _F_OVER_VOLT@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
Lloh11:
	adrp	x10, _F_BACK_VOLT@GOTPAGE
Lloh12:
	ldr	x10, [x10, _F_BACK_VOLT@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
Lloh14:
	adrp	x8, _POWER_SUPPLY_HEALTH_OVERVOLTAGE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _POWER_SUPPLY_HEALTH_OVERVOLTAGE@GOTPAGEOFF]
	b	LBB0_8
LBB0_5:
Lloh16:
	adrp	x9, _F_OVER_ILIM@GOTPAGE
Lloh17:
	ldr	x9, [x9, _F_OVER_ILIM@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:
Lloh19:
	adrp	x8, _POWER_SUPPLY_HEALTH_OVERCURRENT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _POWER_SUPPLY_HEALTH_OVERCURRENT@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh21:
	adrp	x9, _F_DISCHARGE_ERR@GOTPAGE
Lloh22:
	ldr	x9, [x9, _F_DISCHARGE_ERR@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
Lloh24:
	adrp	x10, _F_MIN_KEEP_OUT@GOTPAGE
Lloh25:
	ldr	x10, [x10, _F_MIN_KEEP_OUT@GOTPAGEOFF]
Lloh26:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh27:
	adrp	x10, _POWER_SUPPLY_HEALTH_UNSPEC_FAILURE@GOTPAGE
Lloh28:
	ldr	x10, [x10, _POWER_SUPPLY_HEALTH_UNSPEC_FAILURE@GOTPAGEOFF]
Lloh29:
	adrp	x11, _POWER_SUPPLY_HEALTH_GOOD@GOTPAGE
Lloh30:
	ldr	x11, [x11, _POWER_SUPPLY_HEALTH_GOOD@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x11, x10, eq
LBB0_8:
	ldr	w8, [x8]
	str	w8, [x19]
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_UCS1002_REG_INTERRUPT_STATUS,4,2 ; @UCS1002_REG_INTERRUPT_STATUS
	.comm	_F_TSD,4,2                      ; @F_TSD
	.comm	_POWER_SUPPLY_HEALTH_OVERHEAT,4,2 ; @POWER_SUPPLY_HEALTH_OVERHEAT
	.comm	_F_OVER_VOLT,4,2                ; @F_OVER_VOLT
	.comm	_F_BACK_VOLT,4,2                ; @F_BACK_VOLT
	.comm	_POWER_SUPPLY_HEALTH_OVERVOLTAGE,4,2 ; @POWER_SUPPLY_HEALTH_OVERVOLTAGE
	.comm	_F_OVER_ILIM,4,2                ; @F_OVER_ILIM
	.comm	_POWER_SUPPLY_HEALTH_OVERCURRENT,4,2 ; @POWER_SUPPLY_HEALTH_OVERCURRENT
	.comm	_F_DISCHARGE_ERR,4,2            ; @F_DISCHARGE_ERR
	.comm	_F_MIN_KEEP_OUT,4,2             ; @F_MIN_KEEP_OUT
	.comm	_POWER_SUPPLY_HEALTH_UNSPEC_FAILURE,4,2 ; @POWER_SUPPLY_HEALTH_UNSPEC_FAILURE
	.comm	_POWER_SUPPLY_HEALTH_GOOD,4,2   ; @POWER_SUPPLY_HEALTH_GOOD
	.no_dead_strip	_ucs1002_get_health
.subsections_via_symbols
