	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function myri10ge_firmware_probe
_myri10ge_firmware_probe:               ## @myri10ge_firmware_probe
	.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	%rdi, %rbx
	movq	8(%rdi), %r14
	movl	$4096, (%rdi)                   ## imm = 0x1000
	movq	%r14, %rdi
	callq	_pcie_get_readrq
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	cmpl	$4096, %eax                     ## imm = 0x1000
	je	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_warn
	movl	$2048, (%rbx)                   ## imm = 0x800
LBB0_4:
	movq	_myri10ge_fw_aligned@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_set_fw_name
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_myri10ge_load_firmware
	testl	%eax, %eax
	jne	LBB0_10
## %bb.5:
	movq	%rbx, %rdi
	callq	_myri10ge_enable_ecrc
	movq	_MXGEFW_CMD_UNALIGNED_TEST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_myri10ge_dma_test
	testl	%eax, %eax
	je	LBB0_11
## %bb.6:
	movl	%eax, %r15d
	movq	_E2BIG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r15d, %eax
	je	LBB0_8
## %bb.7:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_dev_warn
LBB0_8:
	movq	_ENOSYS@GOTPCREL(%rip), %rax
	addl	(%rax), %r15d
	jne	LBB0_10
## %bb.9:
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_warn
	jmp	LBB0_10
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_dev_err
LBB0_10:
	movl	$2048, (%rbx)                   ## imm = 0x800
	movq	_myri10ge_fw_unaligned@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_set_fw_name                    ## TAILCALL
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't read max read req size: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Max Read Request size != 4096 (%d)\n"

	.comm	_myri10ge_fw_aligned,4,2        ## @myri10ge_fw_aligned
	.comm	_MXGEFW_CMD_UNALIGNED_TEST,4,2  ## @MXGEFW_CMD_UNALIGNED_TEST
	.comm	_E2BIG,4,2                      ## @E2BIG
L_.str.2:                               ## @.str.2
	.asciz	"DMA test failed: %d\n"

	.comm	_ENOSYS,4,2                     ## @ENOSYS
L_.str.3:                               ## @.str.3
	.asciz	"Falling back to ethp! Please install up to date fw\n"

	.comm	_myri10ge_fw_unaligned,4,2      ## @myri10ge_fw_unaligned
	.no_dead_strip	_myri10ge_firmware_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function myri10ge_firmware_probe
_myri10ge_firmware_probe:               ; @myri10ge_firmware_probe
	.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, x0
	ldr	x20, [x0, #8]
	mov	w8, #4096
	str	w8, [x0]
	mov	x0, x20
	bl	_pcie_get_readrq
	mov	x2, x0
	tbnz	w0, #31, LBB0_9
; %bb.1:
	cmp	w2, #1, lsl #12                 ; =4096
	b.eq	LBB0_3
; %bb.2:
	str	x2, [sp]
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_warn
	mov	w8, #2048
	str	w8, [x19]
LBB0_3:
Lloh2:
	adrp	x8, _myri10ge_fw_aligned@GOTPAGE
Lloh3:
	ldr	x8, [x8, _myri10ge_fw_aligned@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_set_fw_name
	mov	x0, x19
	mov	w1, #1
	bl	_myri10ge_load_firmware
	cbnz	w0, LBB0_10
; %bb.4:
	mov	x0, x19
	bl	_myri10ge_enable_ecrc
Lloh5:
	adrp	x8, _MXGEFW_CMD_UNALIGNED_TEST@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MXGEFW_CMD_UNALIGNED_TEST@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_myri10ge_dma_test
	cbz	w0, LBB0_11
; %bb.5:
	mov	x21, x0
Lloh8:
	adrp	x8, _E2BIG@GOTPAGE
Lloh9:
	ldr	x8, [x8, _E2BIG@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmn	w0, w8
	b.eq	LBB0_7
; %bb.6:
	str	x21, [sp]
Lloh11:
	adrp	x1, l_.str.2@PAGE
Lloh12:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_dev_warn
LBB0_7:
Lloh13:
	adrp	x8, _ENOSYS@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOSYS@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	cmn	w21, w8
	b.ne	LBB0_10
; %bb.8:
Lloh16:
	adrp	x1, l_.str.3@PAGE
Lloh17:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_dev_warn
	b	LBB0_10
LBB0_9:
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_dev_err
LBB0_10:
	mov	w8, #2048
	str	w8, [x19]
Lloh20:
	adrp	x8, _myri10ge_fw_unaligned@GOTPAGE
Lloh21:
	ldr	x8, [x8, _myri10ge_fw_unaligned@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	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
	b	_set_fw_name
LBB0_11:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't read max read req size: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Max Read Request size != 4096 (%d)\n"

	.comm	_myri10ge_fw_aligned,4,2        ; @myri10ge_fw_aligned
	.comm	_MXGEFW_CMD_UNALIGNED_TEST,4,2  ; @MXGEFW_CMD_UNALIGNED_TEST
	.comm	_E2BIG,4,2                      ; @E2BIG
l_.str.2:                               ; @.str.2
	.asciz	"DMA test failed: %d\n"

	.comm	_ENOSYS,4,2                     ; @ENOSYS
l_.str.3:                               ; @.str.3
	.asciz	"Falling back to ethp! Please install up to date fw\n"

	.comm	_myri10ge_fw_unaligned,4,2      ; @myri10ge_fw_unaligned
	.no_dead_strip	_myri10ge_firmware_probe
.subsections_via_symbols
