	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rockchip_usb3_phy_power_on
_rockchip_usb3_phy_power_on:            ## @rockchip_usb3_phy_power_on
	.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
	callq	_phy_get_drvdata
	movq	%rax, %rbx
	movq	16(%rax), %r13
	leaq	4(%rax), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	callq	_tcphy_get_mode
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	_MODE_DFP_USB@GOTPCREL(%rip), %rcx
	movq	_MODE_UFP_USB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	testl	%r15d, %eax
	je	LBB0_3
## %bb.4:
	movl	(%rbx), %eax
	xorl	%r12d, %r12d
	cmpl	%r15d, %eax
	je	LBB0_15
## %bb.5:
	movq	_MODE_DISCONNECT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_7
## %bb.6:
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_tcphy_phy_init
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_15
LBB0_7:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	$100, %r14d
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	8(%rbx), %edi
	movl	4(%r13), %esi
	leaq	-44(%rbp), %rdx
	callq	_regmap_read
	movl	-44(%rbp), %r12d
	movl	(%r13), %edi
	callq	_BIT
	testl	%r12d, %eax
	je	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	$10, %edi
	movl	$20, %esi
	callq	_usleep_range
	decl	%r14d
	jne	LBB0_8
## %bb.11:
	movl	(%rbx), %eax
	movq	_MODE_DISCONNECT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_13
## %bb.12:
	movq	%rbx, %rdi
	callq	_tcphy_phy_deinit
LBB0_13:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_14
LBB0_1:
	movl	%r15d, %r12d
	jmp	LBB0_15
LBB0_3:
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_tcphy_cfg_usb3_to_usb2_only
	xorl	%r12d, %r12d
	jmp	LBB0_15
LBB0_9:
	movq	_MODE_UFP_USB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_MODE_DFP_USB@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	andl	%r15d, %eax
	orl	%eax, (%rbx)
	xorl	%r12d, %r12d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_tcphy_cfg_usb3_to_usb2_only
LBB0_14:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
LBB0_15:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MODE_DFP_USB,4,2               ## @MODE_DFP_USB
	.comm	_MODE_UFP_USB,4,2               ## @MODE_UFP_USB
	.comm	_MODE_DISCONNECT,4,2            ## @MODE_DISCONNECT
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_rockchip_usb3_phy_power_on
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rockchip_usb3_phy_power_on
_rockchip_usb3_phy_power_on:            ; @rockchip_usb3_phy_power_on
	.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
	bl	_phy_get_drvdata
	mov	x20, x0
	ldr	x23, [x0, #16]
	add	x19, x0, #4
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x20
	bl	_tcphy_get_mode
	mov	x21, x0
	tbnz	w0, #31, LBB0_11
; %bb.1:
Lloh0:
	adrp	x24, _MODE_DFP_USB@GOTPAGE
Lloh1:
	ldr	x24, [x24, _MODE_DFP_USB@GOTPAGEOFF]
	ldr	w8, [x24]
Lloh2:
	adrp	x25, _MODE_UFP_USB@GOTPAGE
Lloh3:
	ldr	x25, [x25, _MODE_UFP_USB@GOTPAGEOFF]
	ldr	w9, [x25]
	orr	w8, w9, w8
	tst	w8, w21
	b.eq	LBB0_12
; %bb.2:
	ldr	w8, [x20]
	cmp	w8, w21
	b.eq	LBB0_15
; %bb.3:
Lloh4:
	adrp	x26, _MODE_DISCONNECT@GOTPAGE
Lloh5:
	ldr	x26, [x26, _MODE_DISCONNECT@GOTPAGEOFF]
	ldr	w9, [x26]
	cmp	w8, w9
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x20
	mov	x1, x21
	bl	_tcphy_phy_init
	mov	x22, x0
	cbnz	w0, LBB0_16
LBB0_5:
	mov	w22, #100
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20, #8]
	ldr	w1, [x23, #4]
	add	x2, sp, #12
	bl	_regmap_read
	ldr	w27, [sp, #12]
	ldr	w0, [x23]
	bl	_BIT
	tst	w0, w27
	b.eq	LBB0_13
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w0, #10
	mov	w1, #20
	bl	_usleep_range
	subs	w22, w22, #1
	b.ne	LBB0_6
; %bb.8:
	ldr	w8, [x20]
	ldr	w9, [x26]
	cmp	w8, w9
	b.ne	LBB0_10
; %bb.9:
	mov	x0, x20
	bl	_tcphy_phy_deinit
LBB0_10:
Lloh6:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_16
LBB0_11:
	mov	x22, x21
	b	LBB0_16
LBB0_12:
	mov	x0, x20
	mov	w1, #1
	b	LBB0_14
LBB0_13:
	ldr	w8, [x24]
	ldr	w9, [x25]
	orr	w8, w9, w8
	and	w8, w8, w21
	ldr	w9, [x20]
	orr	w8, w8, w9
	str	w8, [x20]
	mov	x0, x20
	mov	w1, #0
LBB0_14:
	bl	_tcphy_cfg_usb3_to_usb2_only
LBB0_15:
	mov	w22, #0
LBB0_16:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x22
	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	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_MODE_DFP_USB,4,2               ; @MODE_DFP_USB
	.comm	_MODE_UFP_USB,4,2               ; @MODE_UFP_USB
	.comm	_MODE_DISCONNECT,4,2            ; @MODE_DISCONNECT
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_rockchip_usb3_phy_power_on
.subsections_via_symbols
