	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt9455_charger_get_health
_rt9455_charger_get_health:             ## @rt9455_charger_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	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	16(%rdi), %r14
	movq	_POWER_SUPPLY_HEALTH_GOOD@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rsi)
	movl	8(%rdi), %edi
	movq	_RT9455_REG_IRQ1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
LBB0_2:
	movq	%r14, %rdi
	callq	_dev_err
	jmp	LBB0_25
LBB0_3:
	movl	-36(%rbp), %ebx
	movq	_F_TSDI@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_GET_MASK
	testl	%ebx, %eax
	je	LBB0_6
## %bb.4:
	movq	_POWER_SUPPLY_HEALTH_OVERHEAT@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_6:
	movl	-36(%rbp), %ebx
	movq	_F_VINOVPI@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_GET_MASK
	testl	%ebx, %eax
	je	LBB0_8
LBB0_7:
	movq	_POWER_SUPPLY_HEALTH_OVERVOLTAGE@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_8:
	movl	-36(%rbp), %ebx
	movq	_F_BATAB@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_GET_MASK
	testl	%ebx, %eax
	je	LBB0_10
LBB0_9:
	movq	_POWER_SUPPLY_HEALTH_UNSPEC_FAILURE@GOTPCREL(%rip), %rax
LBB0_5:
	movq	(%rax), %rax
	movq	%rax, (%r15)
	xorl	%ebx, %ebx
LBB0_25:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	8(%r12), %edi
	movq	_RT9455_REG_IRQ2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_2
LBB0_12:
	movl	-36(%rbp), %ebx
	movq	_F_CHBATOVI@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_GET_MASK
	testl	%ebx, %eax
	jne	LBB0_9
## %bb.13:
	movl	-36(%rbp), %ebx
	movq	_F_CH32MI@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_GET_MASK
	testl	%ebx, %eax
	je	LBB0_15
LBB0_14:
	movq	_POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_15:
	movl	8(%r12), %edi
	movq	_RT9455_REG_IRQ3@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	je	LBB0_17
## %bb.16:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_2
LBB0_17:
	movl	-36(%rbp), %ebx
	movq	_F_BSTBUSOVI@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_GET_MASK
	testl	%ebx, %eax
	jne	LBB0_9
## %bb.18:
	movl	-36(%rbp), %ebx
	movq	_F_BSTOLI@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_GET_MASK
	testl	%ebx, %eax
	jne	LBB0_7
## %bb.19:
	movl	-36(%rbp), %ebx
	movq	_F_BSTLOWVI@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_GET_MASK
	testl	%ebx, %eax
	jne	LBB0_9
## %bb.20:
	movl	-36(%rbp), %ebx
	movq	_F_BST32SI@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_GET_MASK
	testl	%ebx, %eax
	jne	LBB0_14
## %bb.21:
	movq	(%r12), %rax
	movq	_F_STAT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %edi
	leaq	-36(%rbp), %rsi
	callq	_regmap_field_read
	testl	%eax, %eax
	je	LBB0_23
## %bb.22:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_2
LBB0_23:
	movl	-36(%rbp), %eax
	movq	_RT9455_FAULT@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpl	(%rcx), %eax
	jne	LBB0_25
## %bb.24:
	movq	_POWER_SUPPLY_HEALTH_UNSPEC_FAILURE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r15)
	jmp	LBB0_25
	.cfi_endproc
                                        ## -- End function
	.comm	_POWER_SUPPLY_HEALTH_GOOD,8,3   ## @POWER_SUPPLY_HEALTH_GOOD
	.comm	_RT9455_REG_IRQ1,4,2            ## @RT9455_REG_IRQ1
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to read IRQ1 register\n"

	.comm	_F_TSDI,4,2                     ## @F_TSDI
	.comm	_POWER_SUPPLY_HEALTH_OVERHEAT,8,3 ## @POWER_SUPPLY_HEALTH_OVERHEAT
	.comm	_F_VINOVPI,4,2                  ## @F_VINOVPI
	.comm	_POWER_SUPPLY_HEALTH_OVERVOLTAGE,8,3 ## @POWER_SUPPLY_HEALTH_OVERVOLTAGE
	.comm	_F_BATAB,4,2                    ## @F_BATAB
	.comm	_POWER_SUPPLY_HEALTH_UNSPEC_FAILURE,8,3 ## @POWER_SUPPLY_HEALTH_UNSPEC_FAILURE
	.comm	_RT9455_REG_IRQ2,4,2            ## @RT9455_REG_IRQ2
L_.str.1:                               ## @.str.1
	.asciz	"Failed to read IRQ2 register\n"

	.comm	_F_CHBATOVI,4,2                 ## @F_CHBATOVI
	.comm	_F_CH32MI,4,2                   ## @F_CH32MI
	.comm	_POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE,8,3 ## @POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE
	.comm	_RT9455_REG_IRQ3,4,2            ## @RT9455_REG_IRQ3
L_.str.2:                               ## @.str.2
	.asciz	"Failed to read IRQ3 register\n"

	.comm	_F_BSTBUSOVI,4,2                ## @F_BSTBUSOVI
	.comm	_F_BSTOLI,4,2                   ## @F_BSTOLI
	.comm	_F_BSTLOWVI,4,2                 ## @F_BSTLOWVI
	.comm	_F_BST32SI,4,2                  ## @F_BST32SI
	.comm	_F_STAT,8,3                     ## @F_STAT
L_.str.3:                               ## @.str.3
	.asciz	"Failed to read STAT bits\n"

	.comm	_RT9455_FAULT,4,2               ## @RT9455_FAULT
	.no_dead_strip	_rt9455_charger_get_health
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt9455_charger_get_health
_rt9455_charger_get_health:             ; @rt9455_charger_get_health
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x1
	mov	x21, x0
	ldr	x20, [x0, #16]
Lloh0:
	adrp	x8, _POWER_SUPPLY_HEALTH_GOOD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _POWER_SUPPLY_HEALTH_GOOD@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [x1]
	ldr	w0, [x0, #8]
Lloh3:
	adrp	x8, _RT9455_REG_IRQ1@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RT9455_REG_IRQ1@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_regmap_read
	cbz	w0, LBB0_3
; %bb.1:
	mov	x22, x0
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
LBB0_2:
	mov	x0, x20
	bl	_dev_err
	b	LBB0_10
LBB0_3:
	ldr	w22, [sp, #12]
Lloh8:
	adrp	x8, _F_TSDI@GOTPAGE
Lloh9:
	ldr	x8, [x8, _F_TSDI@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_GET_MASK
	tst	w0, w22
	b.eq	LBB0_5
; %bb.4:
	mov	w22, #0
Lloh11:
	adrp	x8, _POWER_SUPPLY_HEALTH_OVERHEAT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _POWER_SUPPLY_HEALTH_OVERHEAT@GOTPAGEOFF]
	b	LBB0_9
LBB0_5:
	ldr	w22, [sp, #12]
Lloh13:
	adrp	x8, _F_VINOVPI@GOTPAGE
Lloh14:
	ldr	x8, [x8, _F_VINOVPI@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	bl	_GET_MASK
	tst	w0, w22
	b.eq	LBB0_7
LBB0_6:
	mov	w22, #0
Lloh16:
	adrp	x8, _POWER_SUPPLY_HEALTH_OVERVOLTAGE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _POWER_SUPPLY_HEALTH_OVERVOLTAGE@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:
	ldr	w22, [sp, #12]
Lloh18:
	adrp	x8, _F_BATAB@GOTPAGE
Lloh19:
	ldr	x8, [x8, _F_BATAB@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	bl	_GET_MASK
	tst	w0, w22
	b.eq	LBB0_11
LBB0_8:
	mov	w22, #0
Lloh21:
	adrp	x8, _POWER_SUPPLY_HEALTH_UNSPEC_FAILURE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _POWER_SUPPLY_HEALTH_UNSPEC_FAILURE@GOTPAGEOFF]
LBB0_9:
	ldr	x8, [x8]
	str	x8, [x19]
LBB0_10:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_11:
	ldr	w0, [x21, #8]
Lloh23:
	adrp	x8, _RT9455_REG_IRQ2@GOTPAGE
Lloh24:
	ldr	x8, [x8, _RT9455_REG_IRQ2@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_regmap_read
	cbz	w0, LBB0_13
; %bb.12:
	mov	x22, x0
Lloh26:
	adrp	x1, l_.str.1@PAGE
Lloh27:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_2
LBB0_13:
	ldr	w22, [sp, #12]
Lloh28:
	adrp	x8, _F_CHBATOVI@GOTPAGE
Lloh29:
	ldr	x8, [x8, _F_CHBATOVI@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
	bl	_GET_MASK
	tst	w0, w22
	b.ne	LBB0_8
; %bb.14:
	ldr	w22, [sp, #12]
Lloh31:
	adrp	x8, _F_CH32MI@GOTPAGE
Lloh32:
	ldr	x8, [x8, _F_CH32MI@GOTPAGEOFF]
Lloh33:
	ldr	w0, [x8]
	bl	_GET_MASK
	tst	w0, w22
	b.eq	LBB0_16
LBB0_15:
	mov	w22, #0
Lloh34:
	adrp	x8, _POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE@GOTPAGE
Lloh35:
	ldr	x8, [x8, _POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE@GOTPAGEOFF]
	b	LBB0_9
LBB0_16:
	ldr	w0, [x21, #8]
Lloh36:
	adrp	x8, _RT9455_REG_IRQ3@GOTPAGE
Lloh37:
	ldr	x8, [x8, _RT9455_REG_IRQ3@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_regmap_read
	cbz	w0, LBB0_18
; %bb.17:
	mov	x22, x0
Lloh39:
	adrp	x1, l_.str.2@PAGE
Lloh40:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_2
LBB0_18:
	ldr	w22, [sp, #12]
Lloh41:
	adrp	x8, _F_BSTBUSOVI@GOTPAGE
Lloh42:
	ldr	x8, [x8, _F_BSTBUSOVI@GOTPAGEOFF]
Lloh43:
	ldr	w0, [x8]
	bl	_GET_MASK
	tst	w0, w22
	b.ne	LBB0_8
; %bb.19:
	ldr	w22, [sp, #12]
Lloh44:
	adrp	x8, _F_BSTOLI@GOTPAGE
Lloh45:
	ldr	x8, [x8, _F_BSTOLI@GOTPAGEOFF]
Lloh46:
	ldr	w0, [x8]
	bl	_GET_MASK
	tst	w0, w22
	b.ne	LBB0_6
; %bb.20:
	ldr	w22, [sp, #12]
Lloh47:
	adrp	x8, _F_BSTLOWVI@GOTPAGE
Lloh48:
	ldr	x8, [x8, _F_BSTLOWVI@GOTPAGEOFF]
Lloh49:
	ldr	w0, [x8]
	bl	_GET_MASK
	tst	w0, w22
	b.ne	LBB0_8
; %bb.21:
	ldr	w22, [sp, #12]
Lloh50:
	adrp	x8, _F_BST32SI@GOTPAGE
Lloh51:
	ldr	x8, [x8, _F_BST32SI@GOTPAGEOFF]
Lloh52:
	ldr	w0, [x8]
	bl	_GET_MASK
	tst	w0, w22
	b.ne	LBB0_15
; %bb.22:
	ldr	x8, [x21]
Lloh53:
	adrp	x9, _F_STAT@GOTPAGE
Lloh54:
	ldr	x9, [x9, _F_STAT@GOTPAGEOFF]
Lloh55:
	ldr	x9, [x9]
	ldr	w0, [x8, x9, lsl #2]
	add	x1, sp, #12
	bl	_regmap_field_read
	cbz	w0, LBB0_24
; %bb.23:
	mov	x22, x0
Lloh56:
	adrp	x1, l_.str.3@PAGE
Lloh57:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_2
LBB0_24:
	ldr	w8, [sp, #12]
Lloh58:
	adrp	x9, _RT9455_FAULT@GOTPAGE
Lloh59:
	ldr	x9, [x9, _RT9455_FAULT@GOTPAGEOFF]
Lloh60:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_8
; %bb.25:
	mov	w22, #0
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.loh AdrpAdd	Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh58, Lloh59, Lloh60
	.cfi_endproc
                                        ; -- End function
	.comm	_POWER_SUPPLY_HEALTH_GOOD,8,3   ; @POWER_SUPPLY_HEALTH_GOOD
	.comm	_RT9455_REG_IRQ1,4,2            ; @RT9455_REG_IRQ1
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to read IRQ1 register\n"

	.comm	_F_TSDI,4,2                     ; @F_TSDI
	.comm	_POWER_SUPPLY_HEALTH_OVERHEAT,8,3 ; @POWER_SUPPLY_HEALTH_OVERHEAT
	.comm	_F_VINOVPI,4,2                  ; @F_VINOVPI
	.comm	_POWER_SUPPLY_HEALTH_OVERVOLTAGE,8,3 ; @POWER_SUPPLY_HEALTH_OVERVOLTAGE
	.comm	_F_BATAB,4,2                    ; @F_BATAB
	.comm	_POWER_SUPPLY_HEALTH_UNSPEC_FAILURE,8,3 ; @POWER_SUPPLY_HEALTH_UNSPEC_FAILURE
	.comm	_RT9455_REG_IRQ2,4,2            ; @RT9455_REG_IRQ2
l_.str.1:                               ; @.str.1
	.asciz	"Failed to read IRQ2 register\n"

	.comm	_F_CHBATOVI,4,2                 ; @F_CHBATOVI
	.comm	_F_CH32MI,4,2                   ; @F_CH32MI
	.comm	_POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE,8,3 ; @POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE
	.comm	_RT9455_REG_IRQ3,4,2            ; @RT9455_REG_IRQ3
l_.str.2:                               ; @.str.2
	.asciz	"Failed to read IRQ3 register\n"

	.comm	_F_BSTBUSOVI,4,2                ; @F_BSTBUSOVI
	.comm	_F_BSTOLI,4,2                   ; @F_BSTOLI
	.comm	_F_BSTLOWVI,4,2                 ; @F_BSTLOWVI
	.comm	_F_BST32SI,4,2                  ; @F_BST32SI
	.comm	_F_STAT,8,3                     ; @F_STAT
l_.str.3:                               ; @.str.3
	.asciz	"Failed to read STAT bits\n"

	.comm	_RT9455_FAULT,4,2               ; @RT9455_FAULT
	.no_dead_strip	_rt9455_charger_get_health
.subsections_via_symbols
