	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bd70528_get_charge_type
_bd70528_get_charge_type:               ## @bd70528_get_charge_type
	.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_CURR_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:
	movq	_BD70528_MASK_CHG_STAT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	-28(%rbp), %eax
	addl	$-128, %eax
	cmpl	$11, %eax
	ja	LBB0_8
## %bb.3:
	movl	$3559, %ecx                     ## imm = 0xDE7
	btl	%eax, %ecx
	jae	LBB0_4
## %bb.7:
	movq	_POWER_SUPPLY_CHARGE_TYPE_NONE@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
LBB0_4:
	movl	$528, %ecx                      ## imm = 0x210
	btl	%eax, %ecx
	jae	LBB0_5
## %bb.6:
	movq	_POWER_SUPPLY_CHARGE_TYPE_FAST@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_8:
	movq	_POWER_SUPPLY_CHARGE_TYPE_UNKNOWN@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_5:
	movq	_POWER_SUPPLY_CHARGE_TYPE_TRICKLE@GOTPCREL(%rip), %rax
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_BD70528_REG_CHG_CURR_STAT,4,2  ## @BD70528_REG_CHG_CURR_STAT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Charger state read failure %d\n"

	.comm	_BD70528_MASK_CHG_STAT,4,2      ## @BD70528_MASK_CHG_STAT
	.comm	_POWER_SUPPLY_CHARGE_TYPE_TRICKLE,4,2 ## @POWER_SUPPLY_CHARGE_TYPE_TRICKLE
	.comm	_POWER_SUPPLY_CHARGE_TYPE_FAST,4,2 ## @POWER_SUPPLY_CHARGE_TYPE_FAST
	.comm	_POWER_SUPPLY_CHARGE_TYPE_NONE,4,2 ## @POWER_SUPPLY_CHARGE_TYPE_NONE
	.comm	_POWER_SUPPLY_CHARGE_TYPE_UNKNOWN,4,2 ## @POWER_SUPPLY_CHARGE_TYPE_UNKNOWN
	.no_dead_strip	_bd70528_get_charge_type
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bd70528_get_charge_type
_bd70528_get_charge_type:               ; @bd70528_get_charge_type
	.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_CURR_STAT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BD70528_REG_CHG_CURR_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_6
LBB0_2:
	ldr	w8, [sp, #12]
Lloh5:
	adrp	x9, _BD70528_MASK_CHG_STAT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _BD70528_MASK_CHG_STAT@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	and	w8, w9, w8
	sub	w8, w8, #128
	cmp	w8, #11
	b.hi	LBB0_9
; %bb.3:
	mov	w9, #1
	lsl	w8, w9, w8
	mov	w9, #3559
	tst	w8, w9
	b.eq	LBB0_7
; %bb.4:
Lloh8:
	adrp	x8, _POWER_SUPPLY_CHARGE_TYPE_NONE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _POWER_SUPPLY_CHARGE_TYPE_NONE@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	str	w8, [x20]
LBB0_6:
	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
LBB0_7:
	mov	w9, #528
	tst	w8, w9
	b.eq	LBB0_10
; %bb.8:
Lloh10:
	adrp	x8, _POWER_SUPPLY_CHARGE_TYPE_FAST@GOTPAGE
Lloh11:
	ldr	x8, [x8, _POWER_SUPPLY_CHARGE_TYPE_FAST@GOTPAGEOFF]
	b	LBB0_5
LBB0_9:
Lloh12:
	adrp	x8, _POWER_SUPPLY_CHARGE_TYPE_UNKNOWN@GOTPAGE
Lloh13:
	ldr	x8, [x8, _POWER_SUPPLY_CHARGE_TYPE_UNKNOWN@GOTPAGEOFF]
	b	LBB0_5
LBB0_10:
Lloh14:
	adrp	x8, _POWER_SUPPLY_CHARGE_TYPE_TRICKLE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _POWER_SUPPLY_CHARGE_TYPE_TRICKLE@GOTPAGEOFF]
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_BD70528_REG_CHG_CURR_STAT,4,2  ; @BD70528_REG_CHG_CURR_STAT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Charger state read failure %d\n"

	.comm	_BD70528_MASK_CHG_STAT,4,2      ; @BD70528_MASK_CHG_STAT
	.comm	_POWER_SUPPLY_CHARGE_TYPE_TRICKLE,4,2 ; @POWER_SUPPLY_CHARGE_TYPE_TRICKLE
	.comm	_POWER_SUPPLY_CHARGE_TYPE_FAST,4,2 ; @POWER_SUPPLY_CHARGE_TYPE_FAST
	.comm	_POWER_SUPPLY_CHARGE_TYPE_NONE,4,2 ; @POWER_SUPPLY_CHARGE_TYPE_NONE
	.comm	_POWER_SUPPLY_CHARGE_TYPE_UNKNOWN,4,2 ; @POWER_SUPPLY_CHARGE_TYPE_UNKNOWN
	.no_dead_strip	_bd70528_get_charge_type
.subsections_via_symbols
