	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cht_wc_extcon_sw_control
_cht_wc_extcon_sw_control:              ## @cht_wc_extcon_sw_control
	.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
	movl	%esi, %ebx
	xorl	%ecx, %ecx
	testl	%esi, %esi
	movq	_CHT_WC_CHGDISCTRL_FN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	cmovel	%edx, %ecx
	movq	%rdi, %r14
	movl	4(%rdi), %edi
	movq	_CHT_WC_CHGDISCTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_regmap_update_bits
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
LBB0_2:
	movq	_CHT_WC_CHGRCTRL0_SWCONTROL@GOTPCREL(%rip), %rax
	movq	_CHT_WC_CHGRCTRL0_CCSM_OFF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	testl	%ebx, %ebx
	cmovnel	%edx, %ebx
	movl	4(%r14), %edi
	movq	_CHT_WC_CHGRCTRL0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %ecx
	callq	_regmap_update_bits
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_err
LBB0_4:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CHT_WC_CHGDISCTRL_FN,4,2       ## @CHT_WC_CHGDISCTRL_FN
	.comm	_CHT_WC_CHGDISCTRL,4,2          ## @CHT_WC_CHGDISCTRL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error setting sw control for CHGDIS pin: %d\n"

	.comm	_CHT_WC_CHGRCTRL0_SWCONTROL,4,2 ## @CHT_WC_CHGRCTRL0_SWCONTROL
	.comm	_CHT_WC_CHGRCTRL0_CCSM_OFF,4,2  ## @CHT_WC_CHGRCTRL0_CCSM_OFF
	.comm	_CHT_WC_CHGRCTRL0,4,2           ## @CHT_WC_CHGRCTRL0
L_.str.1:                               ## @.str.1
	.asciz	"Error setting sw control: %d\n"

	.no_dead_strip	_cht_wc_extcon_sw_control
.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_sw_control
_cht_wc_extcon_sw_control:              ; @cht_wc_extcon_sw_control
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _CHT_WC_CHGDISCTRL_FN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CHT_WC_CHGDISCTRL_FN@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	cmp	w1, #0
	csel	w3, w2, wzr, eq
	ldr	w0, [x0, #4]
Lloh3:
	adrp	x8, _CHT_WC_CHGDISCTRL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CHT_WC_CHGDISCTRL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_regmap_update_bits
	cbz	w0, LBB0_2
; %bb.1:
	mov	x2, x0
	ldr	w0, [x19]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_2:
Lloh8:
	adrp	x8, _CHT_WC_CHGRCTRL0_SWCONTROL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CHT_WC_CHGRCTRL0_SWCONTROL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _CHT_WC_CHGRCTRL0_CCSM_OFF@GOTPAGE
Lloh12:
	ldr	x9, [x9, _CHT_WC_CHGRCTRL0_CCSM_OFF@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w2, w9, w8
	cmp	w20, #0
	csel	w3, wzr, w2, eq
	ldr	w0, [x19, #4]
Lloh14:
	adrp	x8, _CHT_WC_CHGRCTRL0@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CHT_WC_CHGRCTRL0@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	bl	_regmap_update_bits
	mov	x20, x0
	cbz	w0, LBB0_4
; %bb.3:
	ldr	w0, [x19]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	bl	_dev_err
LBB0_4:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_CHT_WC_CHGDISCTRL_FN,4,2       ; @CHT_WC_CHGDISCTRL_FN
	.comm	_CHT_WC_CHGDISCTRL,4,2          ; @CHT_WC_CHGDISCTRL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error setting sw control for CHGDIS pin: %d\n"

	.comm	_CHT_WC_CHGRCTRL0_SWCONTROL,4,2 ; @CHT_WC_CHGRCTRL0_SWCONTROL
	.comm	_CHT_WC_CHGRCTRL0_CCSM_OFF,4,2  ; @CHT_WC_CHGRCTRL0_CCSM_OFF
	.comm	_CHT_WC_CHGRCTRL0,4,2           ; @CHT_WC_CHGRCTRL0
l_.str.1:                               ; @.str.1
	.asciz	"Error setting sw control: %d\n"

	.no_dead_strip	_cht_wc_extcon_sw_control
.subsections_via_symbols
