	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_cfg_space_size             ## -- Begin function pci_cfg_space_size
	.p2align	4, 0x90
_pci_cfg_space_size:                    ## @pci_cfg_space_size
	.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	8(%rdi), %rax
	movq	_PCI_BUS_FLAGS_NO_EXTCFG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_1
LBB0_6:
	movq	_PCI_CFG_SPACE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_1:
	movq	%rdi, %rbx
	movl	(%rdi), %eax
	sarl	$8, %eax
	movq	_PCI_CLASS_BRIDGE_HOST@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_8
## %bb.2:
	movq	%rbx, %rdi
	callq	_pci_is_pcie
	testq	%rax, %rax
	je	LBB0_3
LBB0_8:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_pci_cfg_space_size_ext         ## TAILCALL
LBB0_3:
	movq	_PCI_CAP_ID_PCIX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_pci_find_capability
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:
	movslq	%eax, %rsi
	movq	_PCI_X_STATUS@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	leaq	-12(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_pci_read_config_dword
	movq	_PCI_X_STATUS_266MHZ@GOTPCREL(%rip), %rax
	movq	_PCI_X_STATUS_533MHZ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	testl	%ecx, -12(%rbp)
	je	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	callq	_pci_cfg_space_size_ext
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_BUS_FLAGS_NO_EXTCFG,4,2    ## @PCI_BUS_FLAGS_NO_EXTCFG
	.comm	_PCI_CFG_SPACE_SIZE,4,2         ## @PCI_CFG_SPACE_SIZE
	.comm	_PCI_CLASS_BRIDGE_HOST,4,2      ## @PCI_CLASS_BRIDGE_HOST
	.comm	_PCI_CAP_ID_PCIX,4,2            ## @PCI_CAP_ID_PCIX
	.comm	_PCI_X_STATUS,8,3               ## @PCI_X_STATUS
	.comm	_PCI_X_STATUS_266MHZ,4,2        ## @PCI_X_STATUS_266MHZ
	.comm	_PCI_X_STATUS_533MHZ,4,2        ## @PCI_X_STATUS_533MHZ
	.comm	_PCI_CFG_SPACE_EXP_SIZE,4,2     ## @PCI_CFG_SPACE_EXP_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_cfg_space_size             ; -- Begin function pci_cfg_space_size
	.p2align	2
_pci_cfg_space_size:                    ; @pci_cfg_space_size
	.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
	ldr	x8, [x0, #8]
	ldr	w8, [x8]
Lloh0:
	adrp	x9, _PCI_BUS_FLAGS_NO_EXTCFG@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PCI_BUS_FLAGS_NO_EXTCFG@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
LBB0_1:
Lloh3:
	adrp	x8, _PCI_CFG_SPACE_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PCI_CFG_SPACE_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
LBB0_2:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_3:
	mov	x19, x0
	ldr	w8, [x0]
Lloh6:
	adrp	x9, _PCI_CLASS_BRIDGE_HOST@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PCI_CLASS_BRIDGE_HOST@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w9, w8, asr #8
	b.eq	LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_pci_is_pcie
	cbz	x0, LBB0_6
LBB0_5:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	b	_pci_cfg_space_size_ext
LBB0_6:
Lloh9:
	adrp	x8, _PCI_CAP_ID_PCIX@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PCI_CAP_ID_PCIX@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_pci_find_capability
	cbz	w0, LBB0_1
; %bb.7:
Lloh12:
	adrp	x8, _PCI_X_STATUS@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PCI_X_STATUS@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	add	x1, x8, w0, sxtw
	add	x2, sp, #12
	mov	x0, x19
	bl	_pci_read_config_dword
	ldr	w8, [sp, #12]
Lloh15:
	adrp	x9, _PCI_X_STATUS_266MHZ@GOTPAGE
Lloh16:
	ldr	x9, [x9, _PCI_X_STATUS_266MHZ@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
Lloh18:
	adrp	x10, _PCI_X_STATUS_533MHZ@GOTPAGE
Lloh19:
	ldr	x10, [x10, _PCI_X_STATUS_533MHZ@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w8
	b.eq	LBB0_1
; %bb.8:
	mov	x0, x19
	bl	_pci_cfg_space_size_ext
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_BUS_FLAGS_NO_EXTCFG,4,2    ; @PCI_BUS_FLAGS_NO_EXTCFG
	.comm	_PCI_CFG_SPACE_SIZE,4,2         ; @PCI_CFG_SPACE_SIZE
	.comm	_PCI_CLASS_BRIDGE_HOST,4,2      ; @PCI_CLASS_BRIDGE_HOST
	.comm	_PCI_CAP_ID_PCIX,4,2            ; @PCI_CAP_ID_PCIX
	.comm	_PCI_X_STATUS,8,3               ; @PCI_X_STATUS
	.comm	_PCI_X_STATUS_266MHZ,4,2        ; @PCI_X_STATUS_266MHZ
	.comm	_PCI_X_STATUS_533MHZ,4,2        ; @PCI_X_STATUS_533MHZ
	.comm	_PCI_CFG_SPACE_EXP_SIZE,4,2     ; @PCI_CFG_SPACE_EXP_SIZE
.subsections_via_symbols
