	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun4i_usb_phy_init
_sun4i_usb_phy_init:                    ## @sun4i_usb_phy_init
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_phy_get_drvdata
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_to_sun4i_usb_phy_data
	movq	%rax, %r14
	movl	16(%r12), %edi
	callq	_clk_prepare_enable
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_18
## %bb.1:
	movl	20(%r12), %edi
	callq	_clk_prepare_enable
	testl	%eax, %eax
	je	LBB0_4
## %bb.2:
	movl	%eax, %ebx
	jmp	LBB0_3
LBB0_4:
	movl	24(%r12), %edi
	callq	_reset_control_deassert
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %ebx
	movl	20(%r12), %edi
	callq	_clk_disable_unprepare
LBB0_3:
	movl	16(%r12), %edi
	callq	_clk_disable_unprepare
LBB0_18:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	16(%r14), %rax
	movq	(%rax), %rcx
	movq	_sun8i_a83t_phy@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	je	LBB0_8
## %bb.7:
	movq	_sun50i_h6_phy@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	je	LBB0_8
## %bb.10:
	movq	8(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_13
## %bb.11:
	cmpq	$0, 16(%rax)
	je	LBB0_13
## %bb.12:
	movq	_REG_PMU_UNK1@GOTPCREL(%rip), %rbx
	addq	(%rbx), %rdi
	callq	_readl
	andl	$-3, %eax
	movq	(%rbx), %rsi
	addq	8(%r12), %rsi
	movl	%eax, %edi
	callq	_writel
LBB0_13:
	cmpq	$0, (%r12)
	jne	LBB0_15
## %bb.14:
	movq	_PHY_RES45_CAL_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$1, %edx
	movl	$1, %ecx
	callq	_sun4i_usb_phy_write
LBB0_15:
	movq	_PHY_TX_AMPLITUDE_TUNE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$20, %edx
	movl	$5, %ecx
	callq	_sun4i_usb_phy_write
	movq	_PHY_DISCON_TH_SEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	16(%r14), %rax
	movl	8(%rax), %edx
	movq	%r12, %rdi
	movl	$2, %ecx
	callq	_sun4i_usb_phy_write
	jmp	LBB0_16
LBB0_8:
	cmpq	$0, (%r12)
	jne	LBB0_16
## %bb.9:
	movq	24(%rax), %rdi
	addq	24(%r14), %rdi
	callq	_readl
	movq	_PHY_CTL_VBUSVLDEXT@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_PHY_CTL_SIDDQ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	notl	%edi
	andl	%eax, %edi
	movq	16(%r14), %rax
	movq	24(%rax), %rsi
	addq	24(%r14), %rsi
	callq	_writel
LBB0_16:
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_sun4i_usb_phy_passby
	xorl	%ebx, %ebx
	cmpq	$0, (%r12)
	jne	LBB0_18
## %bb.17:
	movl	$1, (%r14)
	movq	_ISCR_DPDM_PULLUP_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_sun4i_usb_phy0_update_iscr
	movq	_ISCR_ID_PULLUP_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_sun4i_usb_phy0_update_iscr
	movq	$-1, 4(%r14)
	movq	_system_wq@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$12, %r14
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_queue_delayed_work
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_sun8i_a83t_phy,8,3             ## @sun8i_a83t_phy
	.comm	_sun50i_h6_phy,8,3              ## @sun50i_h6_phy
	.comm	_PHY_CTL_VBUSVLDEXT,4,2         ## @PHY_CTL_VBUSVLDEXT
	.comm	_PHY_CTL_SIDDQ,4,2              ## @PHY_CTL_SIDDQ
	.comm	_REG_PMU_UNK1,8,3               ## @REG_PMU_UNK1
	.comm	_PHY_RES45_CAL_EN,4,2           ## @PHY_RES45_CAL_EN
	.comm	_PHY_TX_AMPLITUDE_TUNE,4,2      ## @PHY_TX_AMPLITUDE_TUNE
	.comm	_PHY_DISCON_TH_SEL,4,2          ## @PHY_DISCON_TH_SEL
	.comm	_ISCR_DPDM_PULLUP_EN,4,2        ## @ISCR_DPDM_PULLUP_EN
	.comm	_ISCR_ID_PULLUP_EN,4,2          ## @ISCR_ID_PULLUP_EN
	.comm	_system_wq,4,2                  ## @system_wq
	.no_dead_strip	_sun4i_usb_phy_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sun4i_usb_phy_init
_sun4i_usb_phy_init:                    ; @sun4i_usb_phy_init
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	bl	_phy_get_drvdata
	mov	x21, x0
	bl	_to_sun4i_usb_phy_data
	mov	x20, x0
	ldr	w0, [x21, #16]
	bl	_clk_prepare_enable
	mov	x22, x0
	cbnz	w0, LBB0_6
; %bb.1:
	ldr	w0, [x21, #20]
	bl	_clk_prepare_enable
	cbz	w0, LBB0_3
; %bb.2:
	mov	x22, x0
	b	LBB0_5
LBB0_3:
	ldr	w0, [x21, #24]
	bl	_reset_control_deassert
	cbz	w0, LBB0_7
; %bb.4:
	mov	x22, x0
	ldr	w0, [x21, #20]
	bl	_clk_disable_unprepare
LBB0_5:
	ldr	w0, [x21, #16]
	bl	_clk_disable_unprepare
LBB0_6:
	mov	x0, x22
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_7:
	ldr	x8, [x20, #16]
	ldr	x9, [x8]
Lloh0:
	adrp	x10, _sun8i_a83t_phy@GOTPAGE
Lloh1:
	ldr	x10, [x10, _sun8i_a83t_phy@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
Lloh3:
	adrp	x11, _sun50i_h6_phy@GOTPAGE
Lloh4:
	ldr	x11, [x11, _sun50i_h6_phy@GOTPAGEOFF]
Lloh5:
	ldr	x11, [x11]
	cmp	x9, x10
	ccmp	x9, x11, #4, ne
	b.ne	LBB0_10
; %bb.8:
	ldr	x9, [x21]
	cbnz	x9, LBB0_16
; %bb.9:
	ldr	x9, [x20, #24]
	ldr	x8, [x8, #24]
	add	x0, x8, x9
	bl	_readl
Lloh6:
	adrp	x8, _PHY_CTL_VBUSVLDEXT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PHY_CTL_VBUSVLDEXT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	orr	w8, w8, w0
Lloh9:
	adrp	x9, _PHY_CTL_SIDDQ@GOTPAGE
Lloh10:
	ldr	x9, [x9, _PHY_CTL_SIDDQ@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	bic	w0, w8, w9
	ldp	x9, x8, [x20, #16]
	ldr	x9, [x9, #24]
	add	x1, x9, x8
	bl	_writel
	b	LBB0_16
LBB0_10:
	ldr	x9, [x21, #8]
	cbz	x9, LBB0_13
; %bb.11:
	ldr	x8, [x8, #16]
	cbz	x8, LBB0_13
; %bb.12:
Lloh12:
	adrp	x22, _REG_PMU_UNK1@GOTPAGE
Lloh13:
	ldr	x22, [x22, _REG_PMU_UNK1@GOTPAGEOFF]
	ldr	x8, [x22]
	add	x0, x8, x9
	bl	_readl
	and	w0, w0, #0xfffffffd
	ldr	x8, [x21, #8]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_writel
LBB0_13:
	ldr	x8, [x21]
	cbnz	x8, LBB0_15
; %bb.14:
Lloh14:
	adrp	x8, _PHY_RES45_CAL_EN@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PHY_RES45_CAL_EN@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x21
	mov	w2, #1
	mov	w3, #1
	bl	_sun4i_usb_phy_write
LBB0_15:
Lloh17:
	adrp	x8, _PHY_TX_AMPLITUDE_TUNE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PHY_TX_AMPLITUDE_TUNE@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x21
	mov	w2, #20
	mov	w3, #5
	bl	_sun4i_usb_phy_write
Lloh20:
	adrp	x8, _PHY_DISCON_TH_SEL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _PHY_DISCON_TH_SEL@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	ldr	x8, [x20, #16]
	ldr	w2, [x8, #8]
	mov	x0, x21
	mov	w3, #2
	bl	_sun4i_usb_phy_write
LBB0_16:
	mov	w22, #1
	mov	x0, x21
	mov	w1, #1
	bl	_sun4i_usb_phy_passby
	ldr	x8, [x21]
	cbnz	x8, LBB0_18
; %bb.17:
	str	w22, [x20]
Lloh23:
	adrp	x8, _ISCR_DPDM_PULLUP_EN@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ISCR_DPDM_PULLUP_EN@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_sun4i_usb_phy0_update_iscr
Lloh26:
	adrp	x8, _ISCR_ID_PULLUP_EN@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ISCR_ID_PULLUP_EN@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_sun4i_usb_phy0_update_iscr
	movi.2d	v0, #0xffffffffffffffff
	stur	d0, [x20, #4]
Lloh29:
	adrp	x8, _system_wq@GOTPAGE
Lloh30:
	ldr	x8, [x8, _system_wq@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
	add	x1, x20, #12
	mov	w2, #0
	bl	_queue_delayed_work
LBB0_18:
	mov	w22, #0
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_sun8i_a83t_phy,8,3             ; @sun8i_a83t_phy
	.comm	_sun50i_h6_phy,8,3              ; @sun50i_h6_phy
	.comm	_PHY_CTL_VBUSVLDEXT,4,2         ; @PHY_CTL_VBUSVLDEXT
	.comm	_PHY_CTL_SIDDQ,4,2              ; @PHY_CTL_SIDDQ
	.comm	_REG_PMU_UNK1,8,3               ; @REG_PMU_UNK1
	.comm	_PHY_RES45_CAL_EN,4,2           ; @PHY_RES45_CAL_EN
	.comm	_PHY_TX_AMPLITUDE_TUNE,4,2      ; @PHY_TX_AMPLITUDE_TUNE
	.comm	_PHY_DISCON_TH_SEL,4,2          ; @PHY_DISCON_TH_SEL
	.comm	_ISCR_DPDM_PULLUP_EN,4,2        ; @ISCR_DPDM_PULLUP_EN
	.comm	_ISCR_ID_PULLUP_EN,4,2          ; @ISCR_ID_PULLUP_EN
	.comm	_system_wq,4,2                  ; @system_wq
	.no_dead_strip	_sun4i_usb_phy_init
.subsections_via_symbols
