	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rsi, %rbx
	movl	(%rdi), %edi
	movq	_A_PCICFG_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-12(%rbp), %rdx
	callq	_pci_read_config_dword
	movl	-12(%rbp), %edi
	callq	_G_PCI_MODE_CLK
	leaq	_get_pci_mode.speed_map(%rip), %rcx
	movzwl	(%rcx,%rax,2), %eax
	movw	%ax, (%rbx)
	movl	-12(%rbp), %eax
	movq	_F_PCI_MODE_64BIT@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	setne	%dl
	shll	$5, %edx
	addl	$32, %edx
	movl	%edx, 4(%rbx)
	movq	_F_PCI_MODE_PCIX@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	andl	(%rcx), %eax
	setne	%dl
	movl	%edx, 8(%rbx)
	addq	$8, %rsp
	popq	%rbx
	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	_A_PCICFG_MODE,4,2              ## @A_PCICFG_MODE
	.comm	_F_PCI_MODE_64BIT,4,2           ## @F_PCI_MODE_64BIT
	.comm	_F_PCI_MODE_PCIX,4,2            ## @F_PCI_MODE_PCIX
	.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
	ldr	w0, [x0]
Lloh0:
	adrp	x8, _A_PCICFG_MODE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _A_PCICFG_MODE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_pci_read_config_dword
	ldr	w0, [sp, #12]
	bl	_G_PCI_MODE_CLK
Lloh3:
	adrp	x8, _get_pci_mode.speed_map@PAGE
Lloh4:
	add	x8, x8, _get_pci_mode.speed_map@PAGEOFF
	ldrh	w8, [x8, x0, lsl #1]
	strh	w8, [x19]
	ldr	w8, [sp, #12]
Lloh5:
	adrp	x9, _F_PCI_MODE_64BIT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _F_PCI_MODE_64BIT@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	mov	w9, #64
	mov	w10, #32
Lloh8:
	adrp	x11, _F_PCI_MODE_PCIX@GOTPAGE
Lloh9:
	ldr	x11, [x11, _F_PCI_MODE_PCIX@GOTPAGEOFF]
	csel	w9, w10, w9, eq
Lloh10:
	ldr	w10, [x11]
	tst	w10, w8
	cset	w8, ne
	stp	w9, w8, [x19, #4]
	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	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.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	_A_PCICFG_MODE,4,2              ; @A_PCICFG_MODE
	.comm	_F_PCI_MODE_64BIT,4,2           ; @F_PCI_MODE_64BIT
	.comm	_F_PCI_MODE_PCIX,4,2            ; @F_PCI_MODE_PCIX
	.no_dead_strip	_get_pci_mode
.subsections_via_symbols
