	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function e1000_write_eeprom_spi
_e1000_write_eeprom_spi:                ## @e1000_write_eeprom_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
                                        ## kill: def $esi killed $esi def $rsi
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	testl	%edx, %edx
	jle	LBB0_12
## %bb.1:
	movl	%edx, %ebx
	movq	%rdi, %r13
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	incl	%eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	-60(%rbp), %ecx                 ## 4-byte Reload
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	%ecx, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	cmpl	%ebx, %ecx
	jge	LBB0_12
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	movq	_EEPROM_WRITE_OPCODE_SPI@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	%r13, %rdi
	callq	_e1000_spi_eeprom_ready
	testq	%rax, %rax
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, %rdi
	callq	_e1000_standby_eeprom
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_cond_resched
	movq	_EEPROM_WREN_OPCODE_SPI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r13), %edx
	movq	%r13, %rdi
	callq	_e1000_shift_out_ee_bits
	movq	%r13, %rdi
	callq	_e1000_standby_eeprom
	cmpl	$8, 4(%r13)
	movl	$0, %esi
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_EEPROM_A8_OPCODE_SPI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r13), %edx
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	cmpl	$127, %r14d
	cmovlel	%r15d, %esi
	orl	%r12d, %esi
	movq	%r13, %rdi
	callq	_e1000_shift_out_ee_bits
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	leal	(%rbx,%r14), %esi
	addl	%esi, %esi
	movl	4(%r13), %edx
	movq	%r13, %rdi
	callq	_e1000_shift_out_ee_bits
	movslq	%ebx, %rax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	cmpl	%ecx, %eax
	cmovgl	%eax, %ecx
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	movslq	%ecx, %r14
	subq	%rax, %r14
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax,4), %r12
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	leal	(%rcx,%rax), %ebx
	addl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	%r15, %r14
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=2
	movl	(%r12,%r15,4), %esi
	movl	%esi, %eax
	sarl	$8, %eax
	shll	$8, %esi
	orl	%eax, %esi
	movq	%r13, %rdi
	movl	$16, %edx
	callq	_e1000_shift_out_ee_bits
	movl	%ebx, %eax
	cltd
	idivl	8(%r13)
	incq	%r15
	addl	$2, %ebx
	testl	%edx, %edx
	jne	LBB0_7
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	addl	%r15d, %ebx
	movq	%r13, %rdi
	callq	_e1000_standby_eeprom
	movl	%ebx, %ecx
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	jmp	LBB0_11
LBB0_12:
	movq	_E1000_SUCCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_13
LBB0_3:
	movq	_E1000_ERR_EEPROM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EEPROM_WRITE_OPCODE_SPI,4,2    ## @EEPROM_WRITE_OPCODE_SPI
	.comm	_E1000_ERR_EEPROM,4,2           ## @E1000_ERR_EEPROM
	.comm	_EEPROM_WREN_OPCODE_SPI,4,2     ## @EEPROM_WREN_OPCODE_SPI
	.comm	_EEPROM_A8_OPCODE_SPI,4,2       ## @EEPROM_A8_OPCODE_SPI
	.comm	_E1000_SUCCESS,4,2              ## @E1000_SUCCESS
	.no_dead_strip	_e1000_write_eeprom_spi
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function e1000_write_eeprom_spi
_e1000_write_eeprom_spi:                ; @e1000_write_eeprom_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
	cmp	w2, #1
	b.lt	LBB0_8
; %bb.1:
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	mov	w23, #0
	add	w25, w1, #1
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x23, x26
	cmp	w23, w20
	b.ge	LBB0_8
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
Lloh0:
	adrp	x8, _EEPROM_WRITE_OPCODE_SPI@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EEPROM_WRITE_OPCODE_SPI@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
	mov	x0, x22
	bl	_e1000_spi_eeprom_ready
	cbnz	x0, LBB0_9
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x22
	bl	_e1000_standby_eeprom
	bl	_cond_resched
Lloh3:
	adrp	x8, _EEPROM_WREN_OPCODE_SPI@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EEPROM_WREN_OPCODE_SPI@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	ldr	w2, [x22]
	mov	x0, x22
	bl	_e1000_shift_out_ee_bits
	mov	x0, x22
	bl	_e1000_standby_eeprom
	ldp	w2, w8, [x22]
	cmp	w8, #8
	mov	w8, #127
	ccmp	w21, w8, #4, eq
Lloh6:
	adrp	x8, _EEPROM_A8_OPCODE_SPI@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EEPROM_A8_OPCODE_SPI@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	csel	w8, w8, wzr, gt
	orr	w1, w8, w24
	mov	x0, x22
	bl	_e1000_shift_out_ee_bits
	add	w8, w23, w21
	lsl	w1, w8, #1
	ldr	w2, [x22, #4]
	mov	x0, x22
	bl	_e1000_shift_out_ee_bits
	sxtw	x8, w23
	cmp	w23, w20
	csel	w26, w23, w20, gt
	sxtw	x9, w26
	sub	x27, x9, x8
	add	x28, x19, w23, sxtw #2
	add	w8, w25, w23
	lsl	w24, w8, #1
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cbz	x27, LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	ldr	w8, [x28], #4
	asr	w9, w8, #8
	orr	w1, w9, w8, lsl #8
	mov	x0, x22
	mov	w2, #16
	bl	_e1000_shift_out_ee_bits
	ldr	w8, [x22, #8]
	sdiv	w9, w24, w8
	msub	w8, w9, w8, w24
	sub	x27, x27, #1
	add	w23, w23, #1
	add	w24, w24, #2
	cbnz	w8, LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x22
	bl	_e1000_standby_eeprom
	cmp	w23, w20
	b.lt	LBB0_3
LBB0_8:
Lloh9:
	adrp	x8, _E1000_SUCCESS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _E1000_SUCCESS@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	b	LBB0_10
LBB0_9:
Lloh12:
	adrp	x8, _E1000_ERR_EEPROM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _E1000_ERR_EEPROM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EEPROM_WRITE_OPCODE_SPI,4,2    ; @EEPROM_WRITE_OPCODE_SPI
	.comm	_E1000_ERR_EEPROM,4,2           ; @E1000_ERR_EEPROM
	.comm	_EEPROM_WREN_OPCODE_SPI,4,2     ; @EEPROM_WREN_OPCODE_SPI
	.comm	_EEPROM_A8_OPCODE_SPI,4,2       ; @EEPROM_A8_OPCODE_SPI
	.comm	_E1000_SUCCESS,4,2              ; @E1000_SUCCESS
	.no_dead_strip	_e1000_write_eeprom_spi
.subsections_via_symbols
