	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function netdev_set_eeprom
_netdev_set_eeprom:                     ## @netdev_set_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	%rdx, %r12
	movq	%rsi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_netdev_priv
	movq	%rax, %r15
	movq	_EEPROM_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	leaq	(,%r13,8), %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	movq	(%rbx), %rax
	movq	_EEPROM_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.2:
	movq	(%r15), %r15
	movl	8(%rbx), %edx
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movl	12(%rbx), %eax
	leal	(%rdx,%rax), %ecx
	addl	%edx, %eax
	incl	%eax
	shrl	$31, %eax
	addl	%ecx, %eax
	incl	%eax
	sarl	%eax
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%edx, %ecx
	sarl	%ecx
	cmpl	%eax, %ecx
	jge	LBB0_3
## %bb.4:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movslq	%ecx, %rbx
	movslq	%eax, %r13
	movq	_eeprom_data@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_eeprom_read
	movq	(%r12), %rsi
	movq	%rax, (%rsi,%rbx,8)
	incq	%rbx
	cmpq	%rbx, %r13
	jne	LBB0_5
## %bb.6:
	movq	_EEPROM_SIZE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %r13d
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_7
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_13
LBB0_3:
	movq	_eeprom_data@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_EEPROM_SIZE@GOTPCREL(%rip), %rbx
LBB0_7:
	addl	%r13d, %r13d
	movq	%r14, %rdi
	movl	%r13d, %edx
	callq	_memcpy
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movslq	8(%rcx), %rax
	leaq	(%r14,%rax,8), %rdi
	movl	12(%rcx), %edx
	movq	%r12, %rsi
	callq	_memcpy
	movl	(%rbx), %eax
	testl	%eax, %eax
	jle	LBB0_12
## %bb.8:
	movq	%rbx, %r13
	xorl	%ebx, %ebx
	movq	_eeprom_data@GOTPCREL(%rip), %r12
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	incq	%rbx
	movslq	%eax, %rcx
	cmpq	%rcx, %rbx
	jge	LBB0_12
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14,%rbx,8), %rdx
	movq	(%r12), %rcx
	cmpq	(%rcx,%rbx,8), %rdx
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%rdx, (%rcx,%rbx,8)
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_eeprom_write
	movl	(%r13), %eax
	jmp	LBB0_11
LBB0_12:
	xorl	%eax, %eax
LBB0_13:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_15
## %bb.14:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EEPROM_SIZE,4,2                ## @EEPROM_SIZE
	.comm	_EEPROM_MAGIC,8,3               ## @EEPROM_MAGIC
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_eeprom_data,8,3                ## @eeprom_data
	.no_dead_strip	_netdev_set_eeprom
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function netdev_set_eeprom
_netdev_set_eeprom:                     ; @netdev_set_eeprom
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	sub	sp, sp, #16
	mov	x21, x2
	mov	x22, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	bl	_netdev_priv
	ldr	x19, [x0]
Lloh3:
	adrp	x24, _EEPROM_SIZE@GOTPAGE
Lloh4:
	ldr	x24, [x24, _EEPROM_SIZE@GOTPAGEOFF]
	ldr	w12, [x24]
	lsl	x8, x12, #3
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0xffffffff0
	sub	x20, x9, x8
	mov	sp, x20
	ldr	x8, [x22]
Lloh7:
	adrp	x9, _EEPROM_MAGIC@GOTPAGE
Lloh8:
	ldr	x9, [x9, _EEPROM_MAGIC@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.1:
	ldp	w9, w8, [x22, #8]
	add	w10, w9, #1
	add	w8, w10, w8
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
	cmp	w9, #0
	cinc	w9, w9, lt
	asr	w9, w9, #1
Lloh10:
	adrp	x25, _eeprom_data@GOTPAGE
Lloh11:
	ldr	x25, [x25, _eeprom_data@GOTPAGEOFF]
	cmp	w9, w8
	b.ge	LBB0_6
; %bb.2:
	sxtw	x23, w9
	sxtw	x26, w8
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x23
	bl	_eeprom_read
	ldr	x1, [x25]
	str	x0, [x1, x23, lsl #3]
	add	x23, x23, #1
	cmp	x26, x23
	b.ne	LBB0_3
; %bb.4:
	ldr	w12, [x24]
	b	LBB0_7
LBB0_5:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_13
LBB0_6:
	ldr	x1, [x25]
LBB0_7:
	lsl	w2, w12, #1
	mov	x0, x20
	bl	_memcpy
	ldp	w8, w2, [x22, #8]
                                        ; kill: def $w8 killed $w8 def $x8
	sxtw	x8, w8
	add	x0, x20, x8, lsl #3
	mov	x1, x21
	bl	_memcpy
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.8:
	mov	x21, #0
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x21, x21, #1
	cmp	x21, w8, sxtw
	b.ge	LBB0_12
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	lsl	x10, x21, #3
	ldr	x2, [x20, x10]
	ldr	x9, [x25]
	ldr	x10, [x9, x10]
	cmp	x2, x10
	b.eq	LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	str	x2, [x9, x21, lsl #3]
	mov	x0, x19
	mov	x1, x21
	bl	_eeprom_write
	ldr	w8, [x24]
	b	LBB0_9
LBB0_12:
	mov	w0, #0
LBB0_13:
	ldur	x8, [x29, #-72]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.14:
	sub	sp, x29, #64
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_EEPROM_SIZE,4,2                ; @EEPROM_SIZE
	.comm	_EEPROM_MAGIC,8,3               ; @EEPROM_MAGIC
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_eeprom_data,8,3                ; @eeprom_data
	.no_dead_strip	_netdev_set_eeprom
.subsections_via_symbols
