	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ab8500_external_charger_prepare
_ab8500_external_charger_prepare:       ## @ab8500_external_charger_prepare
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	_AB8500_SYS_CTRL1_BLOCK@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_AB8500_SYS_CHARGER_CONTROL_REG@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	_EXTERNAL_CHARGER_DISABLE_REG_VAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	callq	_abx500_set_register_interruptible
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	(%r15), %esi
	movl	(%r12), %edx
	movq	_EXTERNAL_CHARGER_ENABLE_REG_VAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	callq	_abx500_set_register_interruptible
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_5
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_4
LBB0_1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
LBB0_4:
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_dev_err
LBB0_5:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AB8500_SYS_CTRL1_BLOCK,4,2     ## @AB8500_SYS_CTRL1_BLOCK
	.comm	_AB8500_SYS_CHARGER_CONTROL_REG,4,2 ## @AB8500_SYS_CHARGER_CONTROL_REG
	.comm	_EXTERNAL_CHARGER_DISABLE_REG_VAL,4,2 ## @EXTERNAL_CHARGER_DISABLE_REG_VAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"write reg failed %d\n"

	.comm	_EXTERNAL_CHARGER_ENABLE_REG_VAL,4,2 ## @EXTERNAL_CHARGER_ENABLE_REG_VAL
L_.str.1:                               ## @.str.1
	.asciz	"Write reg failed %d\n"

	.no_dead_strip	_ab8500_external_charger_prepare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ab8500_external_charger_prepare
_ab8500_external_charger_prepare:       ; @ab8500_external_charger_prepare
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x2
Lloh0:
	adrp	x21, _AB8500_SYS_CTRL1_BLOCK@GOTPAGE
Lloh1:
	ldr	x21, [x21, _AB8500_SYS_CTRL1_BLOCK@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh2:
	adrp	x22, _AB8500_SYS_CHARGER_CONTROL_REG@GOTPAGE
Lloh3:
	ldr	x22, [x22, _AB8500_SYS_CHARGER_CONTROL_REG@GOTPAGEOFF]
	ldr	w2, [x22]
Lloh4:
	adrp	x8, _EXTERNAL_CHARGER_DISABLE_REG_VAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EXTERNAL_CHARGER_DISABLE_REG_VAL@GOTPAGEOFF]
Lloh6:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_abx500_set_register_interruptible
	tbnz	w0, #31, LBB0_3
; %bb.1:
	ldr	w1, [x21]
	ldr	w2, [x22]
Lloh7:
	adrp	x8, _EXTERNAL_CHARGER_ENABLE_REG_VAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EXTERNAL_CHARGER_ENABLE_REG_VAL@GOTPAGEOFF]
Lloh9:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_abx500_set_register_interruptible
	mov	x20, x0
	tbz	w0, #31, LBB0_5
; %bb.2:
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_4
LBB0_3:
	mov	x20, x0
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
LBB0_4:
	mov	x0, x19
	mov	x2, x20
	bl	_dev_err
LBB0_5:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_AB8500_SYS_CTRL1_BLOCK,4,2     ; @AB8500_SYS_CTRL1_BLOCK
	.comm	_AB8500_SYS_CHARGER_CONTROL_REG,4,2 ; @AB8500_SYS_CHARGER_CONTROL_REG
	.comm	_EXTERNAL_CHARGER_DISABLE_REG_VAL,4,2 ; @EXTERNAL_CHARGER_DISABLE_REG_VAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"write reg failed %d\n"

	.comm	_EXTERNAL_CHARGER_ENABLE_REG_VAL,4,2 ; @EXTERNAL_CHARGER_ENABLE_REG_VAL
l_.str.1:                               ; @.str.1
	.asciz	"Write reg failed %d\n"

	.no_dead_strip	_ab8500_external_charger_prepare
.subsections_via_symbols
