	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bd70528_get_battery_health
_bd70528_get_battery_health:            ## @bd70528_get_battery_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	4(%rdi), %edi
	movq	_BD70528_REG_CHG_BAT_STAT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdx
	callq	_regmap_read
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	callq	_dev_err
	jmp	LBB0_10
LBB0_2:
	movl	-28(%rbp), %eax
	movq	_BD70528_MASK_CHG_BAT_DETECT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_3
## %bb.4:
	movq	_BD70528_MASK_CHG_BAT_OVERVOLT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.5:
	movq	_POWER_SUPPLY_HEALTH_OVERVOLTAGE@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_3:
	movq	_POWER_SUPPLY_HEALTH_DEAD@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_6:
	movq	_BD70528_MASK_CHG_BAT_TIMER@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.7:
	movq	_POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_8:
	movq	_POWER_SUPPLY_HEALTH_GOOD@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %eax
	movl	%eax, (%r14)
LBB0_10:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BD70528_REG_CHG_BAT_STAT,4,2   ## @BD70528_REG_CHG_BAT_STAT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Battery state read failure %d\n"

	.comm	_BD70528_MASK_CHG_BAT_DETECT,4,2 ## @BD70528_MASK_CHG_BAT_DETECT
	.comm	_POWER_SUPPLY_HEALTH_DEAD,4,2   ## @POWER_SUPPLY_HEALTH_DEAD
	.comm	_BD70528_MASK_CHG_BAT_OVERVOLT,4,2 ## @BD70528_MASK_CHG_BAT_OVERVOLT
	.comm	_POWER_SUPPLY_HEALTH_OVERVOLTAGE,4,2 ## @POWER_SUPPLY_HEALTH_OVERVOLTAGE
	.comm	_BD70528_MASK_CHG_BAT_TIMER,4,2 ## @BD70528_MASK_CHG_BAT_TIMER
	.comm	_POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE,4,2 ## @POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE
	.comm	_POWER_SUPPLY_HEALTH_GOOD,4,2   ## @POWER_SUPPLY_HEALTH_GOOD
	.no_dead_strip	_bd70528_get_battery_health
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bd70528_get_battery_health
_bd70528_get_battery_health:            ; @bd70528_get_battery_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	x20, x1
	mov	x21, x0
	ldr	w0, [x0, #4]
Lloh0:
	adrp	x8, _BD70528_REG_CHG_BAT_STAT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BD70528_REG_CHG_BAT_STAT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_regmap_read
	mov	x19, x0
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w0, [x21]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_dev_err
	b	LBB0_10
LBB0_2:
	ldr	w8, [sp, #12]
Lloh5:
	adrp	x9, _BD70528_MASK_CHG_BAT_DETECT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _BD70528_MASK_CHG_BAT_DETECT@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.3:
Lloh8:
	adrp	x9, _BD70528_MASK_CHG_BAT_OVERVOLT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _BD70528_MASK_CHG_BAT_OVERVOLT@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.4:
Lloh11:
	adrp	x8, _POWER_SUPPLY_HEALTH_OVERVOLTAGE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _POWER_SUPPLY_HEALTH_OVERVOLTAGE@GOTPAGEOFF]
	b	LBB0_9
LBB0_5:
Lloh13:
	adrp	x8, _POWER_SUPPLY_HEALTH_DEAD@GOTPAGE
Lloh14:
	ldr	x8, [x8, _POWER_SUPPLY_HEALTH_DEAD@GOTPAGEOFF]
	b	LBB0_9
LBB0_6:
Lloh15:
	adrp	x9, _BD70528_MASK_CHG_BAT_TIMER@GOTPAGE
Lloh16:
	ldr	x9, [x9, _BD70528_MASK_CHG_BAT_TIMER@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.7:
Lloh18:
	adrp	x8, _POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh20:
	adrp	x8, _POWER_SUPPLY_HEALTH_GOOD@GOTPAGE
Lloh21:
	ldr	x8, [x8, _POWER_SUPPLY_HEALTH_GOOD@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	str	w8, [x20]
LBB0_10:
	mov	x0, x19
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_BD70528_REG_CHG_BAT_STAT,4,2   ; @BD70528_REG_CHG_BAT_STAT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Battery state read failure %d\n"

	.comm	_BD70528_MASK_CHG_BAT_DETECT,4,2 ; @BD70528_MASK_CHG_BAT_DETECT
	.comm	_POWER_SUPPLY_HEALTH_DEAD,4,2   ; @POWER_SUPPLY_HEALTH_DEAD
	.comm	_BD70528_MASK_CHG_BAT_OVERVOLT,4,2 ; @BD70528_MASK_CHG_BAT_OVERVOLT
	.comm	_POWER_SUPPLY_HEALTH_OVERVOLTAGE,4,2 ; @POWER_SUPPLY_HEALTH_OVERVOLTAGE
	.comm	_BD70528_MASK_CHG_BAT_TIMER,4,2 ; @BD70528_MASK_CHG_BAT_TIMER
	.comm	_POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE,4,2 ; @POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE
	.comm	_POWER_SUPPLY_HEALTH_GOOD,4,2   ; @POWER_SUPPLY_HEALTH_GOOD
	.no_dead_strip	_bd70528_get_battery_health
.subsections_via_symbols
