	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function histb_pcie_establish_link
_histb_pcie_establish_link:             ## @histb_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_to_dw_pcie_from_pp
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_to_histb_pcie
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_dw_pcie_link_up
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_info
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_PCIE_SYS_CTRL0@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_histb_pcie_readl
	movq	_PCIE_DEVICE_TYPE_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movq	_PCIE_WM_RC@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_histb_pcie_writel
	movq	%r15, %rdi
	callq	_dw_pcie_setup_rc
	movq	_PCIE_SYS_CTRL7@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_histb_pcie_readl
	movq	_PCIE_APP_LTSSM_ENABLE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	(%r15), %esi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_histb_pcie_writel
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dw_pcie_wait_for_link          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Link already up\n"

	.comm	_PCIE_SYS_CTRL0,4,2             ## @PCIE_SYS_CTRL0
	.comm	_PCIE_DEVICE_TYPE_MASK,4,2      ## @PCIE_DEVICE_TYPE_MASK
	.comm	_PCIE_WM_RC,4,2                 ## @PCIE_WM_RC
	.comm	_PCIE_SYS_CTRL7,4,2             ## @PCIE_SYS_CTRL7
	.comm	_PCIE_APP_LTSSM_ENABLE,4,2      ## @PCIE_APP_LTSSM_ENABLE
	.no_dead_strip	_histb_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 histb_pcie_establish_link
_histb_pcie_establish_link:             ; @histb_pcie_establish_link
	.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, x0
	bl	_to_dw_pcie_from_pp
	mov	x19, x0
	bl	_to_histb_pcie
	mov	x20, x0
	mov	x0, x19
	bl	_dw_pcie_link_up
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w0, [x19]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_info
	mov	w0, #0
	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_2:
Lloh2:
	adrp	x22, _PCIE_SYS_CTRL0@GOTPAGE
Lloh3:
	ldr	x22, [x22, _PCIE_SYS_CTRL0@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x20
	bl	_histb_pcie_readl
Lloh4:
	adrp	x8, _PCIE_DEVICE_TYPE_MASK@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PCIE_DEVICE_TYPE_MASK@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	bic	w8, w0, w8
Lloh7:
	adrp	x9, _PCIE_WM_RC@GOTPAGE
Lloh8:
	ldr	x9, [x9, _PCIE_WM_RC@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	orr	w2, w8, w9
	ldr	w1, [x22]
	mov	x0, x20
	bl	_histb_pcie_writel
	mov	x0, x21
	bl	_dw_pcie_setup_rc
Lloh10:
	adrp	x21, _PCIE_SYS_CTRL7@GOTPAGE
Lloh11:
	ldr	x21, [x21, _PCIE_SYS_CTRL7@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_histb_pcie_readl
Lloh12:
	adrp	x8, _PCIE_APP_LTSSM_ENABLE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PCIE_APP_LTSSM_ENABLE@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	orr	w2, w8, w0
	ldr	w1, [x21]
	mov	x0, x20
	bl	_histb_pcie_writel
	mov	x0, x19
	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
	b	_dw_pcie_wait_for_link
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Link already up\n"

	.comm	_PCIE_SYS_CTRL0,4,2             ; @PCIE_SYS_CTRL0
	.comm	_PCIE_DEVICE_TYPE_MASK,4,2      ; @PCIE_DEVICE_TYPE_MASK
	.comm	_PCIE_WM_RC,4,2                 ; @PCIE_WM_RC
	.comm	_PCIE_SYS_CTRL7,4,2             ; @PCIE_SYS_CTRL7
	.comm	_PCIE_APP_LTSSM_ENABLE,4,2      ; @PCIE_APP_LTSSM_ENABLE
	.no_dead_strip	_histb_pcie_establish_link
.subsections_via_symbols
