	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cht_wc_extcon_get_charger
_cht_wc_extcon_get_charger:             ## @cht_wc_extcon_get_charger
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r15
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	$800, %edi                      ## imm = 0x320
	callq	_msecs_to_jiffies
	movq	%rax, %r13
	addq	%rbx, %r13
	leaq	-44(%rbp), %r12
	movq	_CHT_WC_USBSRC_STS_SUCCESS@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	4(%r15), %edi
	movq	_CHT_WC_USBSRC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdx
	callq	_regmap_read
	testl	%eax, %eax
	jne	LBB0_10
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_CHT_WC_USBSRC_STS_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	andl	-44(%rbp), %ebx
	movl	(%r14), %eax
	cmpl	%eax, %ebx
	je	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_CHT_WC_USBSRC_STS_FAIL@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	$50, %edi
	callq	_msleep
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%r13, %rsi
	callq	_time_before
	testq	%rax, %rax
	jne	LBB0_1
## %bb.5:
	movl	(%r14), %eax
LBB0_6:
	cmpl	%eax, %ebx
	jne	LBB0_11
## %bb.7:
	movq	_CHT_WC_USBSRC_TYPE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	-44(%rbp), %eax
	movq	_CHT_WC_USBSRC_TYPE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	movl	%eax, -44(%rbp)
	addl	$-128, %eax
	cmpl	$7, %eax
	ja	LBB0_16
## %bb.8:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_9:
	movq	_EXTCON_CHG_USB_DCP@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_10:
	movl	%eax, %ebx
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
	jmp	LBB0_19
LBB0_11:
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_17
## %bb.13:
	movq	_CHT_WC_USBSRC_STS_FAIL@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str.2(%rip), %rsi
	cmoveq	%rax, %rsi
	xorl	%eax, %eax
	callq	_dev_warn
	jmp	LBB0_17
LBB0_14:
	movq	_EXTCON_CHG_USB_CDP@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_15:
	movq	_EXTCON_CHG_USB_ACA@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_16:
	movl	(%r15), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%edx, %edx
	xorl	%eax, %eax
	callq	_dev_warn
LBB0_17:
	movq	_EXTCON_CHG_USB_SDP@GOTPCREL(%rip), %rax
LBB0_18:
	movl	(%rax), %ebx
LBB0_19:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_17, LBB0_17-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
.set L0_0_set_15, LBB0_15-LJTI0_0
LJTI0_0:
	.long	L0_0_set_17
	.long	L0_0_set_17
	.long	L0_0_set_9
	.long	L0_0_set_17
	.long	L0_0_set_9
	.long	L0_0_set_9
	.long	L0_0_set_14
	.long	L0_0_set_15
	.end_data_region
                                        ## -- End function
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_CHT_WC_USBSRC,4,2              ## @CHT_WC_USBSRC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error reading usbsrc: %d\n"

	.comm	_CHT_WC_USBSRC_STS_MASK,4,2     ## @CHT_WC_USBSRC_STS_MASK
	.comm	_CHT_WC_USBSRC_STS_SUCCESS,4,2  ## @CHT_WC_USBSRC_STS_SUCCESS
	.comm	_CHT_WC_USBSRC_STS_FAIL,4,2     ## @CHT_WC_USBSRC_STS_FAIL
	.comm	_EXTCON_CHG_USB_SDP,4,2         ## @EXTCON_CHG_USB_SDP
L_.str.1:                               ## @.str.1
	.asciz	"Could not detect charger type\n"

L_.str.2:                               ## @.str.2
	.asciz	"Timeout detecting charger type\n"

	.comm	_CHT_WC_USBSRC_TYPE_MASK,4,2    ## @CHT_WC_USBSRC_TYPE_MASK
	.comm	_CHT_WC_USBSRC_TYPE_SHIFT,4,2   ## @CHT_WC_USBSRC_TYPE_SHIFT
L_.str.3:                               ## @.str.3
	.asciz	"Unhandled charger type %d, defaulting to SDP\n"

	.comm	_EXTCON_CHG_USB_CDP,4,2         ## @EXTCON_CHG_USB_CDP
	.comm	_EXTCON_CHG_USB_DCP,4,2         ## @EXTCON_CHG_USB_DCP
	.comm	_EXTCON_CHG_USB_ACA,4,2         ## @EXTCON_CHG_USB_ACA
	.no_dead_strip	_cht_wc_extcon_get_charger
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cht_wc_extcon_get_charger
_cht_wc_extcon_get_charger:             ; @cht_wc_extcon_get_charger
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x24, _jiffies@GOTPAGE
Lloh1:
	ldr	x24, [x24, _jiffies@GOTPAGEOFF]
	ldr	x21, [x24]
	mov	w0, #800
	bl	_msecs_to_jiffies
	add	x22, x0, x21
Lloh2:
	adrp	x25, _CHT_WC_USBSRC@GOTPAGE
Lloh3:
	ldr	x25, [x25, _CHT_WC_USBSRC@GOTPAGEOFF]
Lloh4:
	adrp	x27, _CHT_WC_USBSRC_STS_MASK@GOTPAGE
Lloh5:
	ldr	x27, [x27, _CHT_WC_USBSRC_STS_MASK@GOTPAGEOFF]
Lloh6:
	adrp	x26, _CHT_WC_USBSRC_STS_SUCCESS@GOTPAGE
Lloh7:
	ldr	x26, [x26, _CHT_WC_USBSRC_STS_SUCCESS@GOTPAGEOFF]
Lloh8:
	adrp	x23, _CHT_WC_USBSRC_STS_FAIL@GOTPAGE
Lloh9:
	ldr	x23, [x23, _CHT_WC_USBSRC_STS_FAIL@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19, #4]
	ldr	w1, [x25]
	add	x2, sp, #12
	bl	_regmap_read
	cbnz	w0, LBB0_9
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [sp, #12]
	ldr	w9, [x27]
	and	w21, w9, w8
	ldr	w8, [x26]
	ldr	w9, [x23]
	cmp	w21, w8
	ccmp	w21, w9, #4, ne
	b.eq	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	w0, #50
	bl	_msleep
	ldr	x0, [x24]
	mov	x1, x22
	bl	_time_before
	cbnz	x0, LBB0_1
; %bb.4:
	ldr	w8, [x26]
LBB0_5:
	cmp	w21, w8
	b.ne	LBB0_10
; %bb.6:
	ldr	w8, [sp, #12]
Lloh10:
	adrp	x9, _CHT_WC_USBSRC_TYPE_MASK@GOTPAGE
Lloh11:
	ldr	x9, [x9, _CHT_WC_USBSRC_TYPE_MASK@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
Lloh13:
	adrp	x10, _CHT_WC_USBSRC_TYPE_SHIFT@GOTPAGE
Lloh14:
	ldr	x10, [x10, _CHT_WC_USBSRC_TYPE_SHIFT@GOTPAGEOFF]
	and	w8, w9, w8
Lloh15:
	ldr	w9, [x10]
	asr	w8, w8, w9
	str	w8, [sp, #12]
	sub	w8, w8, #128
	cmp	w8, #7
	b.hi	LBB0_14
; %bb.7:
Lloh16:
	adrp	x9, lJTI0_0@PAGE
Lloh17:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_8
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_8:
Lloh18:
	adrp	x8, _EXTCON_CHG_USB_DCP@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EXTCON_CHG_USB_DCP@GOTPAGEOFF]
	b	LBB0_17
LBB0_9:
	mov	x21, x0
	ldr	w0, [x19]
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dev_err
	b	LBB0_18
LBB0_10:
	cbnz	w20, LBB0_16
; %bb.11:
	ldr	w8, [x23]
	ldr	w0, [x19]
Lloh22:
	adrp	x9, l_.str.2@PAGE
Lloh23:
	add	x9, x9, l_.str.2@PAGEOFF
Lloh24:
	adrp	x10, l_.str.1@PAGE
Lloh25:
	add	x10, x10, l_.str.1@PAGEOFF
	cmp	w21, w8
	csel	x1, x10, x9, eq
	b	LBB0_15
LBB0_12:
Lloh26:
	adrp	x8, _EXTCON_CHG_USB_CDP@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EXTCON_CHG_USB_CDP@GOTPAGEOFF]
	b	LBB0_17
LBB0_13:
Lloh28:
	adrp	x8, _EXTCON_CHG_USB_ACA@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EXTCON_CHG_USB_ACA@GOTPAGEOFF]
	b	LBB0_17
LBB0_14:
	ldr	w0, [x19]
	str	xzr, [sp]
Lloh30:
	adrp	x1, l_.str.3@PAGE
Lloh31:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_15:
	bl	_dev_warn
LBB0_16:
Lloh32:
	adrp	x8, _EXTCON_CHG_USB_SDP@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EXTCON_CHG_USB_SDP@GOTPAGEOFF]
LBB0_17:
	ldr	w21, [x8]
LBB0_18:
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_16-LBB0_8)>>2
	.byte	(LBB0_16-LBB0_8)>>2
	.byte	(LBB0_8-LBB0_8)>>2
	.byte	(LBB0_16-LBB0_8)>>2
	.byte	(LBB0_8-LBB0_8)>>2
	.byte	(LBB0_8-LBB0_8)>>2
	.byte	(LBB0_12-LBB0_8)>>2
	.byte	(LBB0_13-LBB0_8)>>2
                                        ; -- End function
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_CHT_WC_USBSRC,4,2              ; @CHT_WC_USBSRC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error reading usbsrc: %d\n"

	.comm	_CHT_WC_USBSRC_STS_MASK,4,2     ; @CHT_WC_USBSRC_STS_MASK
	.comm	_CHT_WC_USBSRC_STS_SUCCESS,4,2  ; @CHT_WC_USBSRC_STS_SUCCESS
	.comm	_CHT_WC_USBSRC_STS_FAIL,4,2     ; @CHT_WC_USBSRC_STS_FAIL
	.comm	_EXTCON_CHG_USB_SDP,4,2         ; @EXTCON_CHG_USB_SDP
l_.str.1:                               ; @.str.1
	.asciz	"Could not detect charger type\n"

l_.str.2:                               ; @.str.2
	.asciz	"Timeout detecting charger type\n"

	.comm	_CHT_WC_USBSRC_TYPE_MASK,4,2    ; @CHT_WC_USBSRC_TYPE_MASK
	.comm	_CHT_WC_USBSRC_TYPE_SHIFT,4,2   ; @CHT_WC_USBSRC_TYPE_SHIFT
l_.str.3:                               ; @.str.3
	.asciz	"Unhandled charger type %d, defaulting to SDP\n"

	.comm	_EXTCON_CHG_USB_CDP,4,2         ; @EXTCON_CHG_USB_CDP
	.comm	_EXTCON_CHG_USB_DCP,4,2         ; @EXTCON_CHG_USB_DCP
	.comm	_EXTCON_CHG_USB_ACA,4,2         ; @EXTCON_CHG_USB_ACA
	.no_dead_strip	_cht_wc_extcon_get_charger
.subsections_via_symbols
