	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function axp288_handle_chrg_det_event
_axp288_handle_chrg_det_event:          ## @axp288_handle_chrg_det_event
	.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	%rdi, %rbx
	movl	(%rdi), %r15d
	callq	_axp288_get_vbus_attach
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_15
## %bb.1:
	movl	28(%rbx), %edi
	movq	_AXP288_BC_GLOBAL_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	callq	_regmap_read
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_5
## %bb.2:
	movq	_BC_GLOBAL_DET_STAT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -36(%rbp)
	je	LBB0_3
## %bb.24:
	movl	8(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	jmp	LBB0_25
LBB0_3:
	movl	28(%rbx), %edi
	movq	_AXP288_BC_DET_STAT_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	js	LBB0_4
## %bb.6:
	movq	_DET_STAT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	-40(%rbp), %eax
	movq	_DET_STAT_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	cmpl	$130, %eax
	je	LBB0_10
## %bb.7:
	cmpl	$129, %eax
	je	LBB0_11
## %bb.8:
	cmpl	$128, %eax
	jne	LBB0_12
## %bb.9:
	movl	8(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_dbg
	jmp	LBB0_13
LBB0_4:
	movl	%eax, %r15d
LBB0_5:
	movl	8(%rbx), %edi
	leaq	L_.str.5(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_25
LBB0_10:
	movl	8(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_dbg
	movq	_EXTCON_CHG_USB_CDP@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_11:
	movl	8(%rbx), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_dbg
	movq	_EXTCON_CHG_USB_DCP@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_12:
	movl	8(%rbx), %edi
	leaq	L_.str.4(%rip), %rsi
	callq	_dev_warn
LBB0_13:
	movq	_EXTCON_CHG_USB_SDP@GOTPCREL(%rip), %rax
LBB0_14:
	movl	(%rax), %r15d
LBB0_15:
	movl	(%rbx), %esi
	movl	24(%rbx), %edi
	xorl	%edx, %edx
	callq	_extcon_set_state_sync
	movl	(%rbx), %eax
	movq	_EXTCON_CHG_USB_SDP@GOTPCREL(%rip), %r12
	cmpl	(%r12), %eax
	jne	LBB0_17
## %bb.16:
	movl	24(%rbx), %edi
	movq	_EXTCON_USB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_extcon_set_state_sync
LBB0_17:
	testl	%r14d, %r14d
	je	LBB0_21
## %bb.18:
	movl	24(%rbx), %edi
	movl	%r15d, %esi
	movl	%r14d, %edx
	callq	_extcon_set_state_sync
	cmpl	(%r12), %r15d
	jne	LBB0_20
## %bb.19:
	movl	24(%rbx), %edi
	movq	_EXTCON_USB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edx
	callq	_extcon_set_state_sync
LBB0_20:
	movl	%r15d, (%rbx)
LBB0_21:
	xorl	%r15d, %r15d
	cmpq	$0, 16(%rbx)
	je	LBB0_25
## %bb.22:
	cmpl	%r14d, 4(%rbx)
	je	LBB0_25
## %bb.23:
	movl	%r14d, 4(%rbx)
	movq	_system_long_wq@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$12, %rbx
	movq	%rbx, %rsi
	callq	_queue_work
LBB0_25:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AXP288_BC_GLOBAL_REG,4,2       ## @AXP288_BC_GLOBAL_REG
	.comm	_BC_GLOBAL_DET_STAT,4,2         ## @BC_GLOBAL_DET_STAT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"can't complete the charger detection\n"

	.comm	_AXP288_BC_DET_STAT_REG,4,2     ## @AXP288_BC_DET_STAT_REG
	.comm	_DET_STAT_MASK,4,2              ## @DET_STAT_MASK
	.comm	_DET_STAT_SHIFT,4,2             ## @DET_STAT_SHIFT
L_.str.1:                               ## @.str.1
	.asciz	"sdp cable is connected\n"

	.comm	_EXTCON_CHG_USB_SDP,4,2         ## @EXTCON_CHG_USB_SDP
L_.str.2:                               ## @.str.2
	.asciz	"cdp cable is connected\n"

	.comm	_EXTCON_CHG_USB_CDP,4,2         ## @EXTCON_CHG_USB_CDP
L_.str.3:                               ## @.str.3
	.asciz	"dcp cable is connected\n"

	.comm	_EXTCON_CHG_USB_DCP,4,2         ## @EXTCON_CHG_USB_DCP
L_.str.4:                               ## @.str.4
	.asciz	"unknown (reserved) bc detect result\n"

	.comm	_EXTCON_USB,4,2                 ## @EXTCON_USB
	.comm	_system_long_wq,4,2             ## @system_long_wq
L_.str.5:                               ## @.str.5
	.asciz	"failed to detect BC Mod\n"

	.no_dead_strip	_axp288_handle_chrg_det_event
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function axp288_handle_chrg_det_event
_axp288_handle_chrg_det_event:          ; @axp288_handle_chrg_det_event
	.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, x0
	ldr	w21, [x0]
	bl	_axp288_get_vbus_attach
	mov	x20, x0
	cbz	w0, LBB0_16
; %bb.1:
	ldr	w0, [x19, #28]
Lloh0:
	adrp	x8, _AXP288_BC_GLOBAL_REG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AXP288_BC_GLOBAL_REG@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #8
	bl	_regmap_read
	mov	x21, x0
	tbnz	w0, #31, LBB0_10
; %bb.2:
	ldr	w8, [sp, #8]
Lloh3:
	adrp	x9, _BC_GLOBAL_DET_STAT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _BC_GLOBAL_DET_STAT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	ldr	w0, [x19, #8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	b	LBB0_26
LBB0_4:
	ldr	w0, [x19, #28]
Lloh8:
	adrp	x8, _AXP288_BC_DET_STAT_REG@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AXP288_BC_DET_STAT_REG@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_regmap_read
	tbnz	w0, #31, LBB0_9
; %bb.5:
	ldr	w8, [sp, #12]
Lloh11:
	adrp	x9, _DET_STAT_MASK@GOTPAGE
Lloh12:
	ldr	x9, [x9, _DET_STAT_MASK@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh14:
	adrp	x9, _DET_STAT_SHIFT@GOTPAGE
Lloh15:
	ldr	x9, [x9, _DET_STAT_SHIFT@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	asr	w8, w8, w9
	cmp	w8, #130
	b.eq	LBB0_11
; %bb.6:
	cmp	w8, #129
	b.eq	LBB0_12
; %bb.7:
	cmp	w8, #128
	b.ne	LBB0_13
; %bb.8:
	ldr	w0, [x19, #8]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	b	LBB0_14
LBB0_9:
	mov	x21, x0
LBB0_10:
	ldr	w0, [x19, #8]
Lloh19:
	adrp	x1, l_.str.5@PAGE
Lloh20:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_dev_err
	b	LBB0_26
LBB0_11:
	ldr	w0, [x19, #8]
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_dbg
Lloh23:
	adrp	x8, _EXTCON_CHG_USB_CDP@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EXTCON_CHG_USB_CDP@GOTPAGEOFF]
	b	LBB0_15
LBB0_12:
	ldr	w0, [x19, #8]
Lloh25:
	adrp	x1, l_.str.3@PAGE
Lloh26:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_dbg
Lloh27:
	adrp	x8, _EXTCON_CHG_USB_DCP@GOTPAGE
Lloh28:
	ldr	x8, [x8, _EXTCON_CHG_USB_DCP@GOTPAGEOFF]
	b	LBB0_15
LBB0_13:
	ldr	w0, [x19, #8]
Lloh29:
	adrp	x1, l_.str.4@PAGE
Lloh30:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_warn
LBB0_14:
Lloh31:
	adrp	x8, _EXTCON_CHG_USB_SDP@GOTPAGE
Lloh32:
	ldr	x8, [x8, _EXTCON_CHG_USB_SDP@GOTPAGEOFF]
LBB0_15:
	ldr	w21, [x8]
LBB0_16:
	ldr	w0, [x19, #24]
	ldr	w1, [x19]
	mov	w2, #0
	bl	_extcon_set_state_sync
	ldr	w8, [x19]
Lloh33:
	adrp	x22, _EXTCON_CHG_USB_SDP@GOTPAGE
Lloh34:
	ldr	x22, [x22, _EXTCON_CHG_USB_SDP@GOTPAGEOFF]
	ldr	w9, [x22]
	cmp	w8, w9
	b.ne	LBB0_18
; %bb.17:
	ldr	w0, [x19, #24]
Lloh35:
	adrp	x8, _EXTCON_USB@GOTPAGE
Lloh36:
	ldr	x8, [x8, _EXTCON_USB@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_extcon_set_state_sync
LBB0_18:
	cbz	w20, LBB0_22
; %bb.19:
	ldr	w0, [x19, #24]
	mov	x1, x21
	mov	x2, x20
	bl	_extcon_set_state_sync
	ldr	w8, [x22]
	cmp	w21, w8
	b.ne	LBB0_21
; %bb.20:
	ldr	w0, [x19, #24]
Lloh38:
	adrp	x8, _EXTCON_USB@GOTPAGE
Lloh39:
	ldr	x8, [x8, _EXTCON_USB@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x8]
	mov	x2, x20
	bl	_extcon_set_state_sync
LBB0_21:
	str	w21, [x19]
LBB0_22:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_25
; %bb.23:
	ldr	w8, [x19, #4]
	cmp	w8, w20
	b.eq	LBB0_25
; %bb.24:
	str	w20, [x19, #4]
Lloh41:
	adrp	x8, _system_long_wq@GOTPAGE
Lloh42:
	ldr	x8, [x8, _system_long_wq@GOTPAGEOFF]
Lloh43:
	ldr	w0, [x8]
	add	x1, x19, #12
	bl	_queue_work
LBB0_25:
	mov	w21, #0
LBB0_26:
	mov	x0, x21
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_AXP288_BC_GLOBAL_REG,4,2       ; @AXP288_BC_GLOBAL_REG
	.comm	_BC_GLOBAL_DET_STAT,4,2         ; @BC_GLOBAL_DET_STAT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"can't complete the charger detection\n"

	.comm	_AXP288_BC_DET_STAT_REG,4,2     ; @AXP288_BC_DET_STAT_REG
	.comm	_DET_STAT_MASK,4,2              ; @DET_STAT_MASK
	.comm	_DET_STAT_SHIFT,4,2             ; @DET_STAT_SHIFT
l_.str.1:                               ; @.str.1
	.asciz	"sdp cable is connected\n"

	.comm	_EXTCON_CHG_USB_SDP,4,2         ; @EXTCON_CHG_USB_SDP
l_.str.2:                               ; @.str.2
	.asciz	"cdp cable is connected\n"

	.comm	_EXTCON_CHG_USB_CDP,4,2         ; @EXTCON_CHG_USB_CDP
l_.str.3:                               ; @.str.3
	.asciz	"dcp cable is connected\n"

	.comm	_EXTCON_CHG_USB_DCP,4,2         ; @EXTCON_CHG_USB_DCP
l_.str.4:                               ; @.str.4
	.asciz	"unknown (reserved) bc detect result\n"

	.comm	_EXTCON_USB,4,2                 ; @EXTCON_USB
	.comm	_system_long_wq,4,2             ; @system_long_wq
l_.str.5:                               ; @.str.5
	.asciz	"failed to detect BC Mod\n"

	.no_dead_strip	_axp288_handle_chrg_det_event
.subsections_via_symbols
