	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mthca_tune_pci
_mthca_tune_pci:                        ## @mthca_tune_pci
	.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	_tune_pci@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	cmpl	$0, (%rax)
	je	LBB0_12
## %bb.1:
	movq	%rdi, %r15
	movl	4(%rdi), %edi
	movq	_PCI_CAP_ID_PCIX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_pci_find_capability
	testq	%rax, %rax
	je	LBB0_5
## %bb.2:
	movl	4(%r15), %ebx
	movl	%ebx, %edi
	callq	_pcix_get_max_mmrbc
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_pcix_set_mmrbc
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_4
LBB0_5:
	movq	_MTHCA_FLAG_PCIE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	jne	LBB0_7
## %bb.6:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_mthca_info
LBB0_7:
	movl	4(%r15), %edi
	callq	_pci_is_pcie
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	movl	4(%r15), %edi
	movl	$4096, %esi                     ## imm = 0x1000
	callq	_pcie_set_readrq
	testq	%rax, %rax
	je	LBB0_12
## %bb.9:
	leaq	L_.str.2(%rip), %rsi
LBB0_4:
	movq	%r15, %rdi
	callq	_mthca_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_12:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_MTHCA_FLAG_PCIE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_12
## %bb.11:
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	callq	_mthca_info
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_tune_pci,4,2                   ## @tune_pci
	.comm	_PCI_CAP_ID_PCIX,4,2            ## @PCI_CAP_ID_PCIX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't set PCI-X max read count, aborting.\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_MTHCA_FLAG_PCIE,4,2            ## @MTHCA_FLAG_PCIE
L_.str.1:                               ## @.str.1
	.asciz	"No PCI-X capability, not setting RBC.\n"

L_.str.2:                               ## @.str.2
	.asciz	"Couldn't write PCI Express read request, aborting.\n"

L_.str.3:                               ## @.str.3
	.asciz	"No PCI Express capability, not setting Max Read Request Size.\n"

	.no_dead_strip	_mthca_tune_pci
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mthca_tune_pci
_mthca_tune_pci:                        ; @mthca_tune_pci
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _tune_pci@GOTPAGE
Lloh1:
	ldr	x8, [x8, _tune_pci@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbz	w8, LBB0_12
; %bb.1:
	mov	x19, x0
	ldr	w0, [x0, #4]
Lloh3:
	adrp	x8, _PCI_CAP_ID_PCIX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PCI_CAP_ID_PCIX@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_pci_find_capability
	cbz	x0, LBB0_4
; %bb.2:
	ldr	w20, [x19, #4]
	mov	x0, x20
	bl	_pcix_get_max_mmrbc
	mov	x1, x0
	mov	x0, x20
	bl	_pcix_set_mmrbc
	cbz	x0, LBB0_6
; %bb.3:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_9
LBB0_4:
	ldr	w8, [x19]
Lloh8:
	adrp	x9, _MTHCA_FLAG_PCIE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MTHCA_FLAG_PCIE@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_6
; %bb.5:
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_mthca_info
LBB0_6:
	ldr	w0, [x19, #4]
	bl	_pci_is_pcie
	cbz	x0, LBB0_10
; %bb.7:
	ldr	w0, [x19, #4]
	mov	w1, #4096
	bl	_pcie_set_readrq
	cbz	x0, LBB0_13
; %bb.8:
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_9:
	mov	x0, x19
	bl	_mthca_err
Lloh15:
	adrp	x8, _ENODEV@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_13
LBB0_10:
	ldr	w8, [x19]
Lloh18:
	adrp	x9, _MTHCA_FLAG_PCIE@GOTPAGE
Lloh19:
	ldr	x9, [x9, _MTHCA_FLAG_PCIE@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.11:
Lloh21:
	adrp	x1, l_.str.3@PAGE
Lloh22:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_mthca_info
LBB0_12:
	mov	w0, #0
LBB0_13:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_tune_pci,4,2                   ; @tune_pci
	.comm	_PCI_CAP_ID_PCIX,4,2            ; @PCI_CAP_ID_PCIX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't set PCI-X max read count, aborting.\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_MTHCA_FLAG_PCIE,4,2            ; @MTHCA_FLAG_PCIE
l_.str.1:                               ; @.str.1
	.asciz	"No PCI-X capability, not setting RBC.\n"

l_.str.2:                               ; @.str.2
	.asciz	"Couldn't write PCI Express read request, aborting.\n"

l_.str.3:                               ; @.str.3
	.asciz	"No PCI Express capability, not setting Max Read Request Size.\n"

	.no_dead_strip	_mthca_tune_pci
.subsections_via_symbols
