	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function abx500_chargalg_check_charger_connection
_abx500_chargalg_check_charger_connection: ## @abx500_chargalg_check_charger_connection
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movl	(%rdi), %eax
	cmpl	4(%rdi), %eax
	jne	LBB0_2
## %bb.1:
	cmpl	$0, 16(%rbx)
	je	LBB0_16
LBB0_2:
	movq	_AC_CHG@GOTPCREL(%rip), %r14
	testl	%eax, (%r14)
	je	LBB0_6
## %bb.3:
	cmpq	$0, 32(%rbx)
	je	LBB0_4
LBB0_6:
	movq	_USB_CHG@GOTPCREL(%rip), %r14
	testl	%eax, (%r14)
	je	LBB0_9
## %bb.7:
	cmpq	$0, 24(%rbx)
	je	LBB0_8
LBB0_9:
	testl	%eax, %eax
	je	LBB0_13
## %bb.10:
	cmpq	$0, 32(%rbx)
	jne	LBB0_12
## %bb.11:
	cmpq	$0, 24(%rbx)
	je	LBB0_13
LBB0_12:
	movl	40(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_dbg
	movq	_NO_CHG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movq	_STATE_SUSPENDED_INIT@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_13:
	movl	40(%rbx), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_dbg
	movq	_NO_CHG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movq	_STATE_HANDHELD_INIT@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_4:
	movl	40(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	movl	(%r14), %eax
	cmpl	%eax, 8(%rbx)
	jne	LBB0_5
	jmp	LBB0_15
LBB0_8:
	movl	40(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_dbg
	movl	(%r14), %eax
LBB0_5:
	movl	%eax, 8(%rbx)
	movq	_STATE_NORMAL_INIT@GOTPCREL(%rip), %rax
LBB0_14:
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_abx500_chargalg_state_to
LBB0_15:
	movl	(%rbx), %eax
	movl	%eax, 4(%rbx)
	movl	$0, 16(%rbx)
LBB0_16:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AC_CHG,4,2                     ## @AC_CHG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Charging source is AC\n"

	.comm	_STATE_NORMAL_INIT,4,2          ## @STATE_NORMAL_INIT
	.comm	_USB_CHG,4,2                    ## @USB_CHG
L_.str.1:                               ## @.str.1
	.asciz	"Charging source is USB\n"

L_.str.2:                               ## @.str.2
	.asciz	"Charging is suspended\n"

	.comm	_NO_CHG,8,3                     ## @NO_CHG
	.comm	_STATE_SUSPENDED_INIT,4,2       ## @STATE_SUSPENDED_INIT
L_.str.3:                               ## @.str.3
	.asciz	"Charging source is OFF\n"

	.comm	_STATE_HANDHELD_INIT,4,2        ## @STATE_HANDHELD_INIT
	.no_dead_strip	_abx500_chargalg_check_charger_connection
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function abx500_chargalg_check_charger_connection
_abx500_chargalg_check_charger_connection: ; @abx500_chargalg_check_charger_connection
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w0, [x0]
	ldr	w8, [x19, #4]
	cmp	w0, w8
	b.ne	LBB0_2
; %bb.1:
	ldr	w8, [x19, #16]
	cbz	w8, LBB0_16
LBB0_2:
Lloh0:
	adrp	x20, _AC_CHG@GOTPAGE
Lloh1:
	ldr	x20, [x20, _AC_CHG@GOTPAGEOFF]
	ldr	w8, [x20]
	tst	w8, w0
	b.eq	LBB0_4
; %bb.3:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_11
LBB0_4:
Lloh2:
	adrp	x20, _USB_CHG@GOTPAGE
Lloh3:
	ldr	x20, [x20, _USB_CHG@GOTPAGEOFF]
	ldr	w8, [x20]
	tst	w8, w0
	b.eq	LBB0_6
; %bb.5:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_12
LBB0_6:
	cbz	w0, LBB0_10
; %bb.7:
	ldr	x8, [x19, #32]
	cbnz	x8, LBB0_9
; %bb.8:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_10
LBB0_9:
	ldr	w0, [x19, #40]
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_dbg
Lloh6:
	adrp	x8, _NO_CHG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NO_CHG@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	str	w8, [x19, #8]
Lloh9:
	adrp	x8, _STATE_SUSPENDED_INIT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _STATE_SUSPENDED_INIT@GOTPAGEOFF]
	b	LBB0_14
LBB0_10:
	ldr	w0, [x19, #40]
Lloh11:
	adrp	x1, l_.str.3@PAGE
Lloh12:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_dbg
Lloh13:
	adrp	x8, _NO_CHG@GOTPAGE
Lloh14:
	ldr	x8, [x8, _NO_CHG@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	str	w8, [x19, #8]
Lloh16:
	adrp	x8, _STATE_HANDHELD_INIT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _STATE_HANDHELD_INIT@GOTPAGEOFF]
	b	LBB0_14
LBB0_11:
	ldr	w0, [x19, #40]
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	ldr	w9, [x19, #8]
	ldr	w8, [x20]
	cmp	w9, w8
	b.ne	LBB0_13
	b	LBB0_15
LBB0_12:
	ldr	w0, [x19, #40]
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	ldr	w8, [x20]
LBB0_13:
	str	w8, [x19, #8]
Lloh22:
	adrp	x8, _STATE_NORMAL_INIT@GOTPAGE
Lloh23:
	ldr	x8, [x8, _STATE_NORMAL_INIT@GOTPAGEOFF]
LBB0_14:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_abx500_chargalg_state_to
LBB0_15:
	ldr	w0, [x19]
	str	w0, [x19, #4]
	str	wzr, [x19, #16]
LBB0_16:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_AC_CHG,4,2                     ; @AC_CHG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Charging source is AC\n"

	.comm	_STATE_NORMAL_INIT,4,2          ; @STATE_NORMAL_INIT
	.comm	_USB_CHG,4,2                    ; @USB_CHG
l_.str.1:                               ; @.str.1
	.asciz	"Charging source is USB\n"

l_.str.2:                               ; @.str.2
	.asciz	"Charging is suspended\n"

	.comm	_NO_CHG,8,3                     ; @NO_CHG
	.comm	_STATE_SUSPENDED_INIT,4,2       ; @STATE_SUSPENDED_INIT
l_.str.3:                               ; @.str.3
	.asciz	"Charging source is OFF\n"

	.comm	_STATE_HANDHELD_INIT,4,2        ; @STATE_HANDHELD_INIT
	.no_dead_strip	_abx500_chargalg_check_charger_connection
.subsections_via_symbols
