	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lan743x_eeprom_read
_lan743x_eeprom_read:                   ## @lan743x_eeprom_read
	.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, %r14
	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_8
LBB0_2:
	movq	%rdx, %r12
	movq	%rsi, %r15
	movq	%rdi, %r13
	callq	_lan743x_eeprom_confirm_not_busy
	testl	%eax, %eax
	jne	LBB0_8
## %bb.3:
	testq	%r12, %r12
	jle	LBB0_7
## %bb.4:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	leaq	(%r15,%rbx), %rax
	movq	_E2P_CMD_EPC_ADDR_MASK_@GOTPCREL(%rip), %rcx
	andq	(%rcx), %rax
	movq	_E2P_CMD_EPC_CMD_READ_@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movq	_E2P_CMD_EPC_BUSY_@GOTPCREL(%rip), %rcx
	orq	(%rcx), %rdx
	orq	%rax, %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_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_E2P_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_lan743x_csr_read
	movzbl	%al, %eax
	movq	%rax, (%r14,%rbx,8)
	incq	%rbx
	cmpq	%rbx, %r12
	jne	LBB0_5
LBB0_7:
	xorl	%eax, %eax
LBB0_8:
	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_READ_,8,3      ## @E2P_CMD_EPC_CMD_READ_
	.comm	_E2P_CMD_EPC_ADDR_MASK_,8,3     ## @E2P_CMD_EPC_ADDR_MASK_
	.comm	_E2P_CMD,4,2                    ## @E2P_CMD
	.comm	_E2P_DATA,4,2                   ## @E2P_DATA
	.no_dead_strip	_lan743x_eeprom_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lan743x_eeprom_read
_lan743x_eeprom_read:                   ; @lan743x_eeprom_read
	.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_8
LBB0_2:
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	bl	_lan743x_eeprom_confirm_not_busy
	cbnz	w0, LBB0_8
; %bb.3:
	cmp	x20, #1
	b.lt	LBB0_7
; %bb.4:
Lloh6:
	adrp	x23, _E2P_CMD_EPC_BUSY_@GOTPAGE
Lloh7:
	ldr	x23, [x23, _E2P_CMD_EPC_BUSY_@GOTPAGEOFF]
Lloh8:
	adrp	x24, _E2P_CMD_EPC_CMD_READ_@GOTPAGE
Lloh9:
	ldr	x24, [x24, _E2P_CMD_EPC_CMD_READ_@GOTPAGEOFF]
Lloh10:
	adrp	x25, _E2P_CMD_EPC_ADDR_MASK_@GOTPAGE
Lloh11:
	ldr	x25, [x25, _E2P_CMD_EPC_ADDR_MASK_@GOTPAGEOFF]
Lloh12:
	adrp	x26, _E2P_CMD@GOTPAGE
Lloh13:
	ldr	x26, [x26, _E2P_CMD@GOTPAGEOFF]
Lloh14:
	adrp	x27, _E2P_DATA@GOTPAGE
Lloh15:
	ldr	x27, [x27, _E2P_DATA@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x23]
	ldr	x9, [x24]
	orr	x8, x9, x8
	ldr	x9, [x25]
	and	x9, x9, x21
	orr	x2, x8, x9
	ldr	w1, [x26]
	mov	x0, x22
	bl	_lan743x_csr_write
	mov	x0, x22
	bl	_lan743x_eeprom_wait
	tbnz	w0, #31, LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w1, [x27]
	mov	x0, x22
	bl	_lan743x_csr_read
	and	x8, x0, #0xff
	str	x8, [x19], #8
	add	x21, x21, #1
	subs	x20, x20, #1
	b.ne	LBB0_5
LBB0_7:
	mov	w0, #0
LBB0_8:
	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	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.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_READ_,8,3      ; @E2P_CMD_EPC_CMD_READ_
	.comm	_E2P_CMD_EPC_ADDR_MASK_,8,3     ; @E2P_CMD_EPC_ADDR_MASK_
	.comm	_E2P_CMD,4,2                    ; @E2P_CMD
	.comm	_E2P_DATA,4,2                   ; @E2P_DATA
	.no_dead_strip	_lan743x_eeprom_read
.subsections_via_symbols
