	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function twl4030_usb_remove
_twl4030_usb_remove:                    ## @twl4030_usb_remove
	.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, %r14
	callq	_platform_get_drvdata
	movq	%rax, %rbx
	leaq	12(%rax), %rdi
	callq	_usb_remove_phy
	movl	(%rbx), %edi
	callq	_pm_runtime_get_sync
	leaq	8(%rbx), %rdi
	callq	_cancel_delayed_work
	movl	(%rbx), %edi
	movq	_dev_attr_vbus@GOTPCREL(%rip), %rsi
	callq	_device_remove_file
	movq	%rbx, %rdi
	movl	$-1, %esi
	callq	_twl4030_usb_set_mode
	movl	4(%rbx), %edi
	callq	_cable_present
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	(%rbx), %edi
	callq	_pm_runtime_put_noidle
LBB0_2:
	movl	(%rbx), %edi
	callq	_pm_runtime_mark_last_busy
	movq	%r14, %rdi
	callq	_pm_runtime_dont_use_autosuspend
	movl	(%rbx), %edi
	callq	_pm_runtime_put_sync
	movl	(%rbx), %edi
	callq	_pm_runtime_disable
	movq	_PHY_CLK_CTRL@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_twl4030_usb_read
	testl	%eax, %eax
	js	LBB0_4
## %bb.3:
	movq	_PHY_CLK_CTRL_CLOCKGATING_EN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_PHY_CLK_CTRL_CLK32K_EN@GOTPCREL(%rip), %rcx
	movq	_REQ_PHY_DPLL_CLK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_twl4030_usb_write
LBB0_4:
	movq	_POWER_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_POWER_CTRL_OTG_ENAB@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_twl4030_usb_clear_bits
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_dev_attr_vbus,4,2              ## @dev_attr_vbus
	.comm	_PHY_CLK_CTRL,4,2               ## @PHY_CLK_CTRL
	.comm	_PHY_CLK_CTRL_CLOCKGATING_EN,4,2 ## @PHY_CLK_CTRL_CLOCKGATING_EN
	.comm	_PHY_CLK_CTRL_CLK32K_EN,4,2     ## @PHY_CLK_CTRL_CLK32K_EN
	.comm	_REQ_PHY_DPLL_CLK,4,2           ## @REQ_PHY_DPLL_CLK
	.comm	_POWER_CTRL,4,2                 ## @POWER_CTRL
	.comm	_POWER_CTRL_OTG_ENAB,4,2        ## @POWER_CTRL_OTG_ENAB
	.no_dead_strip	_twl4030_usb_remove
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function twl4030_usb_remove
_twl4030_usb_remove:                    ; @twl4030_usb_remove
	.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, x0
	bl	_platform_get_drvdata
	mov	x19, x0
	add	x0, x0, #12
	bl	_usb_remove_phy
	ldr	w0, [x19]
	bl	_pm_runtime_get_sync
	add	x0, x19, #8
	bl	_cancel_delayed_work
	ldr	w0, [x19]
Lloh0:
	adrp	x1, _dev_attr_vbus@GOTPAGE
Lloh1:
	ldr	x1, [x1, _dev_attr_vbus@GOTPAGEOFF]
	bl	_device_remove_file
	mov	x0, x19
	mov	w1, #-1
	bl	_twl4030_usb_set_mode
	ldr	w0, [x19, #4]
	bl	_cable_present
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w0, [x19]
	bl	_pm_runtime_put_noidle
LBB0_2:
	ldr	w0, [x19]
	bl	_pm_runtime_mark_last_busy
	mov	x0, x20
	bl	_pm_runtime_dont_use_autosuspend
	ldr	w0, [x19]
	bl	_pm_runtime_put_sync
	ldr	w0, [x19]
	bl	_pm_runtime_disable
Lloh2:
	adrp	x20, _PHY_CLK_CTRL@GOTPAGE
Lloh3:
	ldr	x20, [x20, _PHY_CLK_CTRL@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_twl4030_usb_read
	tbnz	w0, #31, LBB0_4
; %bb.3:
Lloh4:
	adrp	x8, _PHY_CLK_CTRL_CLOCKGATING_EN@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PHY_CLK_CTRL_CLOCKGATING_EN@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	orr	w8, w8, w0
Lloh7:
	adrp	x9, _PHY_CLK_CTRL_CLK32K_EN@GOTPAGE
Lloh8:
	ldr	x9, [x9, _PHY_CLK_CTRL_CLK32K_EN@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
Lloh10:
	adrp	x10, _REQ_PHY_DPLL_CLK@GOTPAGE
Lloh11:
	ldr	x10, [x10, _REQ_PHY_DPLL_CLK@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
	orr	w9, w10, w9
	bic	w2, w8, w9
	ldr	w1, [x20]
	mov	x0, x19
	bl	_twl4030_usb_write
LBB0_4:
Lloh13:
	adrp	x8, _POWER_CTRL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _POWER_CTRL@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x8, _POWER_CTRL_OTG_ENAB@GOTPAGE
Lloh17:
	ldr	x8, [x8, _POWER_CTRL_OTG_ENAB@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_twl4030_usb_clear_bits
	mov	w0, #0
	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 AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_dev_attr_vbus,4,2              ; @dev_attr_vbus
	.comm	_PHY_CLK_CTRL,4,2               ; @PHY_CLK_CTRL
	.comm	_PHY_CLK_CTRL_CLOCKGATING_EN,4,2 ; @PHY_CLK_CTRL_CLOCKGATING_EN
	.comm	_PHY_CLK_CTRL_CLK32K_EN,4,2     ; @PHY_CLK_CTRL_CLK32K_EN
	.comm	_REQ_PHY_DPLL_CLK,4,2           ; @REQ_PHY_DPLL_CLK
	.comm	_POWER_CTRL,4,2                 ; @POWER_CTRL
	.comm	_POWER_CTRL_OTG_ENAB,4,2        ; @POWER_CTRL_OTG_ENAB
	.no_dead_strip	_twl4030_usb_remove
.subsections_via_symbols
