	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function reset_link
_reset_link:                            ## @reset_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_pcie_port_find_service
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	callq	*%rax
	jmp	LBB0_6
LBB0_3:
	movq	%rbx, %rdi
	callq	_pcie_downstream_port
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rbx, %rdi
	callq	_default_reset_link
LBB0_6:
	movq	_PCI_ERS_RESULT_RECOVERED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_9
## %bb.7:
	leaq	L_.str.1(%rip), %r14
	jmp	LBB0_8
LBB0_4:
	leaq	L_.str(%rip), %r14
LBB0_8:
	movq	_KERN_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%rbx, %rdi
	callq	_pci_name
	movl	%r15d, %edi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	movl	%eax, %ecx
	callq	_pci_printk
	movq	_PCI_ERS_RESULT_DISCONNECT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KERN_DEBUG,4,2                 ## @KERN_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no link-reset support at upstream device %s\n"

	.comm	_PCI_ERS_RESULT_DISCONNECT,8,3  ## @PCI_ERS_RESULT_DISCONNECT
	.comm	_PCI_ERS_RESULT_RECOVERED,8,3   ## @PCI_ERS_RESULT_RECOVERED
L_.str.1:                               ## @.str.1
	.asciz	"link reset at upstream device %s failed\n"

	.no_dead_strip	_reset_link
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function reset_link
_reset_link:                            ; @reset_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	x19, x0
	bl	_pcie_port_find_service
	cbz	x0, LBB0_3
; %bb.1:
	ldr	x8, [x0]
	cbz	x8, LBB0_3
; %bb.2:
	mov	x0, x19
	blr	x8
	b	LBB0_5
LBB0_3:
	mov	x0, x19
	bl	_pcie_downstream_port
	cbz	x0, LBB0_7
; %bb.4:
	mov	x0, x19
	bl	_default_reset_link
LBB0_5:
Lloh0:
	adrp	x8, _PCI_ERS_RESULT_RECOVERED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCI_ERS_RESULT_RECOVERED@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_9
; %bb.6:
Lloh3:
	adrp	x20, l_.str.1@PAGE
Lloh4:
	add	x20, x20, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_7:
Lloh5:
	adrp	x20, l_.str@PAGE
Lloh6:
	add	x20, x20, l_.str@PAGEOFF
LBB0_8:
Lloh7:
	adrp	x8, _KERN_DEBUG@GOTPAGE
Lloh8:
	ldr	x8, [x8, _KERN_DEBUG@GOTPAGEOFF]
Lloh9:
	ldr	w21, [x8]
	mov	x0, x19
	bl	_pci_name
	mov	x3, x0
	mov	x0, x21
	mov	x1, x19
	mov	x2, x20
	bl	_pci_printk
Lloh10:
	adrp	x8, _PCI_ERS_RESULT_DISCONNECT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PCI_ERS_RESULT_DISCONNECT@GOTPAGEOFF]
Lloh12:
	ldr	x0, [x8]
LBB0_9:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_KERN_DEBUG,4,2                 ; @KERN_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no link-reset support at upstream device %s\n"

	.comm	_PCI_ERS_RESULT_DISCONNECT,8,3  ; @PCI_ERS_RESULT_DISCONNECT
	.comm	_PCI_ERS_RESULT_RECOVERED,8,3   ; @PCI_ERS_RESULT_RECOVERED
l_.str.1:                               ; @.str.1
	.asciz	"link reset at upstream device %s failed\n"

	.no_dead_strip	_reset_link
.subsections_via_symbols
