	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bnx2x_nvram_write
_bnx2x_nvram_write:                     ## @bnx2x_nvram_write
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movl	%esi, %r14d
	movq	%rdi, %r15
	cmpl	$1, %ecx
	jne	LBB0_1
## %bb.27:
	movq	%r15, %rdi
	movl	%r14d, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bnx2x_nvram_write1             ## TAILCALL
LBB0_1:
	movl	%ecx, %ebx
	testb	$3, %r14b
	je	LBB0_2
LBB0_4:
	movq	_BNX2X_MSG_ETHTOOL@GOTPCREL(%rip), %rax
	movq	_BNX2X_MSG_NVM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%r13d, %r13d
	movl	%r14d, %edx
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_DP
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
LBB0_26:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	testl	%ebx, %ebx
	je	LBB0_4
## %bb.3:
	movl	%ebx, %eax
	andl	$3, %eax
	jne	LBB0_4
## %bb.6:
	leal	(%rbx,%r14), %eax
	movl	(%r15), %r8d
	cmpl	%r8d, %eax
	jle	LBB0_8
## %bb.7:
	movq	_BNX2X_MSG_ETHTOOL@GOTPCREL(%rip), %rax
	movq	_BNX2X_MSG_NVM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%r13d, %r13d
	movl	%r14d, %edx
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_DP
	jmp	LBB0_5
LBB0_8:
	movq	%r15, %rdi
	callq	_bnx2x_acquire_nvram_lock
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_26
## %bb.9:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_bnx2x_enable_nvram_access
	testl	%ebx, %ebx
	jle	LBB0_10
## %bb.11:
	movq	_MCPR_NVM_COMMAND_FIRST@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movl	%ebx, %eax
	addq	$-4, %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	xorl	%esi, %esi
	movq	_MCPR_NVM_COMMAND_LAST@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movslq	%esi, %rax
	cmpq	%rax, -80(%rbp)                 ## 8-byte Folded Reload
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	orl	(%rbx), %r15d
	leal	4(%r14), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	jmp	LBB0_18
LBB0_14:                                ##   in Loop: Header=BB0_12 Depth=1
	leal	4(%r14), %edi
	movq	_BNX2X_NVRAM_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%edi, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	movl	%edi, -48(%rbp)                 ## 4-byte Spill
	je	LBB0_15
## %bb.16:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	%r14d, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	jne	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	_MCPR_NVM_COMMAND_FIRST@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	jmp	LBB0_18
LBB0_15:                                ##   in Loop: Header=BB0_12 Depth=1
	orl	(%rbx), %r15d
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_12 Depth=1
	leaq	-60(%rbp), %rdi
	movq	%r12, %rsi
	movl	$4, %edx
	callq	_memcpy
	movl	-60(%rbp), %edx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r14d, %esi
	movl	%r15d, %ecx
	callq	_bnx2x_nvram_write_dword
	movl	%eax, %r13d
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	addl	$4, %esi
	testl	%r15d, (%rbx)
	je	LBB0_19
## %bb.23:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	cmpl	%r15d, %esi
	jge	LBB0_20
## %bb.24:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	_BNX2X_MSG_NVM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_BNX2X_MSG_ETHTOOL@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	xorl	%r13d, %r13d
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	leaq	L_.str.2(%rip), %rsi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_DP
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_bnx2x_release_nvram_lock
	movl	$1000, %edi                     ## imm = 0x3E8
	movl	$2000, %esi                     ## imm = 0x7D0
	callq	_usleep_range
	movq	%rbx, %rdi
	callq	_bnx2x_acquire_nvram_lock
	movq	_MCPR_NVM_COMMAND_LAST@GOTPCREL(%rip), %rbx
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	testl	%eax, %eax
	jne	LBB0_25
LBB0_20:                                ##   in Loop: Header=BB0_12 Depth=1
	cmpl	%r15d, %esi
	jl	LBB0_21
	jmp	LBB0_22
LBB0_19:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	cmpl	%r15d, %esi
	jge	LBB0_22
LBB0_21:                                ##   in Loop: Header=BB0_12 Depth=1
	addq	$16, %r12
	xorl	%r15d, %r15d
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, %r14d
	testl	%r13d, %r13d
	je	LBB0_12
	jmp	LBB0_22
LBB0_10:
	xorl	%r13d, %r13d
LBB0_22:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_bnx2x_disable_nvram_access
	movq	%rbx, %rdi
	callq	_bnx2x_release_nvram_lock
	jmp	LBB0_26
LBB0_25:
	movl	%eax, %r13d
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
	.comm	_BNX2X_MSG_ETHTOOL,4,2          ## @BNX2X_MSG_ETHTOOL
	.comm	_BNX2X_MSG_NVM,4,2              ## @BNX2X_MSG_NVM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid parameter: offset 0x%x  buf_size 0x%x\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Invalid parameter: offset (0x%x) + buf_size (0x%x) > flash_size (0x%x)\n"

	.comm	_MCPR_NVM_COMMAND_FIRST,4,2     ## @MCPR_NVM_COMMAND_FIRST
	.comm	_MCPR_NVM_COMMAND_LAST,4,2      ## @MCPR_NVM_COMMAND_LAST
	.comm	_BNX2X_NVRAM_PAGE_SIZE,4,2      ## @BNX2X_NVRAM_PAGE_SIZE
L_.str.2:                               ## @.str.2
	.asciz	"Releasing NVM lock after offset 0x%x\n"

	.no_dead_strip	_bnx2x_nvram_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bnx2x_nvram_write
_bnx2x_nvram_write:                     ; @bnx2x_nvram_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
	cmp	w3, #1
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x20
	mov	x1, x22
	mov	x2, x21
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_bnx2x_nvram_write1
LBB0_2:
	mov	x19, x3
	tst	w22, #0x3
	b.eq	LBB0_6
LBB0_3:
Lloh0:
	adrp	x8, _BNX2X_MSG_ETHTOOL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BNX2X_MSG_ETHTOOL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _BNX2X_MSG_NVM@GOTPAGE
Lloh4:
	ldr	x9, [x9, _BNX2X_MSG_NVM@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w0, w9, w8
	str	x19, [sp]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
LBB0_4:
	mov	x2, x22
	bl	_DP
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w25, w8
LBB0_5:
	mov	x0, x25
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_6:
	cbz	w19, LBB0_3
; %bb.7:
	and	w8, w19, #0x3
	cbnz	w8, LBB0_3
; %bb.8:
	ldr	w8, [x20]
	add	w9, w19, w22
	cmp	w9, w8
	b.le	LBB0_10
; %bb.9:
Lloh11:
	adrp	x9, _BNX2X_MSG_ETHTOOL@GOTPAGE
Lloh12:
	ldr	x9, [x9, _BNX2X_MSG_ETHTOOL@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
Lloh14:
	adrp	x10, _BNX2X_MSG_NVM@GOTPAGE
Lloh15:
	ldr	x10, [x10, _BNX2X_MSG_NVM@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
	orr	w0, w10, w9
                                        ; kill: def $w19 killed $w19 killed $x19 def $x19
	stp	x19, x8, [sp]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_4
LBB0_10:
	mov	x0, x20
	bl	_bnx2x_acquire_nvram_lock
	mov	x25, x0
	cbnz	w0, LBB0_5
; %bb.11:
	mov	x0, x20
	bl	_bnx2x_enable_nvram_access
	cmp	w19, #1
	b.lt	LBB0_25
; %bb.12:
	mov	w26, #0
Lloh19:
	adrp	x8, _MCPR_NVM_COMMAND_FIRST@GOTPAGE
Lloh20:
	ldr	x8, [x8, _MCPR_NVM_COMMAND_FIRST@GOTPAGEOFF]
Lloh21:
	ldr	w24, [x8]
	mov	w8, w19
	sub	x28, x8, #4
Lloh22:
	adrp	x27, _MCPR_NVM_COMMAND_LAST@GOTPAGE
Lloh23:
	ldr	x27, [x27, _MCPR_NVM_COMMAND_LAST@GOTPAGEOFF]
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	cmp	x28, w26, sxtw
	b.ne	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w8, [x27]
	orr	w24, w8, w24
	add	w23, w22, #4
	b	LBB0_20
LBB0_15:                                ;   in Loop: Header=BB0_13 Depth=1
	add	w23, w22, #4
Lloh24:
	adrp	x8, _BNX2X_NVRAM_PAGE_SIZE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _BNX2X_NVRAM_PAGE_SIZE@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	sdiv	w9, w23, w8
	msub	w9, w9, w8, w23
	cbz	w9, LBB0_18
; %bb.16:                               ;   in Loop: Header=BB0_13 Depth=1
	sdiv	w9, w22, w8
	msub	w8, w9, w8, w22
	cbnz	w8, LBB0_20
; %bb.17:                               ;   in Loop: Header=BB0_13 Depth=1
Lloh27:
	adrp	x8, _MCPR_NVM_COMMAND_FIRST@GOTPAGE
Lloh28:
	ldr	x8, [x8, _MCPR_NVM_COMMAND_FIRST@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	b	LBB0_19
LBB0_18:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	w8, [x27]
LBB0_19:                                ;   in Loop: Header=BB0_13 Depth=1
	orr	w24, w8, w24
LBB0_20:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x0, sp, #28
	mov	x1, x21
	mov	w2, #4
	bl	_memcpy
	ldr	w2, [sp, #28]
	mov	x0, x20
	mov	x1, x22
	mov	x3, x24
	bl	_bnx2x_nvram_write_dword
	add	w26, w26, #4
	ldr	w8, [x27]
	and	w8, w8, w24
	cmp	w8, #0
	ccmp	w26, w19, #0, ne
	b.lt	LBB0_22
; %bb.21:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	x25, x0
	b	LBB0_23
LBB0_22:                                ;   in Loop: Header=BB0_13 Depth=1
Lloh30:
	adrp	x8, _BNX2X_MSG_ETHTOOL@GOTPAGE
Lloh31:
	ldr	x8, [x8, _BNX2X_MSG_ETHTOOL@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
Lloh33:
	adrp	x9, _BNX2X_MSG_NVM@GOTPAGE
Lloh34:
	ldr	x9, [x9, _BNX2X_MSG_NVM@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	orr	w0, w9, w8
Lloh36:
	adrp	x1, l_.str.2@PAGE
Lloh37:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x22
	bl	_DP
	mov	x0, x20
	bl	_bnx2x_release_nvram_lock
	mov	w0, #1000
	mov	w1, #2000
	bl	_usleep_range
	mov	x0, x20
	bl	_bnx2x_acquire_nvram_lock
	mov	x25, x0
	cbnz	w0, LBB0_5
LBB0_23:                                ;   in Loop: Header=BB0_13 Depth=1
	cmp	w26, w19
	b.ge	LBB0_26
; %bb.24:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	w24, #0
	add	x21, x21, #16
	mov	x22, x23
	cbz	w25, LBB0_13
	b	LBB0_26
LBB0_25:
	mov	w25, #0
LBB0_26:
	mov	x0, x20
	bl	_bnx2x_disable_nvram_access
	mov	x0, x20
	bl	_bnx2x_release_nvram_lock
	b	LBB0_5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_BNX2X_MSG_ETHTOOL,4,2          ; @BNX2X_MSG_ETHTOOL
	.comm	_BNX2X_MSG_NVM,4,2              ; @BNX2X_MSG_NVM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid parameter: offset 0x%x  buf_size 0x%x\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Invalid parameter: offset (0x%x) + buf_size (0x%x) > flash_size (0x%x)\n"

	.comm	_MCPR_NVM_COMMAND_FIRST,4,2     ; @MCPR_NVM_COMMAND_FIRST
	.comm	_MCPR_NVM_COMMAND_LAST,4,2      ; @MCPR_NVM_COMMAND_LAST
	.comm	_BNX2X_NVRAM_PAGE_SIZE,4,2      ; @BNX2X_NVRAM_PAGE_SIZE
l_.str.2:                               ; @.str.2
	.asciz	"Releasing NVM lock after offset 0x%x\n"

	.no_dead_strip	_bnx2x_nvram_write
.subsections_via_symbols
