	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cht_wc_extcon_probe
_cht_wc_extcon_probe:                   ## @cht_wc_extcon_probe
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movl	4(%rdi), %edi
	callq	_dev_get_drvdata
	movq	%rax, %r14
	movq	_CHT_WC_PWRSRC_VBUS@GOTPCREL(%rip), %rax
	movq	_CHT_WC_PWRSRC_USBID_MASK@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rbx
	orq	(%rax), %rbx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_platform_get_irq
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_14
## %bb.1:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	leaq	4(%r12), %r15
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	$24, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, %rbx
	movq	%r15, (%rax)
	movl	(%r14), %eax
	movl	%eax, 8(%rbx)
	movq	_EXTCON_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	_cht_wc_extcon_cables@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_devm_extcon_dev_allocate
	movl	%eax, 12(%rbx)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_4
## %bb.15:
	movl	12(%rbx), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_14
LBB0_4:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_cht_wc_extcon_set_5v_boost
	movq	%rbx, %r14
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_cht_wc_extcon_sw_control
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.5:
	movq	%r14, %rbx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_cht_wc_extcon_enable_charging
	movq	(%r14), %rdi
	movl	12(%r14), %esi
	callq	_devm_extcon_dev_register
	testl	%eax, %eax
	je	LBB0_9
## %bb.6:
	movl	%eax, %ebx
	movq	(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_7
LBB0_9:
	movq	_MUX_SEL_PMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rbx
	movq	%r14, %rdi
	callq	_cht_wc_extcon_set_phymux
	movq	%r14, %rdi
	callq	_cht_wc_extcon_pwrsrc_event
	movq	(%r14), %rdi
	movq	_cht_wc_extcon_isr@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_IRQF_ONESHOT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	(%r12), %r9d
	movq	%r14, (%rsp)
	movl	%r13d, %esi
	xorl	%edx, %edx
	callq	_devm_request_threaded_irq
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %ebx
	movq	(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_7
LBB0_11:
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	notq	%rdx
	movl	8(%r14), %edi
	movq	_CHT_WC_PWRSRC_IRQ_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_regmap_write
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %ebx
	movq	(%r14), %rdi
	leaq	L_.str.2(%rip), %rsi
LBB0_7:
	movl	%ebx, %edx
	callq	_dev_err
LBB0_8:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_cht_wc_extcon_sw_control
	movl	%ebx, %r13d
LBB0_14:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_platform_set_drvdata
	xorl	%r13d, %r13d
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_CHT_WC_PWRSRC_VBUS,8,3         ## @CHT_WC_PWRSRC_VBUS
	.comm	_CHT_WC_PWRSRC_USBID_MASK,8,3   ## @CHT_WC_PWRSRC_USBID_MASK
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EXTCON_NONE,4,2                ## @EXTCON_NONE
	.comm	_cht_wc_extcon_cables,4,2       ## @cht_wc_extcon_cables
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error registering extcon device: %d\n"

	.comm	_MUX_SEL_PMIC,4,2               ## @MUX_SEL_PMIC
	.comm	_cht_wc_extcon_isr,4,2          ## @cht_wc_extcon_isr
	.comm	_IRQF_ONESHOT,4,2               ## @IRQF_ONESHOT
L_.str.1:                               ## @.str.1
	.asciz	"Error requesting interrupt: %d\n"

	.comm	_CHT_WC_PWRSRC_IRQ_MASK,4,2     ## @CHT_WC_PWRSRC_IRQ_MASK
L_.str.2:                               ## @.str.2
	.asciz	"Error writing irq-mask: %d\n"

	.no_dead_strip	_cht_wc_extcon_probe
.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_probe
_cht_wc_extcon_probe:                   ; @cht_wc_extcon_probe
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x0
	mov	x22, x0
	ldr	w0, [x22, #4]!
	bl	_dev_get_drvdata
	mov	x23, x0
Lloh0:
	adrp	x8, _CHT_WC_PWRSRC_VBUS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CHT_WC_PWRSRC_VBUS@GOTPAGEOFF]
Lloh2:
	ldr	x24, [x8]
Lloh3:
	adrp	x8, _CHT_WC_PWRSRC_USBID_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CHT_WC_PWRSRC_USBID_MASK@GOTPAGEOFF]
Lloh5:
	ldr	x25, [x8]
	mov	x0, x20
	mov	w1, #0
	bl	_platform_get_irq
	mov	x21, x0
	tbnz	w0, #31, LBB0_14
; %bb.1:
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x22
	mov	w1, #24
	bl	_devm_kzalloc
	cbz	x0, LBB0_4
; %bb.2:
	mov	x19, x0
	str	x22, [x0]
	ldr	w8, [x23]
Lloh9:
	adrp	x9, _EXTCON_NONE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _EXTCON_NONE@GOTPAGEOFF]
	str	w8, [x0, #8]
Lloh11:
	ldr	w8, [x9]
	str	w8, [x0, #16]
Lloh12:
	adrp	x8, _cht_wc_extcon_cables@GOTPAGE
Lloh13:
	ldr	x8, [x8, _cht_wc_extcon_cables@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_devm_extcon_dev_allocate
	str	w0, [x19, #12]
	bl	_IS_ERR
	cbz	x0, LBB0_5
; %bb.3:
	ldr	w0, [x19, #12]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_PTR_ERR
LBB0_4:
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_14
LBB0_5:
	mov	x0, x19
	mov	w1, #0
	bl	_cht_wc_extcon_set_5v_boost
	mov	x0, x19
	mov	w1, #1
	bl	_cht_wc_extcon_sw_control
	mov	x22, x0
	cbnz	w0, LBB0_13
; %bb.6:
	mov	x0, x19
	mov	w1, #0
	bl	_cht_wc_extcon_enable_charging
	ldr	x0, [x19]
	ldr	w1, [x19, #12]
	bl	_devm_extcon_dev_register
	cbz	w0, LBB0_8
; %bb.7:
	mov	x22, x0
	ldr	x0, [x19]
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_12
LBB0_8:
Lloh20:
	adrp	x8, _MUX_SEL_PMIC@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MUX_SEL_PMIC@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_cht_wc_extcon_set_phymux
	mov	x0, x19
	bl	_cht_wc_extcon_pwrsrc_event
Lloh23:
	adrp	x8, _cht_wc_extcon_isr@GOTPAGE
Lloh24:
	ldr	x8, [x8, _cht_wc_extcon_isr@GOTPAGEOFF]
	ldr	x0, [x19]
Lloh25:
	ldr	w3, [x8]
Lloh26:
	adrp	x8, _IRQF_ONESHOT@GOTPAGE
Lloh27:
	ldr	x8, [x8, _IRQF_ONESHOT@GOTPAGEOFF]
Lloh28:
	ldr	w4, [x8]
	ldr	w5, [x20]
	mov	x1, x21
	mov	x2, #0
	mov	x6, x19
	bl	_devm_request_threaded_irq
	cbz	w0, LBB0_10
; %bb.9:
	mov	x22, x0
	ldr	x0, [x19]
Lloh29:
	adrp	x1, l_.str.1@PAGE
Lloh30:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_12
LBB0_10:
	orr	x8, x25, x24
	mvn	x2, x8
	ldr	w0, [x19, #8]
Lloh31:
	adrp	x8, _CHT_WC_PWRSRC_IRQ_MASK@GOTPAGE
Lloh32:
	ldr	x8, [x8, _CHT_WC_PWRSRC_IRQ_MASK@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	bl	_regmap_write
	cbz	w0, LBB0_15
; %bb.11:
	mov	x22, x0
	ldr	x0, [x19]
Lloh34:
	adrp	x1, l_.str.2@PAGE
Lloh35:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_12:
	mov	x2, x22
	bl	_dev_err
LBB0_13:
	mov	x0, x19
	mov	w1, #0
	bl	_cht_wc_extcon_sw_control
	mov	x21, x22
LBB0_14:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_15:
	mov	x0, x20
	mov	x1, x19
	bl	_platform_set_drvdata
	mov	w21, #0
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_CHT_WC_PWRSRC_VBUS,8,3         ; @CHT_WC_PWRSRC_VBUS
	.comm	_CHT_WC_PWRSRC_USBID_MASK,8,3   ; @CHT_WC_PWRSRC_USBID_MASK
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EXTCON_NONE,4,2                ; @EXTCON_NONE
	.comm	_cht_wc_extcon_cables,4,2       ; @cht_wc_extcon_cables
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error registering extcon device: %d\n"

	.comm	_MUX_SEL_PMIC,4,2               ; @MUX_SEL_PMIC
	.comm	_cht_wc_extcon_isr,4,2          ; @cht_wc_extcon_isr
	.comm	_IRQF_ONESHOT,4,2               ; @IRQF_ONESHOT
l_.str.1:                               ; @.str.1
	.asciz	"Error requesting interrupt: %d\n"

	.comm	_CHT_WC_PWRSRC_IRQ_MASK,4,2     ; @CHT_WC_PWRSRC_IRQ_MASK
l_.str.2:                               ; @.str.2
	.asciz	"Error writing irq-mask: %d\n"

	.no_dead_strip	_cht_wc_extcon_probe
.subsections_via_symbols
