	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rockchip_usb2phy_otg_port_init
_rockchip_usb2phy_otg_port_init:        ## @rockchip_usb2phy_otg_port_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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	_USB2PHY_PORT_OTG@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%rcx, (%rsi)
	movq	8(%rdi), %rcx
	movq	(%rax), %rax
	shlq	$2, %rax
	addq	(%rcx), %rax
	movq	%rax, 56(%rsi)
	movq	_OTG_STATE_UNDEFINED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 52(%rsi)
	movq	$1, 8(%rsi)
	leaq	48(%rsi), %rdi
	callq	_mutex_init
	movq	%r12, %rdi
	movl	$-1, %esi
	callq	_of_usb_get_dr_mode_by_phy
	movq	%rax, 16(%rbx)
	movq	_USB_DR_MODE_HOST@GOTPCREL(%rip), %rcx
	xorl	%r15d, %r15d
	cmpq	(%rcx), %rax
	je	LBB0_13
## %bb.1:
	movq	_USB_DR_MODE_UNKNOWN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_13
## %bb.2:
	leaq	44(%rbx), %rdi
	movq	_rockchip_chg_detect_work@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_INIT_DELAYED_WORK
	leaq	40(%rbx), %rdi
	movq	_rockchip_usb2phy_otg_sm_work@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_INIT_DELAYED_WORK
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_of_irq_get_byname
	movq	%rax, 24(%rbx)
	testq	%rax, %rax
	jle	LBB0_6
## %bb.3:
	movl	(%r14), %edi
	movq	_rockchip_usb2phy_otg_mux_irq@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_IRQF_ONESHOT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r8d
	movq	%rbx, (%rsp)
	leaq	L_.str.1(%rip), %r9
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_devm_request_threaded_irq
	testl	%eax, %eax
	je	LBB0_10
## %bb.4:
	movl	%eax, %r12d
	movl	(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_5
LBB0_6:
	leaq	L_.str.3(%rip), %rsi
	movq	%r12, %rdi
	callq	_of_irq_get_byname
	movl	%eax, 32(%rbx)
	movl	(%r14), %edi
	testl	%eax, %eax
	js	LBB0_7
## %bb.8:
	movq	_rockchip_usb2phy_bvalid_irq@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_IRQF_ONESHOT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r8d
	movq	%rbx, (%rsp)
	leaq	L_.str.5(%rip), %r9
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_devm_request_threaded_irq
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %r12d
	movl	(%r14), %edi
	leaq	L_.str.6(%rip), %rsi
LBB0_5:
	callq	_dev_err
	movl	%r12d, %r15d
	jmp	LBB0_13
LBB0_10:
	movl	4(%r14), %edi
	callq	_IS_ERR
	testl	%eax, %eax
	jne	LBB0_13
## %bb.11:
	movq	_rockchip_otg_event@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%rbx)
	addq	$36, %rbx
	movl	(%r14), %edi
	movl	4(%r14), %esi
	movq	_EXTCON_USB_HOST@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rcx
	callq	_devm_extcon_register_notifier
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str.7(%rip), %rsi
	callq	_dev_err
	movl	%ebx, %r15d
	jmp	LBB0_13
LBB0_7:
	leaq	L_.str.4(%rip), %rsi
	callq	_dev_err
	movl	32(%rbx), %r15d
LBB0_13:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_USB2PHY_PORT_OTG,8,3           ## @USB2PHY_PORT_OTG
	.comm	_OTG_STATE_UNDEFINED,4,2        ## @OTG_STATE_UNDEFINED
	.comm	_USB_DR_MODE_HOST,8,3           ## @USB_DR_MODE_HOST
	.comm	_USB_DR_MODE_UNKNOWN,8,3        ## @USB_DR_MODE_UNKNOWN
	.comm	_rockchip_chg_detect_work,4,2   ## @rockchip_chg_detect_work
	.comm	_rockchip_usb2phy_otg_sm_work,4,2 ## @rockchip_usb2phy_otg_sm_work
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"otg-mux"

	.comm	_rockchip_usb2phy_otg_mux_irq,4,2 ## @rockchip_usb2phy_otg_mux_irq
	.comm	_IRQF_ONESHOT,4,2               ## @IRQF_ONESHOT
L_.str.1:                               ## @.str.1
	.asciz	"rockchip_usb2phy_otg"

L_.str.2:                               ## @.str.2
	.asciz	"failed to request otg-mux irq handle\n"

L_.str.3:                               ## @.str.3
	.asciz	"otg-bvalid"

L_.str.4:                               ## @.str.4
	.asciz	"no vbus valid irq provided\n"

	.comm	_rockchip_usb2phy_bvalid_irq,4,2 ## @rockchip_usb2phy_bvalid_irq
L_.str.5:                               ## @.str.5
	.asciz	"rockchip_usb2phy_bvalid"

L_.str.6:                               ## @.str.6
	.asciz	"failed to request otg-bvalid irq handle\n"

	.comm	_rockchip_otg_event,4,2         ## @rockchip_otg_event
	.comm	_EXTCON_USB_HOST,4,2            ## @EXTCON_USB_HOST
L_.str.7:                               ## @.str.7
	.asciz	"register USB HOST notifier failed\n"

	.no_dead_strip	_rockchip_usb2phy_otg_port_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function rockchip_usb2phy_otg_port_init
lCPI0_0:
	.long	1                               ; 0x1
	.long	0                               ; 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_rockchip_usb2phy_otg_port_init:        ; @rockchip_usb2phy_otg_port_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	x21, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _USB2PHY_PORT_OTG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _USB2PHY_PORT_OTG@GOTPAGEOFF]
	ldr	x9, [x8]
	str	x9, [x1]
	ldr	x9, [x0, #8]
	ldr	x9, [x9]
	ldr	x8, [x8]
	add	x8, x9, x8, lsl #2
	str	x8, [x1, #56]
Lloh2:
	adrp	x8, _OTG_STATE_UNDEFINED@GOTPAGE
Lloh3:
	ldr	x8, [x8, _OTG_STATE_UNDEFINED@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	str	w8, [x1, #52]
Lloh5:
	adrp	x8, lCPI0_0@PAGE
Lloh6:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x1, #8]
	add	x0, x1, #48
	bl	_mutex_init
	mov	x0, x21
	mov	w1, #-1
	bl	_of_usb_get_dr_mode_by_phy
	str	x0, [x20, #16]
Lloh7:
	adrp	x8, _USB_DR_MODE_HOST@GOTPAGE
Lloh8:
	ldr	x8, [x8, _USB_DR_MODE_HOST@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
Lloh10:
	adrp	x9, _USB_DR_MODE_UNKNOWN@GOTPAGE
Lloh11:
	ldr	x9, [x9, _USB_DR_MODE_UNKNOWN@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x0, x8
	ccmp	x0, x9, #4, ne
	b.ne	LBB0_2
LBB0_1:
	mov	w21, #0
	b	LBB0_13
LBB0_2:
	add	x0, x20, #44
Lloh13:
	adrp	x8, _rockchip_chg_detect_work@GOTPAGE
Lloh14:
	ldr	x8, [x8, _rockchip_chg_detect_work@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	bl	_INIT_DELAYED_WORK
	add	x0, x20, #40
Lloh16:
	adrp	x8, _rockchip_usb2phy_otg_sm_work@GOTPAGE
Lloh17:
	ldr	x8, [x8, _rockchip_usb2phy_otg_sm_work@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	bl	_INIT_DELAYED_WORK
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_of_irq_get_byname
	str	x0, [x20, #24]
	cmp	x0, #1
	b.lt	LBB0_5
; %bb.3:
	mov	x1, x0
	ldr	w0, [x19]
Lloh21:
	adrp	x8, _rockchip_usb2phy_otg_mux_irq@GOTPAGE
Lloh22:
	ldr	x8, [x8, _rockchip_usb2phy_otg_mux_irq@GOTPAGEOFF]
Lloh23:
	ldr	w3, [x8]
Lloh24:
	adrp	x8, _IRQF_ONESHOT@GOTPAGE
Lloh25:
	ldr	x8, [x8, _IRQF_ONESHOT@GOTPAGEOFF]
Lloh26:
	ldr	w4, [x8]
Lloh27:
	adrp	x5, l_.str.1@PAGE
Lloh28:
	add	x5, x5, l_.str.1@PAGEOFF
                                        ; kill: def $w1 killed $w1 killed $x1
	mov	x2, #0
	mov	x6, x20
	bl	_devm_request_threaded_irq
	cbz	w0, LBB0_8
; %bb.4:
	mov	x21, x0
	ldr	w0, [x19]
Lloh29:
	adrp	x1, l_.str.2@PAGE
Lloh30:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_11
LBB0_5:
Lloh31:
	adrp	x1, l_.str.3@PAGE
Lloh32:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_of_irq_get_byname
	mov	x1, x0
	str	w1, [x20, #32]
	ldr	w0, [x19]
	tbnz	w1, #31, LBB0_12
; %bb.6:
Lloh33:
	adrp	x8, _rockchip_usb2phy_bvalid_irq@GOTPAGE
Lloh34:
	ldr	x8, [x8, _rockchip_usb2phy_bvalid_irq@GOTPAGEOFF]
Lloh35:
	ldr	w3, [x8]
Lloh36:
	adrp	x8, _IRQF_ONESHOT@GOTPAGE
Lloh37:
	ldr	x8, [x8, _IRQF_ONESHOT@GOTPAGEOFF]
Lloh38:
	ldr	w4, [x8]
Lloh39:
	adrp	x5, l_.str.5@PAGE
Lloh40:
	add	x5, x5, l_.str.5@PAGEOFF
                                        ; kill: def $w1 killed $w1 killed $x1
	mov	x2, #0
	mov	x6, x20
	bl	_devm_request_threaded_irq
	cbz	w0, LBB0_8
; %bb.7:
	mov	x21, x0
	ldr	w0, [x19]
Lloh41:
	adrp	x1, l_.str.6@PAGE
Lloh42:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_11
LBB0_8:
	ldr	w0, [x19, #4]
	bl	_IS_ERR
	cbnz	w0, LBB0_1
; %bb.9:
Lloh43:
	adrp	x8, _rockchip_otg_event@GOTPAGE
Lloh44:
	ldr	x8, [x8, _rockchip_otg_event@GOTPAGEOFF]
Lloh45:
	ldr	w8, [x8]
	str	w8, [x20, #36]!
	ldp	w0, w1, [x19]
Lloh46:
	adrp	x8, _EXTCON_USB_HOST@GOTPAGE
Lloh47:
	ldr	x8, [x8, _EXTCON_USB_HOST@GOTPAGEOFF]
Lloh48:
	ldr	w2, [x8]
	mov	x3, x20
	bl	_devm_extcon_register_notifier
	mov	x21, x0
	cbz	w0, LBB0_13
; %bb.10:
	ldr	w0, [x19]
Lloh49:
	adrp	x1, l_.str.7@PAGE
Lloh50:
	add	x1, x1, l_.str.7@PAGEOFF
LBB0_11:
	bl	_dev_err
	b	LBB0_13
LBB0_12:
Lloh51:
	adrp	x1, l_.str.4@PAGE
Lloh52:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_err
	ldr	w21, [x20, #32]
LBB0_13:
	mov	x0, x21
	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
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdr	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpAdd	Lloh49, Lloh50
	.loh AdrpAdd	Lloh51, Lloh52
	.cfi_endproc
                                        ; -- End function
	.comm	_USB2PHY_PORT_OTG,8,3           ; @USB2PHY_PORT_OTG
	.comm	_OTG_STATE_UNDEFINED,4,2        ; @OTG_STATE_UNDEFINED
	.comm	_USB_DR_MODE_HOST,8,3           ; @USB_DR_MODE_HOST
	.comm	_USB_DR_MODE_UNKNOWN,8,3        ; @USB_DR_MODE_UNKNOWN
	.comm	_rockchip_chg_detect_work,4,2   ; @rockchip_chg_detect_work
	.comm	_rockchip_usb2phy_otg_sm_work,4,2 ; @rockchip_usb2phy_otg_sm_work
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"otg-mux"

	.comm	_rockchip_usb2phy_otg_mux_irq,4,2 ; @rockchip_usb2phy_otg_mux_irq
	.comm	_IRQF_ONESHOT,4,2               ; @IRQF_ONESHOT
l_.str.1:                               ; @.str.1
	.asciz	"rockchip_usb2phy_otg"

l_.str.2:                               ; @.str.2
	.asciz	"failed to request otg-mux irq handle\n"

l_.str.3:                               ; @.str.3
	.asciz	"otg-bvalid"

l_.str.4:                               ; @.str.4
	.asciz	"no vbus valid irq provided\n"

	.comm	_rockchip_usb2phy_bvalid_irq,4,2 ; @rockchip_usb2phy_bvalid_irq
l_.str.5:                               ; @.str.5
	.asciz	"rockchip_usb2phy_bvalid"

l_.str.6:                               ; @.str.6
	.asciz	"failed to request otg-bvalid irq handle\n"

	.comm	_rockchip_otg_event,4,2         ; @rockchip_otg_event
	.comm	_EXTCON_USB_HOST,4,2            ; @EXTCON_USB_HOST
l_.str.7:                               ; @.str.7
	.asciz	"register USB HOST notifier failed\n"

	.no_dead_strip	_rockchip_usb2phy_otg_port_init
.subsections_via_symbols
