	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function myri10ge_adopt_running_firmware
_myri10ge_adopt_running_firmware:       ## @myri10ge_adopt_running_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	32(%rdi), %r14
	movq	_MCP_HEADER_PTR_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	24(%r15), %rdi
	callq	_readl
	movl	%eax, %edi
	callq	_swab32
	movq	%rax, %rbx
	testb	$3, %bl
	jne	LBB0_2
## %bb.1:
	movq	%rbx, %rax
	addq	$4, %rax
	cmpq	(%r15), %rax
	jbe	LBB0_5
LBB0_2:
	leaq	L_.str(%rip), %rsi
	xorl	%r12d, %r12d
	movq	%r14, %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_3:
	subl	(%rax), %r12d
LBB0_4:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.6:
	movq	%rax, %r13
	movq	24(%r15), %rsi
	addq	%rbx, %rsi
	movl	$4, %edx
	movq	%rax, %rdi
	callq	_memcpy_fromio
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_myri10ge_validate_firmware
	movl	%eax, %r12d
	movq	%r13, %rdi
	callq	_kfree
	cmpl	$1, 8(%r15)
	jne	LBB0_4
## %bb.7:
	cmpl	$4, 12(%r15)
	jne	LBB0_4
## %bb.8:
	movl	16(%r15), %r8d
	leal	-4(%r8), %eax
	cmpl	$7, %eax
	ja	LBB0_4
## %bb.9:
	movl	$1, 20(%r15)
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	movl	$1, %edx
	movl	$4, %ecx
                                        ## kill: def $r8d killed $r8d killed $r8
	callq	_dev_warn
	jmp	LBB0_4
LBB0_10:
	leaq	L_.str.1(%rip), %rsi
	xorl	%r12d, %r12d
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_MCP_HEADER_PTR_OFFSET,8,3      ## @MCP_HEADER_PTR_OFFSET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Running firmware has bad header offset (%d)\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.1:                               ## @.str.1
	.asciz	"could not malloc firmware hdr\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.2:                               ## @.str.2
	.asciz	"Adopting fw %d.%d.%d: working around rx filter bug\n"

	.no_dead_strip	_myri10ge_adopt_running_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function myri10ge_adopt_running_firmware
_myri10ge_adopt_running_firmware:       ; @myri10ge_adopt_running_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	x20, x0
	ldp	x8, x19, [x0, #24]
Lloh0:
	adrp	x9, _MCP_HEADER_PTR_OFFSET@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MCP_HEADER_PTR_OFFSET@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
	bl	_swab32
	mov	x21, x0
	tst	x0, #0x3
	b.ne	LBB0_2
; %bb.1:
	add	x8, x21, #4
	ldr	x9, [x20]
	cmp	x8, x9
	b.ls	LBB0_5
LBB0_2:
	str	x21, [sp]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh5:
	adrp	x8, _EIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_4:
	mov	x0, x21
	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_5:
Lloh7:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	w0, #4
	bl	_kmalloc
	cbz	x0, LBB0_10
; %bb.6:
	mov	x22, x0
	ldr	x8, [x20, #24]
	add	x1, x8, x21
	mov	w2, #4
	bl	_memcpy_fromio
	mov	x0, x20
	mov	x1, x22
	bl	_myri10ge_validate_firmware
	mov	x21, x0
	mov	x0, x22
	bl	_kfree
	ldr	w8, [x20, #8]
	cmp	w8, #1
	b.ne	LBB0_4
; %bb.7:
	ldr	w8, [x20, #12]
	cmp	w8, #4
	b.ne	LBB0_4
; %bb.8:
	ldr	w4, [x20, #16]
	sub	w8, w4, #4
	cmp	w8, #7
	b.hi	LBB0_4
; %bb.9:
	mov	w8, #1
	str	w8, [x20, #20]
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	w2, #1
	mov	w3, #4
	bl	_dev_warn
	b	LBB0_4
LBB0_10:
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_MCP_HEADER_PTR_OFFSET,8,3      ; @MCP_HEADER_PTR_OFFSET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Running firmware has bad header offset (%d)\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.1:                               ; @.str.1
	.asciz	"could not malloc firmware hdr\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.2:                               ; @.str.2
	.asciz	"Adopting fw %d.%d.%d: working around rx filter bug\n"

	.no_dead_strip	_myri10ge_adopt_running_firmware
.subsections_via_symbols
