	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _altera_pcie_cfg_read
__altera_pcie_cfg_read:                 ## @_altera_pcie_cfg_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r14
	movl	%r8d, %ebx
	movl	%ecx, %r15d
	cmpq	%rsi, (%rdi)
	jne	LBB0_2
## %bb.1:
	movq	8(%rdi), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.15:
	movl	%r15d, %esi
	movl	%ebx, %edx
	movq	%r14, %rcx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
LBB0_2:
	cmpl	$2, %ebx
	je	LBB0_5
## %bb.3:
	movl	$15, %eax
	cmpl	$1, %ebx
	jne	LBB0_7
## %bb.4:
	movl	%r15d, %ecx
	andb	$3, %cl
	movl	$1, %eax
	jmp	LBB0_6
LBB0_5:
	movl	%r15d, %ecx
	andb	$3, %cl
	movl	$3, %eax
LBB0_6:
	shll	%cl, %eax
LBB0_7:
	movl	%eax, %r8d
	movq	_DWORD_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	notl	%ecx
	andl	%r15d, %ecx
	leaq	-28(%rbp), %r9
	callq	_tlp_cfg_dword_read
	movq	_PCIBIOS_SUCCESSFUL@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %eax
	jne	LBB0_14
## %bb.8:
	cmpl	$2, %ebx
	je	LBB0_11
## %bb.9:
	cmpl	$1, %ebx
	jne	LBB0_12
## %bb.10:
	movl	-28(%rbp), %eax
	shll	$3, %r15d
	movl	%r15d, %ecx
	sarl	%cl, %eax
	movzbl	%al, %eax
	jmp	LBB0_13
LBB0_11:
	movl	-28(%rbp), %eax
	shll	$3, %r15d
	andb	$16, %r15b
	movl	%r15d, %ecx
	sarl	%cl, %eax
	movzwl	%ax, %eax
	jmp	LBB0_13
LBB0_12:
	movl	-28(%rbp), %eax
LBB0_13:
	movl	%eax, (%r14)
	movl	(%rdx), %eax
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DWORD_MASK,4,2                 ## @DWORD_MASK
	.comm	_PCIBIOS_SUCCESSFUL,4,2         ## @PCIBIOS_SUCCESSFUL
	.no_dead_strip	__altera_pcie_cfg_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _altera_pcie_cfg_read
__altera_pcie_cfg_read:                 ; @_altera_pcie_cfg_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x5
	mov	x21, x4
	mov	x20, x3
	ldr	x8, [x0]
	cmp	x8, x1
	b.ne	LBB0_3
; %bb.1:
	ldr	x8, [x0, #8]
	ldr	x8, [x8]
	ldr	x4, [x8]
	cbz	x4, LBB0_3
; %bb.2:
	mov	x1, x20
	mov	x2, x21
	mov	x3, x19
	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
	add	sp, sp, #64
	br	x4
LBB0_3:
	mov	w8, #15
	and	w9, w20, #0x3
	mov	w10, #3
	lsl	w10, w10, w9
	mov	w11, #1
	lsl	w9, w11, w9
	cmp	w21, #1
	csel	w8, w8, w9, ne
	cmp	w21, #2
	csel	w4, w10, w8, eq
Lloh0:
	adrp	x8, _DWORD_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DWORD_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	bic	w3, w20, w8
	add	x5, sp, #12
	bl	_tlp_cfg_dword_read
Lloh3:
	adrp	x8, _PCIBIOS_SUCCESSFUL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PCIBIOS_SUCCESSFUL@GOTPAGEOFF]
	ldr	w9, [x8]
	cmp	w0, w9
	b.ne	LBB0_10
; %bb.4:
	cmp	w21, #2
	b.eq	LBB0_7
; %bb.5:
	cmp	w21, #1
	b.ne	LBB0_8
; %bb.6:
	ldr	w9, [sp, #12]
	ubfiz	w10, w20, #3, #2
	asr	w9, w9, w10
	and	w9, w9, #0xff
	b	LBB0_9
LBB0_7:
	ldr	w9, [sp, #12]
	lsl	w10, w20, #3
	and	w10, w10, #0x10
	asr	w9, w9, w10
	and	w9, w9, #0xffff
	b	LBB0_9
LBB0_8:
	ldr	w9, [sp, #12]
LBB0_9:
	str	w9, [x19]
	ldr	w0, [x8]
LBB0_10:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_DWORD_MASK,4,2                 ; @DWORD_MASK
	.comm	_PCIBIOS_SUCCESSFUL,4,2         ; @PCIBIOS_SUCCESSFUL
	.no_dead_strip	__altera_pcie_cfg_read
.subsections_via_symbols
