	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dra7xx_pcie_establish_link
_dra7xx_pcie_establish_link:            ## @dra7xx_pcie_establish_link
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	callq	_to_dra7xx_pcie
	movq	%rax, %r14
	movq	8(%r12), %rbx
	movq	_EXP_CAP_ID_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%r12, %rdi
	callq	_dw_pcie_link_up
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dev_err
	jmp	LBB0_8
LBB0_2:
	cmpl	$1, (%r14)
	jne	LBB0_7
## %bb.3:
	movl	(%r12), %edi
	addl	%r15d, %edi
	movq	_PCI_EXP_LNKCAP@GOTPCREL(%rip), %r13
	addl	(%r13), %edi
	leaq	-44(%rbp), %rdx
	movl	$4, %esi
	callq	_dw_pcie_read
	movl	-44(%rbp), %edx
	movq	_PCI_EXP_LNKCAP_SLS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	andl	%edx, %esi
	movq	_PCI_EXP_LNKCAP_SLS_2_5GB@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %esi
	je	LBB0_5
## %bb.4:
	notl	%eax
	andl	%eax, %edx
	orl	%ecx, %edx
	movl	%edx, -44(%rbp)
	movl	(%r12), %edi
	addl	%r15d, %edi
	addl	(%r13), %edi
	movl	$4, %esi
	callq	_dw_pcie_write
LBB0_5:
	movl	(%r12), %edi
	addl	%r15d, %edi
	movq	_PCI_EXP_LNKCTL2@GOTPCREL(%rip), %rbx
	addl	(%rbx), %edi
	leaq	-44(%rbp), %rdx
	movl	$2, %esi
	callq	_dw_pcie_read
	movl	-44(%rbp), %edx
	movq	_PCI_EXP_LNKCAP_SLS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	andl	%edx, %esi
	movq	_PCI_EXP_LNKCAP_SLS_2_5GB@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %esi
	je	LBB0_7
## %bb.6:
	notl	%eax
	andl	%eax, %edx
	orl	%ecx, %edx
	movl	%edx, -44(%rbp)
	addl	(%r12), %r15d
	addl	(%rbx), %r15d
	movl	%r15d, %edi
	movl	$2, %esi
	callq	_dw_pcie_write
LBB0_7:
	movq	_PCIECTRL_DRA7XX_CONF_DEVICE_CMD@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_dra7xx_pcie_readl
	movq	_LTSSM_EN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, -44(%rbp)
	movl	(%rbx), %esi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_dra7xx_pcie_writel
LBB0_8:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EXP_CAP_ID_OFFSET,4,2          ## @EXP_CAP_ID_OFFSET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"link is already up\n"

	.comm	_PCI_EXP_LNKCAP,4,2             ## @PCI_EXP_LNKCAP
	.comm	_PCI_EXP_LNKCAP_SLS,4,2         ## @PCI_EXP_LNKCAP_SLS
	.comm	_PCI_EXP_LNKCAP_SLS_2_5GB,4,2   ## @PCI_EXP_LNKCAP_SLS_2_5GB
	.comm	_PCI_EXP_LNKCTL2,4,2            ## @PCI_EXP_LNKCTL2
	.comm	_PCIECTRL_DRA7XX_CONF_DEVICE_CMD,4,2 ## @PCIECTRL_DRA7XX_CONF_DEVICE_CMD
	.comm	_LTSSM_EN,4,2                   ## @LTSSM_EN
	.no_dead_strip	_dra7xx_pcie_establish_link
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dra7xx_pcie_establish_link
_dra7xx_pcie_establish_link:            ; @dra7xx_pcie_establish_link
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x0
	bl	_to_dra7xx_pcie
	mov	x19, x0
	ldr	x21, [x20, #8]
Lloh0:
	adrp	x8, _EXP_CAP_ID_OFFSET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EXP_CAP_ID_OFFSET@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	mov	x0, x20
	bl	_dw_pcie_link_up
	cbz	x0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	b	LBB0_8
LBB0_2:
	ldr	w8, [x19]
	cmp	w8, #1
	b.ne	LBB0_7
; %bb.3:
	ldr	w8, [x20]
Lloh5:
	adrp	x24, _PCI_EXP_LNKCAP@GOTPAGE
Lloh6:
	ldr	x24, [x24, _PCI_EXP_LNKCAP@GOTPAGEOFF]
	ldr	w9, [x24]
	add	w8, w8, w22
	add	w0, w8, w9
	add	x2, sp, #12
	mov	w1, #4
	bl	_dw_pcie_read
	ldr	w8, [sp, #12]
Lloh7:
	adrp	x21, _PCI_EXP_LNKCAP_SLS@GOTPAGE
Lloh8:
	ldr	x21, [x21, _PCI_EXP_LNKCAP_SLS@GOTPAGEOFF]
	ldr	w9, [x21]
	and	w11, w9, w8
Lloh9:
	adrp	x23, _PCI_EXP_LNKCAP_SLS_2_5GB@GOTPAGE
Lloh10:
	ldr	x23, [x23, _PCI_EXP_LNKCAP_SLS_2_5GB@GOTPAGEOFF]
	ldr	w10, [x23]
	cmp	w11, w10
	b.eq	LBB0_5
; %bb.4:
	bic	w8, w8, w9
	orr	w2, w8, w10
	str	w2, [sp, #12]
	ldr	w8, [x20]
	ldr	w9, [x24]
	add	w8, w8, w22
	add	w0, w8, w9
	mov	w1, #4
	bl	_dw_pcie_write
LBB0_5:
	ldr	w8, [x20]
Lloh11:
	adrp	x24, _PCI_EXP_LNKCTL2@GOTPAGE
Lloh12:
	ldr	x24, [x24, _PCI_EXP_LNKCTL2@GOTPAGEOFF]
	ldr	w9, [x24]
	add	w8, w8, w22
	add	w0, w8, w9
	add	x2, sp, #12
	mov	w1, #2
	bl	_dw_pcie_read
	ldr	w8, [sp, #12]
	ldr	w9, [x21]
	and	w11, w9, w8
	ldr	w10, [x23]
	cmp	w11, w10
	b.eq	LBB0_7
; %bb.6:
	bic	w8, w8, w9
	orr	w2, w8, w10
	str	w2, [sp, #12]
	ldr	w8, [x20]
	ldr	w9, [x24]
	add	w8, w8, w22
	add	w0, w8, w9
	mov	w1, #2
	bl	_dw_pcie_write
LBB0_7:
Lloh13:
	adrp	x20, _PCIECTRL_DRA7XX_CONF_DEVICE_CMD@GOTPAGE
Lloh14:
	ldr	x20, [x20, _PCIECTRL_DRA7XX_CONF_DEVICE_CMD@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_dra7xx_pcie_readl
Lloh15:
	adrp	x8, _LTSSM_EN@GOTPAGE
Lloh16:
	ldr	x8, [x8, _LTSSM_EN@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	orr	w2, w8, w0
	str	w2, [sp, #12]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_dra7xx_pcie_writel
LBB0_8:
	mov	w0, #0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EXP_CAP_ID_OFFSET,4,2          ; @EXP_CAP_ID_OFFSET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"link is already up\n"

	.comm	_PCI_EXP_LNKCAP,4,2             ; @PCI_EXP_LNKCAP
	.comm	_PCI_EXP_LNKCAP_SLS,4,2         ; @PCI_EXP_LNKCAP_SLS
	.comm	_PCI_EXP_LNKCAP_SLS_2_5GB,4,2   ; @PCI_EXP_LNKCAP_SLS_2_5GB
	.comm	_PCI_EXP_LNKCTL2,4,2            ; @PCI_EXP_LNKCTL2
	.comm	_PCIECTRL_DRA7XX_CONF_DEVICE_CMD,4,2 ; @PCIECTRL_DRA7XX_CONF_DEVICE_CMD
	.comm	_LTSSM_EN,4,2                   ; @LTSSM_EN
	.no_dead_strip	_dra7xx_pcie_establish_link
.subsections_via_symbols
