	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pci_conf2_read
_pci_conf2_read:                        ## @pci_conf2_read
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %eax
	orl	%esi, %eax
	cmpl	$255, %eax
	ja	LBB0_2
## %bb.1:
	movl	%ecx, %r13d
	cmpl	$256, %ecx                      ## imm = 0x100
	jge	LBB0_2
## %bb.3:
	movl	%r8d, %r15d
	movl	%edx, %r14d
	movl	%esi, %r12d
	movq	%r9, -48(%rbp)                  ## 8-byte Spill
	movl	%edx, %edi
	callq	_PCI_SLOT
	movl	%r14d, %edi
	movl	%eax, %r14d
	callq	_PCI_FUNC
	testb	$16, %r14b
	jne	LBB0_4
## %bb.5:
	movl	%eax, %ebx
	movq	_pci_config_lock@GOTPCREL(%rip), %rdi
	callq	_spin_lock_irqsave
	orl	$120, %ebx
	addl	%ebx, %ebx
	movl	%ebx, %edi
	movl	$3320, %esi                     ## imm = 0xCF8
	callq	_outb
	movl	%r12d, %edi
	movl	$3322, %esi                     ## imm = 0xCFA
	callq	_outb
	cmpl	$4, %r15d
	je	LBB0_10
## %bb.6:
	cmpl	$2, %r15d
	je	LBB0_9
## %bb.7:
	cmpl	$1, %r15d
	jne	LBB0_12
## %bb.8:
	movl	%r14d, %edi
	movl	%r13d, %esi
	callq	_PCI_CONF2_ADDRESS
	movl	%eax, %edi
	callq	_inb
	jmp	LBB0_11
LBB0_2:
	movl	$-1, (%r9)
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_4:
	movq	_PCIBIOS_DEVICE_NOT_FOUND@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_13
LBB0_10:
	movl	%r14d, %edi
	movl	%r13d, %esi
	callq	_PCI_CONF2_ADDRESS
	movl	%eax, %edi
	callq	_inl
	jmp	LBB0_11
LBB0_9:
	movl	%r14d, %edi
	movl	%r13d, %esi
	callq	_PCI_CONF2_ADDRESS
	movl	%eax, %edi
	callq	_inw
LBB0_11:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
LBB0_12:
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	movl	$3320, %esi                     ## imm = 0xCF8
	callq	_outb
	movq	_pci_config_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
LBB0_13:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PCIBIOS_DEVICE_NOT_FOUND,4,2   ## @PCIBIOS_DEVICE_NOT_FOUND
	.comm	_pci_config_lock,4,2            ## @pci_config_lock
	.no_dead_strip	_pci_conf2_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pci_conf2_read
_pci_conf2_read:                        ; @pci_conf2_read
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x5
	orr	w8, w2, w1
	cmp	w8, #255
	b.hi	LBB0_7
; %bb.1:
	mov	x20, x3
	cmp	w3, #256
	b.ge	LBB0_7
; %bb.2:
	mov	x21, x4
	mov	x24, x2
	mov	x23, x1
	mov	x0, x2
	bl	_PCI_SLOT
	mov	x22, x0
	mov	x0, x24
	bl	_PCI_FUNC
	tbnz	w22, #4, LBB0_8
; %bb.3:
	mov	x24, x0
Lloh0:
	adrp	x0, _pci_config_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _pci_config_lock@GOTPAGEOFF]
	bl	_spin_lock_irqsave
	lsl	w8, w24, #1
	orr	w0, w8, #0xf0
	mov	w1, #3320
	bl	_outb
	mov	x0, x23
	mov	w1, #3322
	bl	_outb
	cmp	w21, #4
	b.eq	LBB0_9
; %bb.4:
	cmp	w21, #2
	b.eq	LBB0_10
; %bb.5:
	cmp	w21, #1
	b.ne	LBB0_12
; %bb.6:
	mov	x0, x22
	mov	x1, x20
	bl	_PCI_CONF2_ADDRESS
	bl	_inb
	b	LBB0_11
LBB0_7:
	mov	w8, #-1
	str	w8, [x19]
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_13
LBB0_8:
Lloh5:
	adrp	x8, _PCIBIOS_DEVICE_NOT_FOUND@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PCIBIOS_DEVICE_NOT_FOUND@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	b	LBB0_13
LBB0_9:
	mov	x0, x22
	mov	x1, x20
	bl	_PCI_CONF2_ADDRESS
	bl	_inl
	b	LBB0_11
LBB0_10:
	mov	x0, x22
	mov	x1, x20
	bl	_PCI_CONF2_ADDRESS
	bl	_inw
LBB0_11:
	str	w0, [x19]
LBB0_12:
	mov	w0, #0
	mov	w1, #3320
	bl	_outb
Lloh8:
	adrp	x0, _pci_config_lock@GOTPAGE
Lloh9:
	ldr	x0, [x0, _pci_config_lock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
	mov	w0, #0
LBB0_13:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PCIBIOS_DEVICE_NOT_FOUND,4,2   ; @PCIBIOS_DEVICE_NOT_FOUND
	.comm	_pci_config_lock,4,2            ; @pci_config_lock
	.no_dead_strip	_pci_conf2_read
.subsections_via_symbols
