	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lan743x_eeprom_write
_lan743x_eeprom_write:                  ## @lan743x_eeprom_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %rbx
	leaq	(%rdx,%rsi), %rax
	movq	_MAX_EEPROM_SIZE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jle	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_9
LBB0_2:
	movq	%rdx, %r12
	movq	%rsi, %r15
	movq	%rdi, %r13
	callq	_lan743x_eeprom_confirm_not_busy
	testl	%eax, %eax
	jne	LBB0_9
## %bb.3:
	movq	_E2P_CMD_EPC_BUSY_@GOTPCREL(%rip), %rcx
	movq	_E2P_CMD_EPC_CMD_EWEN_@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	orq	(%rcx), %rdx
	movq	_E2P_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_lan743x_csr_write
	movq	%r13, %rdi
	callq	_lan743x_eeprom_wait
	testl	%eax, %eax
	js	LBB0_9
## %bb.4:
	testq	%r12, %r12
	jle	LBB0_8
## %bb.5:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	leaq	(%r15,%r14), %rbx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax,%r14,8), %rdx
	movq	_E2P_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_lan743x_csr_write
	movq	_E2P_CMD_EPC_CMD_WRITE_@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_E2P_CMD_EPC_BUSY_@GOTPCREL(%rip), %rcx
	orq	(%rcx), %rax
	movq	_E2P_CMD_EPC_ADDR_MASK_@GOTPCREL(%rip), %rcx
	andq	(%rcx), %rbx
	orq	%rax, %rbx
	movq	_E2P_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movq	%rbx, %rdx
	callq	_lan743x_csr_write
	movq	%r13, %rdi
	callq	_lan743x_eeprom_wait
	testl	%eax, %eax
	js	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	incq	%r14
	cmpq	%r14, %r12
	jne	LBB0_6
LBB0_8:
	xorl	%eax, %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_EEPROM_SIZE,8,3            ## @MAX_EEPROM_SIZE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_E2P_CMD_EPC_BUSY_,8,3          ## @E2P_CMD_EPC_BUSY_
	.comm	_E2P_CMD_EPC_CMD_EWEN_,8,3      ## @E2P_CMD_EPC_CMD_EWEN_
	.comm	_E2P_CMD,4,2                    ## @E2P_CMD
	.comm	_E2P_DATA,4,2                   ## @E2P_DATA
	.comm	_E2P_CMD_EPC_CMD_WRITE_,8,3     ## @E2P_CMD_EPC_CMD_WRITE_
	.comm	_E2P_CMD_EPC_ADDR_MASK_,8,3     ## @E2P_CMD_EPC_ADDR_MASK_
	.no_dead_strip	_lan743x_eeprom_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lan743x_eeprom_write
_lan743x_eeprom_write:                  ; @lan743x_eeprom_write
	.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
Lloh0:
	adrp	x8, _MAX_EEPROM_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_EEPROM_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	add	x9, x2, x1
	cmp	x9, x8
	b.le	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_2:
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	bl	_lan743x_eeprom_confirm_not_busy
	cbnz	w0, LBB0_9
; %bb.3:
Lloh6:
	adrp	x23, _E2P_CMD_EPC_BUSY_@GOTPAGE
Lloh7:
	ldr	x23, [x23, _E2P_CMD_EPC_BUSY_@GOTPAGEOFF]
Lloh8:
	adrp	x8, _E2P_CMD_EPC_CMD_EWEN_@GOTPAGE
Lloh9:
	ldr	x8, [x8, _E2P_CMD_EPC_CMD_EWEN_@GOTPAGEOFF]
	ldr	x9, [x23]
Lloh10:
	ldr	x8, [x8]
	orr	x2, x8, x9
Lloh11:
	adrp	x24, _E2P_CMD@GOTPAGE
Lloh12:
	ldr	x24, [x24, _E2P_CMD@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x22
	bl	_lan743x_csr_write
	mov	x0, x22
	bl	_lan743x_eeprom_wait
	tbnz	w0, #31, LBB0_9
; %bb.4:
	cmp	x20, #1
	b.lt	LBB0_8
; %bb.5:
Lloh13:
	adrp	x25, _E2P_DATA@GOTPAGE
Lloh14:
	ldr	x25, [x25, _E2P_DATA@GOTPAGEOFF]
Lloh15:
	adrp	x26, _E2P_CMD_EPC_CMD_WRITE_@GOTPAGE
Lloh16:
	ldr	x26, [x26, _E2P_CMD_EPC_CMD_WRITE_@GOTPAGEOFF]
Lloh17:
	adrp	x27, _E2P_CMD_EPC_ADDR_MASK_@GOTPAGE
Lloh18:
	ldr	x27, [x27, _E2P_CMD_EPC_ADDR_MASK_@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x2, [x19]
	ldr	w1, [x25]
	mov	x0, x22
	bl	_lan743x_csr_write
	ldr	x8, [x23]
	ldr	x9, [x26]
	orr	x8, x9, x8
	ldr	x9, [x27]
	and	x9, x9, x21
	orr	x2, x8, x9
	ldr	w1, [x24]
	mov	x0, x22
	bl	_lan743x_csr_write
	mov	x0, x22
	bl	_lan743x_eeprom_wait
	tbnz	w0, #31, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x21, x21, #1
	add	x19, x19, #8
	subs	x20, x20, #1
	b.ne	LBB0_6
LBB0_8:
	mov	w0, #0
LBB0_9:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_EEPROM_SIZE,8,3            ; @MAX_EEPROM_SIZE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_E2P_CMD_EPC_BUSY_,8,3          ; @E2P_CMD_EPC_BUSY_
	.comm	_E2P_CMD_EPC_CMD_EWEN_,8,3      ; @E2P_CMD_EPC_CMD_EWEN_
	.comm	_E2P_CMD,4,2                    ; @E2P_CMD
	.comm	_E2P_DATA,4,2                   ; @E2P_DATA
	.comm	_E2P_CMD_EPC_CMD_WRITE_,8,3     ; @E2P_CMD_EPC_CMD_WRITE_
	.comm	_E2P_CMD_EPC_ADDR_MASK_,8,3     ; @E2P_CMD_EPC_ADDR_MASK_
	.no_dead_strip	_lan743x_eeprom_write
.subsections_via_symbols
