	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function myri10ge_select_firmware
_myri10ge_select_firmware:              ## @myri10ge_select_firmware
	.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	_myri10ge_force_firmware@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	je	LBB0_6
## %bb.1:
	testl	%eax, %eax
	jne	LBB0_7
## %bb.2:
	movq	24(%rbx), %rdi
	movq	_PCI_EXP_LNKSTA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdx
	callq	_pcie_capability_read_word
	movl	-28(%rbp), %edx
	shrl	$4, %edx
	andl	$63, %edx
	cmpl	$7, %edx
	ja	LBB0_5
## %bb.3:
	movq	24(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_info
	jmp	LBB0_4
LBB0_6:
	movq	24(%rbx), %rdi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_info
LBB0_4:
	movl	$4096, (%rbx)                   ## imm = 0x1000
	movq	_myri10ge_fw_aligned@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_7:
	movq	24(%rbx), %rdi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_info
	movl	$2048, (%rbx)                   ## imm = 0x800
	movq	_myri10ge_fw_unaligned@GOTPCREL(%rip), %rax
LBB0_8:
	movq	(%rax), %rsi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_set_fw_name
LBB0_9:
	movq	_THIS_MODULE@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_kernel_param_lock
	movq	_myri10ge_fw_name@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movb	$1, %r14b
	testq	%rdi, %rdi
	je	LBB0_12
## %bb.10:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kstrdup
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	movl	$1, %edx
	callq	_set_fw_name
	xorl	%r14d, %r14d
LBB0_12:
	movl	(%r15), %edi
	callq	_kernel_param_unlock
	movq	8(%rbx), %rax
	movq	_MYRI10GE_MAX_BOARDS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jae	LBB0_16
## %bb.13:
	movq	_myri10ge_fw_names@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx,%rax,8), %rsi
	testq	%rsi, %rsi
	je	LBB0_16
## %bb.14:
	cmpb	$0, (%rsi)
	je	LBB0_16
## %bb.15:
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_set_fw_name
	jmp	LBB0_17
LBB0_16:
	testb	%r14b, %r14b
	jne	LBB0_18
LBB0_17:
	movq	24(%rbx), %rdi
	movl	16(%rbx), %edx
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_info
LBB0_18:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%rbx, %rdi
	callq	_myri10ge_firmware_probe
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_myri10ge_force_firmware,4,2    ## @myri10ge_force_firmware
	.comm	_PCI_EXP_LNKSTA,4,2             ## @PCI_EXP_LNKSTA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PCIE x%d Link\n"

	.comm	_myri10ge_fw_aligned,8,3        ## @myri10ge_fw_aligned
L_.str.1:                               ## @.str.1
	.asciz	"Assuming aligned completions (forced)\n"

L_.str.2:                               ## @.str.2
	.asciz	"Assuming unaligned completions (forced)\n"

	.comm	_myri10ge_fw_unaligned,8,3      ## @myri10ge_fw_unaligned
	.comm	_THIS_MODULE,4,2                ## @THIS_MODULE
	.comm	_myri10ge_fw_name,8,3           ## @myri10ge_fw_name
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_MYRI10GE_MAX_BOARDS,8,3        ## @MYRI10GE_MAX_BOARDS
	.comm	_myri10ge_fw_names,8,3          ## @myri10ge_fw_names
L_.str.3:                               ## @.str.3
	.asciz	"overriding firmware to %s\n"

	.no_dead_strip	_myri10ge_select_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function myri10ge_select_firmware
_myri10ge_select_firmware:              ; @myri10ge_select_firmware
	.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
Lloh0:
	adrp	x8, _myri10ge_force_firmware@GOTPAGE
Lloh1:
	ldr	x8, [x8, _myri10ge_force_firmware@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #1
	b.eq	LBB0_4
; %bb.1:
	cbnz	w8, LBB0_6
; %bb.2:
	ldr	x0, [x19, #24]
Lloh3:
	adrp	x8, _PCI_EXP_LNKSTA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PCI_EXP_LNKSTA@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_pcie_capability_read_word
	ldr	w8, [sp, #12]
	ubfx	w8, w8, #4, #6
	cmp	w8, #7
	b.hi	LBB0_19
; %bb.3:
	ldr	x0, [x19, #24]
	str	x8, [sp]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_5
LBB0_4:
	ldr	x0, [x19, #24]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_5:
	bl	_dev_info
	mov	w8, #4096
	str	w8, [x19]
Lloh10:
	adrp	x8, _myri10ge_fw_aligned@GOTPAGE
Lloh11:
	ldr	x8, [x8, _myri10ge_fw_aligned@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
	ldr	x0, [x19, #24]
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_info
	mov	w8, #2048
	str	w8, [x19]
Lloh14:
	adrp	x8, _myri10ge_fw_unaligned@GOTPAGE
Lloh15:
	ldr	x8, [x8, _myri10ge_fw_unaligned@GOTPAGEOFF]
LBB0_7:
	ldr	x1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_set_fw_name
LBB0_8:
Lloh16:
	adrp	x20, _THIS_MODULE@GOTPAGE
Lloh17:
	ldr	x20, [x20, _THIS_MODULE@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_kernel_param_lock
Lloh18:
	adrp	x8, _myri10ge_fw_name@GOTPAGE
Lloh19:
	ldr	x8, [x8, _myri10ge_fw_name@GOTPAGEOFF]
Lloh20:
	ldr	x0, [x8]
	cbz	x0, LBB0_11
; %bb.9:
Lloh21:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	bl	_kstrdup
	cbz	x0, LBB0_11
; %bb.10:
	mov	x1, x0
	mov	x0, x19
	mov	w2, #1
	bl	_set_fw_name
	mov	w21, #0
	b	LBB0_12
LBB0_11:
	mov	w21, #1
LBB0_12:
	ldr	w0, [x20]
	bl	_kernel_param_unlock
	ldr	x8, [x19, #8]
Lloh24:
	adrp	x9, _MYRI10GE_MAX_BOARDS@GOTPAGE
Lloh25:
	ldr	x9, [x9, _MYRI10GE_MAX_BOARDS@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x8, x9
	b.hs	LBB0_16
; %bb.13:
Lloh27:
	adrp	x9, _myri10ge_fw_names@GOTPAGE
Lloh28:
	ldr	x9, [x9, _myri10ge_fw_names@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	ldr	x1, [x9, x8, lsl #3]
	cbz	x1, LBB0_16
; %bb.14:
	ldrb	w8, [x1]
	cbz	w8, LBB0_16
; %bb.15:
	mov	x0, x19
	mov	w2, #0
	bl	_set_fw_name
	b	LBB0_17
LBB0_16:
	tbnz	w21, #0, LBB0_18
LBB0_17:
	ldr	x0, [x19, #24]
	ldr	w8, [x19, #16]
	str	x8, [sp]
Lloh30:
	adrp	x1, l_.str.3@PAGE
Lloh31:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_info
LBB0_18:
	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
LBB0_19:
	mov	x0, x19
	bl	_myri10ge_firmware_probe
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_myri10ge_force_firmware,4,2    ; @myri10ge_force_firmware
	.comm	_PCI_EXP_LNKSTA,4,2             ; @PCI_EXP_LNKSTA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PCIE x%d Link\n"

	.comm	_myri10ge_fw_aligned,8,3        ; @myri10ge_fw_aligned
l_.str.1:                               ; @.str.1
	.asciz	"Assuming aligned completions (forced)\n"

l_.str.2:                               ; @.str.2
	.asciz	"Assuming unaligned completions (forced)\n"

	.comm	_myri10ge_fw_unaligned,8,3      ; @myri10ge_fw_unaligned
	.comm	_THIS_MODULE,4,2                ; @THIS_MODULE
	.comm	_myri10ge_fw_name,8,3           ; @myri10ge_fw_name
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_MYRI10GE_MAX_BOARDS,8,3        ; @MYRI10GE_MAX_BOARDS
	.comm	_myri10ge_fw_names,8,3          ; @myri10ge_fw_names
l_.str.3:                               ; @.str.3
	.asciz	"overriding firmware to %s\n"

	.no_dead_strip	_myri10ge_select_firmware
.subsections_via_symbols
