	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pcie_wait_for_link             ## -- Begin function pcie_wait_for_link
	.p2align	4, 0x90
_pcie_wait_for_link:                    ## @pcie_wait_for_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
	cmpl	$0, (%rdi)
	je	LBB0_1
## %bb.2:
	movl	%esi, %r13d
	movq	%rdi, %r14
	testl	%esi, %esi
	je	LBB0_4
## %bb.3:
	movl	$20, %edi
	callq	_msleep
LBB0_4:
	movq	_PCI_EXP_LNKSTA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	callq	_pcie_capability_read_word
	movq	_PCI_EXP_LNKSTA_DLLLA@GOTPCREL(%rip), %rsi
	movl	(%rsi), %eax
	xorl	%ecx, %ecx
	andl	-44(%rbp), %eax
	setne	%cl
	cmpl	%r13d, %ecx
	jne	LBB0_5
## %bb.12:
	movb	$1, %bl
	testl	%r13d, %r13d
	je	LBB0_15
## %bb.13:
	testl	%eax, %eax
	jne	LBB0_14
	jmp	LBB0_15
LBB0_1:
	movl	$1100, %edi                     ## imm = 0x44C
	callq	_msleep
	movl	$1, %eax
	jmp	LBB0_16
LBB0_5:
	movl	$1000, %r12d                    ## imm = 0x3E8
	leaq	-44(%rbp), %r15
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	$10, %edi
	movq	%rsi, %rbx
	callq	_msleep
	movq	_PCI_EXP_LNKSTA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movq	%r15, %rdx
	callq	_pcie_capability_read_word
	movq	%rbx, %rsi
	movl	(%rbx), %ecx
	xorl	%eax, %eax
	andl	-44(%rbp), %ecx
	setne	%al
	cmpl	%r13d, %eax
	sete	%bl
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	leal	-10(%r12), %edx
	cmpl	$10, %r12d
	movl	%edx, %r12d
	ja	LBB0_6
LBB0_8:
	testl	%r13d, %r13d
	je	LBB0_10
## %bb.9:
	testl	%ecx, %ecx
	je	LBB0_10
LBB0_14:
	movl	$100, %edi
	callq	_msleep
	jmp	LBB0_15
LBB0_10:
	movb	$1, %bl
	cmpl	%r13d, %eax
	je	LBB0_15
## %bb.11:
	testl	%r13d, %r13d
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str.2(%rip), %rdx
	cmovneq	%rax, %rdx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_pci_info
	xorl	%ebx, %ebx
LBB0_15:
	movzbl	%bl, %eax
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_EXP_LNKSTA,4,2             ## @PCI_EXP_LNKSTA
	.comm	_PCI_EXP_LNKSTA_DLLLA,4,2       ## @PCI_EXP_LNKSTA_DLLLA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Data Link Layer Link Active not %s in 1000 msec\n"

L_.str.1:                               ## @.str.1
	.asciz	"set"

L_.str.2:                               ## @.str.2
	.asciz	"cleared"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pcie_wait_for_link             ; -- Begin function pcie_wait_for_link
	.p2align	2
_pcie_wait_for_link:                    ; @pcie_wait_for_link
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	ldr	w8, [x0]
	cbz	w8, LBB0_6
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	cbz	w1, LBB0_3
; %bb.2:
	mov	w0, #20
	bl	_msleep
LBB0_3:
Lloh0:
	adrp	x22, _PCI_EXP_LNKSTA@GOTPAGE
Lloh1:
	ldr	x22, [x22, _PCI_EXP_LNKSTA@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #12
	mov	x0, x20
	bl	_pcie_capability_read_word
	ldr	w8, [sp, #12]
Lloh2:
	adrp	x23, _PCI_EXP_LNKSTA_DLLLA@GOTPAGE
Lloh3:
	ldr	x23, [x23, _PCI_EXP_LNKSTA_DLLLA@GOTPAGEOFF]
	ldr	w9, [x23]
	ands	w8, w9, w8
	cset	w9, ne
	cmp	w9, w19
	b.ne	LBB0_7
; %bb.4:
	mov	w21, #1
	cbz	w19, LBB0_15
; %bb.5:
	cbnz	w8, LBB0_11
	b	LBB0_15
LBB0_6:
	mov	w0, #1100
	bl	_msleep
	mov	w21, #1
	b	LBB0_15
LBB0_7:
	mov	w24, #1000
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #10
	bl	_msleep
	sub	w25, w24, #10
	ldr	w1, [x22]
	add	x2, sp, #12
	mov	x0, x20
	bl	_pcie_capability_read_word
	ldr	w8, [sp, #12]
	ldr	w9, [x23]
	ands	w9, w9, w8
	cset	w8, ne
	cmp	w8, w19
	cset	w21, eq
	ccmp	w24, #10, #0, ne
	mov	x24, x25
	b.hi	LBB0_8
; %bb.9:
	cbz	w19, LBB0_12
; %bb.10:
	cbz	w9, LBB0_12
LBB0_11:
	mov	w0, #100
	bl	_msleep
	b	LBB0_15
LBB0_12:
	cmp	w8, w19
	b.ne	LBB0_14
; %bb.13:
	mov	w21, #1
	b	LBB0_15
LBB0_14:
Lloh4:
	adrp	x8, l_.str.2@PAGE
Lloh5:
	add	x8, x8, l_.str.2@PAGEOFF
Lloh6:
	adrp	x9, l_.str.1@PAGE
Lloh7:
	add	x9, x9, l_.str.1@PAGEOFF
	cmp	w19, #0
	csel	x2, x9, x8, ne
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_pci_info
	mov	w21, #0
LBB0_15:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_EXP_LNKSTA,4,2             ; @PCI_EXP_LNKSTA
	.comm	_PCI_EXP_LNKSTA_DLLLA,4,2       ; @PCI_EXP_LNKSTA_DLLLA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Data Link Layer Link Active not %s in 1000 msec\n"

l_.str.1:                               ; @.str.1
	.asciz	"set"

l_.str.2:                               ; @.str.2
	.asciz	"cleared"

.subsections_via_symbols
