	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alloc_pcie_link_state
_alloc_pcie_link_state:                 ## @alloc_pcie_link_state
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$40, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_INIT_LIST_HEAD
	movq	%r14, 32(%rbx)
	movl	16(%r14), %edi
	callq	_pci_function_0
	movl	%eax, 24(%rbx)
	movq	%r14, %rdi
	callq	_pci_pcie_type
	movq	_PCI_EXP_TYPE_ROOT_PORT@GOTPCREL(%rip), %rdx
	movq	%rbx, %rcx
	cmpq	(%rdx), %rax
	je	LBB0_6
## %bb.2:
	movq	%r14, %rdi
	callq	_pci_pcie_type
	movq	_PCI_EXP_TYPE_PCIE_BRIDGE@GOTPCREL(%rip), %rdx
	movq	%rbx, %rcx
	cmpq	(%rdx), %rax
	je	LBB0_6
## %bb.3:
	movq	8(%r14), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	%rbx, %rcx
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_9
## %bb.5:
	movq	%rax, 16(%rbx)
	movq	8(%rax), %rcx
LBB0_6:
	movq	%rcx, 8(%rbx)
	movq	_link_list@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	callq	_list_add
	movq	%rbx, (%r14)
	jmp	LBB0_8
LBB0_9:
	movq	%rbx, %rdi
	callq	_kfree
LBB0_7:
	xorl	%ebx, %ebx
LBB0_8:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_PCI_EXP_TYPE_ROOT_PORT,8,3     ## @PCI_EXP_TYPE_ROOT_PORT
	.comm	_PCI_EXP_TYPE_PCIE_BRIDGE,8,3   ## @PCI_EXP_TYPE_PCIE_BRIDGE
	.comm	_link_list,4,2                  ## @link_list
	.no_dead_strip	_alloc_pcie_link_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alloc_pcie_link_state
_alloc_pcie_link_state:                 ; @alloc_pcie_link_state
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #40
	bl	_kzalloc
	mov	x19, x0
	cbz	x0, LBB0_7
; %bb.1:
	mov	x0, x19
	bl	_INIT_LIST_HEAD
	str	x20, [x19, #32]
	ldr	w0, [x20, #16]
	bl	_pci_function_0
	str	w0, [x19, #24]
	mov	x0, x20
	bl	_pci_pcie_type
Lloh3:
	adrp	x8, _PCI_EXP_TYPE_ROOT_PORT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PCI_EXP_TYPE_ROOT_PORT@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x8]
	mov	x8, x19
	cmp	x0, x9
	b.eq	LBB0_6
; %bb.2:
	mov	x0, x20
	bl	_pci_pcie_type
Lloh6:
	adrp	x8, _PCI_EXP_TYPE_PCIE_BRIDGE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PCI_EXP_TYPE_PCIE_BRIDGE@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x8]
	mov	x8, x19
	cmp	x0, x9
	b.eq	LBB0_6
; %bb.3:
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	ldr	x9, [x8]
	mov	x8, x19
	cbz	x9, LBB0_6
; %bb.4:
	ldr	x8, [x9]
	cbz	x8, LBB0_8
; %bb.5:
	str	x8, [x19, #16]
	ldr	x8, [x8, #8]
LBB0_6:
	str	x8, [x19, #8]
Lloh9:
	adrp	x1, _link_list@GOTPAGE
Lloh10:
	ldr	x1, [x1, _link_list@GOTPAGEOFF]
	mov	x0, x19
	bl	_list_add
	str	x19, [x20]
LBB0_7:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_8:
	mov	x0, x19
	bl	_kfree
	mov	x19, #0
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_PCI_EXP_TYPE_ROOT_PORT,8,3     ; @PCI_EXP_TYPE_ROOT_PORT
	.comm	_PCI_EXP_TYPE_PCIE_BRIDGE,8,3   ; @PCI_EXP_TYPE_PCIE_BRIDGE
	.comm	_link_list,4,2                  ; @link_list
	.no_dead_strip	_alloc_pcie_link_state
.subsections_via_symbols
