	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lan78xx_write_raw_eeprom
_lan78xx_write_raw_eeprom:              ## @lan78xx_write_raw_eeprom
	.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	%rcx, -64(%rbp)                 ## 8-byte Spill
	movl	%edx, %r13d
	movl	%esi, %r12d
	movq	%rdi, %rbx
	movq	_HW_CFG@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	leaq	-44(%rbp), %rdx
	callq	_lan78xx_read_reg
	movl	-44(%rbp), %r14d
	movq	(%rbx), %rax
	movq	_ID_REV_CHIP_ID_7800_@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	_HW_CFG_LED1_EN_@GOTPCREL(%rip), %rax
	movq	_HW_CFG_LED0_EN_@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	notl	%edx
	andl	%r14d, %edx
	movl	%edx, -44(%rbp)
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_lan78xx_write_reg
LBB0_2:
	movq	%rbx, %rdi
	callq	_lan78xx_eeprom_confirm_not_busy
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_5
## %bb.3:
	movq	_E2P_CMD_EPC_BUSY_@GOTPCREL(%rip), %rcx
	movq	_E2P_CMD_EPC_CMD_EWEN_@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	orl	(%rcx), %edx
	movl	%edx, -44(%rbp)
	movq	_E2P_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_lan78xx_write_reg
	shrl	$31, %eax
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_8
LBB0_4:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_5:
	movq	(%rbx), %rax
	movq	_ID_REV_CHIP_ID_7800_@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.6:
	movq	_HW_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_lan78xx_write_reg
LBB0_7:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	%rbx, %rdi
	callq	_lan78xx_wait_eeprom
	testl	%eax, %eax
	js	LBB0_15
## %bb.9:
	testl	%r13d, %r13d
	jle	LBB0_16
## %bb.10:
	movl	%r13d, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	%r12d, %r12d
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax,%r13,4), %edx
	movl	%edx, -44(%rbp)
	movq	_E2P_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_lan78xx_write_reg
	testl	%eax, %eax
	js	LBB0_4
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	leaq	(%r12,%r13), %rdx
	movq	_E2P_CMD_EPC_CMD_WRITE_@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_E2P_CMD_EPC_BUSY_@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_E2P_CMD_EPC_ADDR_MASK_@GOTPCREL(%rip), %rcx
	andl	(%rcx), %edx
	orl	%eax, %edx
	movl	%edx, -44(%rbp)
	movq	_E2P_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_lan78xx_write_reg
	testl	%eax, %eax
	js	LBB0_4
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	%rbx, %rdi
	callq	_lan78xx_wait_eeprom
	testl	%eax, %eax
	js	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_11 Depth=1
	incq	%r13
	xorl	%r15d, %r15d
	cmpq	%r13, -56(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_11
	jmp	LBB0_5
LBB0_15:
	movl	%eax, %r15d
	jmp	LBB0_5
LBB0_16:
	xorl	%r15d, %r15d
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_HW_CFG,4,2                     ## @HW_CFG
	.comm	_ID_REV_CHIP_ID_7800_,8,3       ## @ID_REV_CHIP_ID_7800_
	.comm	_HW_CFG_LED1_EN_,4,2            ## @HW_CFG_LED1_EN_
	.comm	_HW_CFG_LED0_EN_,4,2            ## @HW_CFG_LED0_EN_
	.comm	_E2P_CMD_EPC_BUSY_,4,2          ## @E2P_CMD_EPC_BUSY_
	.comm	_E2P_CMD_EPC_CMD_EWEN_,4,2      ## @E2P_CMD_EPC_CMD_EWEN_
	.comm	_E2P_CMD,4,2                    ## @E2P_CMD
	.comm	_EIO,4,2                        ## @EIO
	.comm	_E2P_DATA,4,2                   ## @E2P_DATA
	.comm	_E2P_CMD_EPC_CMD_WRITE_,4,2     ## @E2P_CMD_EPC_CMD_WRITE_
	.comm	_E2P_CMD_EPC_ADDR_MASK_,4,2     ## @E2P_CMD_EPC_ADDR_MASK_
	.no_dead_strip	_lan78xx_write_raw_eeprom
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lan78xx_write_raw_eeprom
_lan78xx_write_raw_eeprom:              ; @lan78xx_write_raw_eeprom
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x3
	mov	x23, x2
	mov	x22, x1
	mov	x19, x0
Lloh0:
	adrp	x25, _HW_CFG@GOTPAGE
Lloh1:
	ldr	x25, [x25, _HW_CFG@GOTPAGEOFF]
	ldr	w1, [x25]
	add	x2, sp, #12
	bl	_lan78xx_read_reg
	ldr	w20, [sp, #12]
	ldr	x8, [x19]
Lloh2:
	adrp	x26, _ID_REV_CHIP_ID_7800_@GOTPAGE
Lloh3:
	ldr	x26, [x26, _ID_REV_CHIP_ID_7800_@GOTPAGEOFF]
	ldr	x9, [x26]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh4:
	adrp	x8, _HW_CFG_LED1_EN_@GOTPAGE
Lloh5:
	ldr	x8, [x8, _HW_CFG_LED1_EN_@GOTPAGEOFF]
Lloh6:
	adrp	x9, _HW_CFG_LED0_EN_@GOTPAGE
Lloh7:
	ldr	x9, [x9, _HW_CFG_LED0_EN_@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bic	w2, w20, w8
	str	w2, [sp, #12]
	ldr	w1, [x25]
	mov	x0, x19
	bl	_lan78xx_write_reg
LBB0_2:
	mov	x0, x19
	bl	_lan78xx_eeprom_confirm_not_busy
	mov	x24, x0
	cbnz	w0, LBB0_5
; %bb.3:
Lloh10:
	adrp	x27, _E2P_CMD_EPC_BUSY_@GOTPAGE
Lloh11:
	ldr	x27, [x27, _E2P_CMD_EPC_BUSY_@GOTPAGEOFF]
	ldr	w8, [x27]
Lloh12:
	adrp	x9, _E2P_CMD_EPC_CMD_EWEN_@GOTPAGE
Lloh13:
	ldr	x9, [x9, _E2P_CMD_EPC_CMD_EWEN_@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w2, w9, w8
	str	w2, [sp, #12]
Lloh15:
	adrp	x28, _E2P_CMD@GOTPAGE
Lloh16:
	ldr	x28, [x28, _E2P_CMD@GOTPAGEOFF]
	ldr	w1, [x28]
	mov	x0, x19
	bl	_lan78xx_write_reg
	lsr	w0, w0, #31
	bl	_unlikely
	cbz	x0, LBB0_8
LBB0_4:
Lloh17:
	adrp	x8, _EIO@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_5:
	ldr	x8, [x19]
	ldr	x9, [x26]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.6:
	ldr	w1, [x25]
	mov	x0, x19
	mov	x2, x20
	bl	_lan78xx_write_reg
LBB0_7:
	mov	x0, x24
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_8:
	mov	x0, x19
	bl	_lan78xx_wait_eeprom
	tbnz	w0, #31, LBB0_15
; %bb.9:
	cmp	w23, #1
	b.lt	LBB0_16
; %bb.10:
	mov	w23, w23
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	w2, [x21]
	str	w2, [sp, #12]
Lloh20:
	adrp	x8, _E2P_DATA@GOTPAGE
Lloh21:
	ldr	x8, [x8, _E2P_DATA@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_lan78xx_write_reg
	tbnz	w0, #31, LBB0_4
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	w8, [x27]
Lloh23:
	adrp	x9, _E2P_CMD_EPC_CMD_WRITE_@GOTPAGE
Lloh24:
	ldr	x9, [x9, _E2P_CMD_EPC_CMD_WRITE_@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh26:
	adrp	x9, _E2P_CMD_EPC_ADDR_MASK_@GOTPAGE
Lloh27:
	ldr	x9, [x9, _E2P_CMD_EPC_ADDR_MASK_@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	and	w9, w9, w22
	orr	w2, w9, w8
	str	w2, [sp, #12]
	ldr	w1, [x28]
	mov	x0, x19
	bl	_lan78xx_write_reg
	tbnz	w0, #31, LBB0_4
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x19
	bl	_lan78xx_wait_eeprom
	tbnz	w0, #31, LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	w24, #0
	add	w22, w22, #1
	add	x21, x21, #4
	subs	x23, x23, #1
	b.ne	LBB0_11
	b	LBB0_5
LBB0_15:
	mov	x24, x0
	b	LBB0_5
LBB0_16:
	mov	w24, #0
	b	LBB0_5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh8
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_HW_CFG,4,2                     ; @HW_CFG
	.comm	_ID_REV_CHIP_ID_7800_,8,3       ; @ID_REV_CHIP_ID_7800_
	.comm	_HW_CFG_LED1_EN_,4,2            ; @HW_CFG_LED1_EN_
	.comm	_HW_CFG_LED0_EN_,4,2            ; @HW_CFG_LED0_EN_
	.comm	_E2P_CMD_EPC_BUSY_,4,2          ; @E2P_CMD_EPC_BUSY_
	.comm	_E2P_CMD_EPC_CMD_EWEN_,4,2      ; @E2P_CMD_EPC_CMD_EWEN_
	.comm	_E2P_CMD,4,2                    ; @E2P_CMD
	.comm	_EIO,4,2                        ; @EIO
	.comm	_E2P_DATA,4,2                   ; @E2P_DATA
	.comm	_E2P_CMD_EPC_CMD_WRITE_,4,2     ; @E2P_CMD_EPC_CMD_WRITE_
	.comm	_E2P_CMD_EPC_ADDR_MASK_,4,2     ; @E2P_CMD_EPC_ADDR_MASK_
	.no_dead_strip	_lan78xx_write_raw_eeprom
.subsections_via_symbols
