	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_pci_mode
_get_pci_mode:                          ## @get_pci_mode
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	callq	_pci_is_pcie
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_PCI_VARIANT_PCIE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r14)
	movl	(%rbx), %edi
	movq	_PCI_EXP_LNKSTA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-20(%rbp), %rdx
	callq	_pcie_capability_read_word
	movl	-20(%rbp), %eax
	shrl	$4, %eax
	andl	$63, %eax
	movl	%eax, (%r14)
	jmp	LBB0_10
LBB0_2:
	movq	_A_PCIX_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_t3_read_reg
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_G_PCLKRANGE
	leaq	_get_pci_mode.speed_map(%rip), %rcx
	movzwl	(%rcx,%rax,2), %eax
	movw	%ax, 4(%r14)
	movq	_F_64BIT@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	movl	(%rax), %eax
	andl	%ebx, %eax
	setne	%cl
	shll	$5, %ecx
	addl	$32, %ecx
	movl	%ecx, (%r14)
	movl	%ebx, %edi
	callq	_G_PCIXINITPAT
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	cmpl	$3, %eax
	jg	LBB0_6
## %bb.5:
	movq	_PCI_VARIANT_PCIX_MODE1_PARITY@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_3:
	movq	_PCI_VARIANT_PCI@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_6:
	cmpl	$7, %eax
	ja	LBB0_8
## %bb.7:
	movq	_PCI_VARIANT_PCIX_MODE1_ECC@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_8:
	movq	_PCI_VARIANT_PCIX_266_MODE2@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %eax
	movl	%eax, 8(%r14)
LBB0_10:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	1                               ## @get_pci_mode.speed_map
_get_pci_mode.speed_map:
	.short	33                              ## 0x21
	.short	66                              ## 0x42
	.short	100                             ## 0x64
	.short	133                             ## 0x85

	.comm	_PCI_VARIANT_PCIE,4,2           ## @PCI_VARIANT_PCIE
	.comm	_PCI_EXP_LNKSTA,4,2             ## @PCI_EXP_LNKSTA
	.comm	_A_PCIX_MODE,4,2                ## @A_PCIX_MODE
	.comm	_F_64BIT,4,2                    ## @F_64BIT
	.comm	_PCI_VARIANT_PCI,4,2            ## @PCI_VARIANT_PCI
	.comm	_PCI_VARIANT_PCIX_MODE1_PARITY,4,2 ## @PCI_VARIANT_PCIX_MODE1_PARITY
	.comm	_PCI_VARIANT_PCIX_MODE1_ECC,4,2 ## @PCI_VARIANT_PCIX_MODE1_ECC
	.comm	_PCI_VARIANT_PCIX_266_MODE2,4,2 ## @PCI_VARIANT_PCIX_266_MODE2
	.no_dead_strip	_get_pci_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_pci_mode
_get_pci_mode:                          ; @get_pci_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x1
	mov	x20, x0
	ldr	w0, [x0]
	bl	_pci_is_pcie
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _PCI_VARIANT_PCIE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCI_VARIANT_PCIE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x19, #8]
	ldr	w0, [x20]
Lloh3:
	adrp	x8, _PCI_EXP_LNKSTA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PCI_EXP_LNKSTA@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_pcie_capability_read_word
	ldr	w8, [sp, #12]
	ubfx	w8, w8, #4, #6
	str	w8, [x19]
	b	LBB0_10
LBB0_2:
Lloh6:
	adrp	x8, _A_PCIX_MODE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _A_PCIX_MODE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_t3_read_reg
	mov	x20, x0
	bl	_G_PCLKRANGE
Lloh9:
	adrp	x8, _get_pci_mode.speed_map@PAGE
Lloh10:
	add	x8, x8, _get_pci_mode.speed_map@PAGEOFF
	ldrh	w8, [x8, x0, lsl #1]
	strh	w8, [x19, #4]
Lloh11:
	adrp	x8, _F_64BIT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _F_64BIT@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	tst	w8, w20
	mov	w8, #64
	mov	w9, #32
	csel	w8, w9, w8, eq
	str	w8, [x19]
	mov	x0, x20
	bl	_G_PCIXINITPAT
	cbz	w0, LBB0_5
; %bb.3:
	cmp	w0, #3
	b.gt	LBB0_6
; %bb.4:
Lloh14:
	adrp	x8, _PCI_VARIANT_PCIX_MODE1_PARITY@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PCI_VARIANT_PCIX_MODE1_PARITY@GOTPAGEOFF]
	b	LBB0_9
LBB0_5:
Lloh16:
	adrp	x8, _PCI_VARIANT_PCI@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PCI_VARIANT_PCI@GOTPAGEOFF]
	b	LBB0_9
LBB0_6:
	cmp	w0, #7
	b.hi	LBB0_8
; %bb.7:
Lloh18:
	adrp	x8, _PCI_VARIANT_PCIX_MODE1_ECC@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PCI_VARIANT_PCIX_MODE1_ECC@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh20:
	adrp	x8, _PCI_VARIANT_PCIX_266_MODE2@GOTPAGE
Lloh21:
	ldr	x8, [x8, _PCI_VARIANT_PCIX_266_MODE2@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	str	w8, [x19, #8]
LBB0_10:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	1                               ; @get_pci_mode.speed_map
_get_pci_mode.speed_map:
	.short	33                              ; 0x21
	.short	66                              ; 0x42
	.short	100                             ; 0x64
	.short	133                             ; 0x85

	.comm	_PCI_VARIANT_PCIE,4,2           ; @PCI_VARIANT_PCIE
	.comm	_PCI_EXP_LNKSTA,4,2             ; @PCI_EXP_LNKSTA
	.comm	_A_PCIX_MODE,4,2                ; @A_PCIX_MODE
	.comm	_F_64BIT,4,2                    ; @F_64BIT
	.comm	_PCI_VARIANT_PCI,4,2            ; @PCI_VARIANT_PCI
	.comm	_PCI_VARIANT_PCIX_MODE1_PARITY,4,2 ; @PCI_VARIANT_PCIX_MODE1_PARITY
	.comm	_PCI_VARIANT_PCIX_MODE1_ECC,4,2 ; @PCI_VARIANT_PCIX_MODE1_ECC
	.comm	_PCI_VARIANT_PCIX_266_MODE2,4,2 ; @PCI_VARIANT_PCIX_266_MODE2
	.no_dead_strip	_get_pci_mode
.subsections_via_symbols
