	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_e1000e_write_nvm_spi           ## -- Begin function e1000e_write_nvm_spi
	.p2align	4, 0x90
_e1000e_write_nvm_spi:                  ## @e1000e_write_nvm_spi
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rax
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	subq	%rsi, %rax
	jle	LBB0_5
## %bb.1:
	movq	%rdx, %r15
	testq	%rdx, %rdx
	je	LBB0_5
## %bb.2:
	cmpq	%r15, %rax
	jl	LBB0_5
## %bb.3:
	testq	%r15, %r15
	jle	LBB0_4
## %bb.6:
	movq	%rcx, %r14
	movq	%rdi, %r13
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	incq	%rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	%r13, %rdi
	callq	_e1000_standby_nvm
LBB0_20:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	$10000, %edi                    ## imm = 0x2710
	movl	$11000, %esi                    ## imm = 0x2AF8
	callq	_usleep_range
	movq	%r13, %rdi
	callq	*24(%r13)
	cmpq	%r15, %r12
	jge	LBB0_21
LBB0_7:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_14 Depth 2
	movq	_NVM_WRITE_OPCODE_SPI@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	callq	*32(%r13)
	testl	%eax, %eax
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%r13, %rdi
	callq	_e1000_ready_nvm_eeprom
	testl	%eax, %eax
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%r13, %rdi
	callq	_e1000_standby_nvm
	movq	_NVM_WREN_OPCODE_SPI@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movl	8(%r13), %edx
	movq	%r13, %rdi
	callq	_e1000_shift_out_eec_bits
	movq	%r13, %rdi
	callq	_e1000_standby_nvm
	cmpl	$8, 12(%r13)
	movl	$0, %esi
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	_NVM_A8_OPCODE_SPI@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
LBB0_13:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	8(%r13), %edx
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	cmpq	$127, %rbx
	movl	$0, %eax
	cmovleq	%rax, %rsi
	orq	-64(%rbp), %rsi                 ## 8-byte Folded Reload
	movq	%r13, %rdi
	callq	_e1000_shift_out_eec_bits
	leaq	(%r12,%rbx), %rsi
	addq	%rsi, %rsi
	movl	12(%r13), %edx
	movq	%r13, %rdi
	callq	_e1000_shift_out_eec_bits
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r12), %rbx
	addq	%rbx, %rbx
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_14 Depth=2
	movq	%rbx, %rax
	cqto
	idivq	%rcx
LBB0_18:                                ##   in Loop: Header=BB0_14 Depth=2
	incq	%r12
	addq	$2, %rbx
	testq	%rdx, %rdx
	je	LBB0_19
LBB0_14:                                ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	%r15, %r12
	jge	LBB0_20
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=2
	movq	(%r14,%r12,8), %rsi
	movq	%rsi, %rax
	sarq	$8, %rax
	shlq	$8, %rsi
	orq	%rax, %rsi
	movq	%r13, %rdi
	movl	$16, %edx
	callq	_e1000_shift_out_eec_bits
	movq	16(%r13), %rcx
	movq	%rbx, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	jne	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_14 Depth=2
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
	jmp	LBB0_18
LBB0_5:
	leaq	L_.str(%rip), %rdi
	callq	_e_dbg
LBB0_4:
	movq	_E1000_ERR_NVM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_22:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	%eax, %ebx
	jmp	LBB0_22
LBB0_10:
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	*24(%r13)
	jmp	LBB0_22
LBB0_21:
	xorl	%ebx, %ebx
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_E1000_ERR_NVM,4,2              ## @E1000_ERR_NVM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"nvm parameter(s) out of bounds\n"

	.comm	_NVM_WRITE_OPCODE_SPI,8,3       ## @NVM_WRITE_OPCODE_SPI
	.comm	_NVM_WREN_OPCODE_SPI,8,3        ## @NVM_WREN_OPCODE_SPI
	.comm	_NVM_A8_OPCODE_SPI,8,3          ## @NVM_A8_OPCODE_SPI
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_e1000e_write_nvm_spi           ; -- Begin function e1000e_write_nvm_spi
	.p2align	2
_e1000e_write_nvm_spi:                  ; @e1000e_write_nvm_spi
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	ldr	x8, [x0]
	subs	x8, x8, x1
	b.le	LBB0_13
; %bb.1:
	mov	x21, x2
	cbz	x2, LBB0_13
; %bb.2:
	cmp	x8, x21
	b.lt	LBB0_13
; %bb.3:
	cmp	x21, #1
	b.lt	LBB0_14
; %bb.4:
	mov	x20, x3
	mov	x22, x1
	mov	x19, x0
	mov	x24, #0
Lloh0:
	adrp	x25, _NVM_WRITE_OPCODE_SPI@GOTPAGE
Lloh1:
	ldr	x25, [x25, _NVM_WRITE_OPCODE_SPI@GOTPAGEOFF]
	add	x26, x1, #1
Lloh2:
	adrp	x27, _NVM_A8_OPCODE_SPI@GOTPAGE
Lloh3:
	ldr	x27, [x27, _NVM_A8_OPCODE_SPI@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x24, x23
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	w0, #10000
	mov	w1, #11000
	bl	_usleep_range
	ldr	x8, [x19, #24]
	mov	x0, x19
	blr	x8
	cmp	x24, x21
	b.ge	LBB0_18
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	ldr	x28, [x25]
	ldr	x8, [x19, #32]
	mov	x0, x19
	blr	x8
	cbnz	w0, LBB0_16
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x19
	bl	_e1000_ready_nvm_eeprom
	cbnz	w0, LBB0_17
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x19
	bl	_e1000_standby_nvm
Lloh4:
	adrp	x8, _NVM_WREN_OPCODE_SPI@GOTPAGE
Lloh5:
	ldr	x8, [x8, _NVM_WREN_OPCODE_SPI@GOTPAGEOFF]
Lloh6:
	ldr	x1, [x8]
	ldr	w2, [x19, #8]
	mov	x0, x19
	bl	_e1000_shift_out_eec_bits
	mov	x0, x19
	bl	_e1000_standby_nvm
	ldp	w2, w8, [x19, #8]
	cmp	w8, #8
	mov	w8, #127
	ccmp	x22, x8, #4, eq
	ldr	x8, [x27]
	csel	x8, x8, xzr, gt
	orr	x1, x8, x28
	mov	x0, x19
	bl	_e1000_shift_out_eec_bits
	add	x8, x24, x22
	lsl	x1, x8, #1
	ldr	w2, [x19, #12]
	mov	x0, x19
	bl	_e1000_shift_out_eec_bits
	cmp	x24, x21
	csel	x23, x24, x21, gt
	add	x8, x26, x24
	lsl	x28, x8, #1
LBB0_10:                                ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	x23, x24
	b.eq	LBB0_5
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	ldr	x8, [x20, x24, lsl #3]
	asr	x9, x8, #8
	orr	x1, x9, x8, lsl #8
	mov	x0, x19
	mov	w2, #16
	bl	_e1000_shift_out_eec_bits
	add	x24, x24, #1
	ldr	x8, [x19, #16]
	sdiv	x9, x28, x8
	msub	x8, x9, x8, x28
	add	x28, x28, #2
	cbnz	x8, LBB0_10
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x19
	bl	_e1000_standby_nvm
	b	LBB0_6
LBB0_13:
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_e_dbg
LBB0_14:
Lloh9:
	adrp	x8, _E1000_ERR_NVM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _E1000_ERR_NVM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_15:
	mov	x0, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_16:
	mov	x23, x0
	b	LBB0_15
LBB0_17:
	mov	x23, x0
	ldr	x8, [x19, #24]
	mov	x0, x19
	blr	x8
	b	LBB0_15
LBB0_18:
	mov	w23, #0
	b	LBB0_15
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_E1000_ERR_NVM,4,2              ; @E1000_ERR_NVM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"nvm parameter(s) out of bounds\n"

	.comm	_NVM_WRITE_OPCODE_SPI,8,3       ; @NVM_WRITE_OPCODE_SPI
	.comm	_NVM_WREN_OPCODE_SPI,8,3        ; @NVM_WREN_OPCODE_SPI
	.comm	_NVM_A8_OPCODE_SPI,8,3          ; @NVM_A8_OPCODE_SPI
.subsections_via_symbols
