	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qib_tune_pcie_caps
_qib_tune_pcie_caps:                    ## @qib_tune_pcie_caps
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	8(%rax), %rax
	movq	(%rax), %r15
	movq	8(%r15), %rdi
	callq	_pci_is_root_bus
	testl	%eax, %eax
	je	LBB0_11
## %bb.1:
	movq	%r15, %rdi
	callq	_pci_is_pcie
	testl	%eax, %eax
	je	LBB0_10
## %bb.2:
	movq	(%rbx), %rdi
	callq	_pci_is_pcie
	testl	%eax, %eax
	je	LBB0_10
## %bb.3:
	movl	(%r15), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r15, %rdi
	callq	_pcie_get_mps
	bsfl	%eax, %r12d
	movl	$-1, %eax
	cmovel	%eax, %r12d
	addl	$-7, %r12d
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %rdi
	movl	(%rdi), %r14d
	callq	_pcie_get_mps
	bsfl	%eax, %r13d
	movl	$-1, %eax
	cmovel	%eax, %r13d
	addl	$-7, %r13d
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	cmpl	%r14d, %eax
	cmovll	%eax, %r14d
	movq	_qib_pcie_caps@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	andl	$7, %ebx
	cmpl	%ebx, %r14d
	cmovll	%r14d, %ebx
	cmpl	%r12d, %ebx
	jle	LBB0_5
## %bb.4:
	movl	$128, %esi
	movl	%ebx, %ecx
	shll	%cl, %esi
	movq	%r15, %rdi
	movq	%rax, %r14
	callq	_pcie_set_mps
	movq	%r14, %rax
LBB0_5:
	cmpl	%r13d, %ebx
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	jle	LBB0_7
## %bb.6:
	movq	(%r14), %rdi
	movl	$128, %esi
	movl	%ebx, %ecx
	shll	%cl, %esi
	movq	%rax, %rbx
	callq	_pcie_set_mps
	movq	%rbx, %rax
LBB0_7:
	movl	(%rax), %eax
	shrl	$4, %eax
	andl	$7, %eax
	cmpl	$5, %eax
	movl	$5, %ecx
	cmovbl	%eax, %ecx
	movl	$128, %ebx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %ebx
	movq	%r15, %rdi
	callq	_pcie_get_readrq
	movl	%eax, %r13d
	movq	(%r14), %rdi
	callq	_pcie_get_readrq
	movl	%eax, %r12d
	cmpl	%r13d, %ebx
	jle	LBB0_9
## %bb.8:
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_pcie_set_readrq
LBB0_9:
	cmpl	%r12d, %ebx
	jle	LBB0_10
## %bb.12:
	movq	(%r14), %rdi
	movl	%ebx, %esi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pcie_set_readrq                ## TAILCALL
LBB0_10:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_qib_devinfo                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Parent not root\n"

	.comm	_qib_pcie_caps,4,2              ## @qib_pcie_caps
	.no_dead_strip	_qib_tune_pcie_caps
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qib_tune_pcie_caps
_qib_tune_pcie_caps:                    ; @qib_tune_pcie_caps
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	ldr	x8, [x0]
	ldr	x8, [x8, #8]
	ldr	x20, [x8]
	ldr	x0, [x20, #8]
	bl	_pci_is_root_bus
	cbz	w0, LBB0_12
; %bb.1:
	mov	x0, x20
	bl	_pci_is_pcie
	cbz	w0, LBB0_11
; %bb.2:
	ldr	x0, [x19]
	bl	_pci_is_pcie
	cbz	w0, LBB0_11
; %bb.3:
	ldr	w23, [x20]
	mov	x0, x20
	bl	_pcie_get_mps
	rbit	w8, w0
	clz	w8, w8
	sub	w8, w8, #7
	mov	w21, #-8
	cmp	w0, #0
	csel	w24, w21, w8, eq
	ldr	x0, [x19]
	ldr	w25, [x0]
	bl	_pcie_get_mps
	rbit	w8, w0
	clz	w8, w8
	sub	w8, w8, #7
	cmp	w0, #0
	csel	w22, w21, w8, eq
Lloh0:
	adrp	x21, _qib_pcie_caps@GOTPAGE
Lloh1:
	ldr	x21, [x21, _qib_pcie_caps@GOTPAGEOFF]
	cmp	w23, w25
	csel	w8, w23, w25, lt
	ldr	w9, [x21]
	and	w9, w9, #0x7
	cmp	w8, w9
	csel	w23, w8, w9, lt
	cmp	w23, w24
	b.le	LBB0_5
; %bb.4:
	mov	w8, #128
	lsl	w1, w8, w23
	mov	x0, x20
	bl	_pcie_set_mps
LBB0_5:
	cmp	w23, w22
	b.le	LBB0_7
; %bb.6:
	ldr	x0, [x19]
	mov	w8, #128
	lsl	w1, w8, w23
	bl	_pcie_set_mps
LBB0_7:
	ldr	w8, [x21]
	ubfx	w8, w8, #4, #3
	mov	w9, #5
	cmp	w8, #5
	csel	w8, w8, w9, lo
	mov	w9, #128
	lsl	w21, w9, w8
	mov	x0, x20
	bl	_pcie_get_readrq
	mov	x23, x0
	ldr	x0, [x19]
	bl	_pcie_get_readrq
	mov	x22, x0
	cmp	w21, w23
	b.le	LBB0_9
; %bb.8:
	mov	x0, x20
	mov	x1, x21
	bl	_pcie_set_readrq
LBB0_9:
	cmp	w21, w22
	b.le	LBB0_11
; %bb.10:
	ldr	x0, [x19]
	mov	x1, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_pcie_set_readrq
LBB0_11:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_12:
	ldr	x0, [x19]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_qib_devinfo
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Parent not root\n"

	.comm	_qib_pcie_caps,4,2              ; @qib_pcie_caps
	.no_dead_strip	_qib_tune_pcie_caps
.subsections_via_symbols
