	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cp_set_eeprom
_cp_set_eeprom:                         ## @cp_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %rbx
	callq	_netdev_priv
	movq	%rax, %r14
	movq	8(%rbx), %rax
	movq	_CP_EEPROM_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.2:
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %r15
	movl	(%rbx), %ebx
	movl	4(%r15), %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	sarl	%ebx
	movq	%r14, %rdi
	callq	_spin_lock_irq
	movl	4(%r14), %edi
	xorl	%r13d, %r13d
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_read_eeprom
	xorl	%ecx, %ecx
	cmpl	$33065, %eax                    ## imm = 0x8129
	sete	%cl
	leal	(%rcx,%rcx), %r12d
	addl	$6, %r12d
	testb	$1, (%r15)
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_4
## %bb.3:
	movl	4(%r14), %edi
	movl	%ebx, %esi
	movl	%r12d, %edx
	callq	_read_eeprom
	movzbl	%al, %eax
	movl	(%r15), %edx
	shll	$8, %edx
	orl	%eax, %edx
	movl	4(%r14), %edi
	movl	%ebx, %esi
	movl	%r12d, %ecx
	callq	_write_eeprom
	incl	%ebx
	movl	$1, %r13d
LBB0_4:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	leal	-1(%rax), %r14d
	cmpl	%r14d, %r13d
	jge	LBB0_8
## %bb.5:
	movl	%r13d, %r13d
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	8(%r15,%r13,8), %edx
	shll	$8, %edx
	orl	(%r15,%r13,8), %edx
	addq	$2, %r13
	movl	4(%r12), %edi
	movl	%ebx, %esi
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	_write_eeprom
	incl	%ebx
	cmpl	%r13d, %r14d
	jg	LBB0_6
## %bb.7:
	movl	-44(%rbp), %r12d                ## 4-byte Reload
LBB0_8:
	cmpl	-64(%rbp), %r13d                ## 4-byte Folded Reload
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	jge	LBB0_10
## %bb.9:
	movl	4(%r14), %edi
	movl	%ebx, %esi
	movl	%r12d, %edx
	callq	_read_eeprom
	andl	$65280, %eax                    ## imm = 0xFF00
	movl	%r13d, %ecx
	orl	(%r15,%rcx,8), %eax
	movl	4(%r14), %edi
	movl	%ebx, %esi
	movl	%eax, %edx
	movl	%r12d, %ecx
	callq	_write_eeprom
LBB0_10:
	movq	%r14, %rdi
	callq	_spin_unlock_irq
	xorl	%eax, %eax
	jmp	LBB0_11
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_11:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CP_EEPROM_MAGIC,8,3            ## @CP_EEPROM_MAGIC
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_cp_set_eeprom
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cp_set_eeprom
_cp_set_eeprom:                         ; @cp_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
	mov	x20, x2
	mov	x23, x1
	bl	_netdev_priv
	ldr	x8, [x23, #8]
Lloh0:
	adrp	x9, _CP_EEPROM_MAGIC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CP_EEPROM_MAGIC@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	mov	x19, x0
	ldp	w8, w24, [x23]
	asr	w21, w8, #1
	bl	_spin_lock_irq
	ldr	w0, [x19, #4]
	mov	w22, #8
	mov	w1, #0
	mov	w2, #8
	bl	_read_eeprom
	mov	w8, #33065
	mov	w9, #6
	cmp	w0, w8
	csel	w22, w22, w9, eq
	ldrb	w8, [x23]
	tbnz	w8, #0, LBB0_4
; %bb.2:
	mov	w25, #0
	b	LBB0_5
LBB0_3:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
LBB0_4:
	ldr	w0, [x19, #4]
	mov	x1, x21
	mov	x2, x22
	bl	_read_eeprom
	mov	x2, x0
	ldr	w8, [x20]
	bfi	w2, w8, #8, #24
	ldr	w0, [x19, #4]
	mov	x1, x21
	mov	x3, x22
	bl	_write_eeprom
	add	w21, w21, #1
	mov	w25, #1
LBB0_5:
	sub	w23, w24, #1
	cmp	w25, w23
	b.ge	LBB0_8
; %bb.6:
	mov	w25, w25
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	add	x8, x20, x25, lsl #3
	ldr	x9, [x8]
	add	x25, x25, #2
	ldr	w8, [x8, #8]
	orr	w2, w9, w8, lsl #8
	ldr	w0, [x19, #4]
	mov	x1, x21
	mov	x3, x22
	bl	_write_eeprom
	add	w21, w21, #1
	cmp	w23, w25
	b.gt	LBB0_7
LBB0_8:
	cmp	w25, w24
	b.ge	LBB0_10
; %bb.9:
	ldr	w0, [x19, #4]
	mov	x1, x21
	mov	x2, x22
	bl	_read_eeprom
	and	w8, w0, #0xff00
	ldr	x9, [x20, w25, uxtw #3]
	orr	w2, w8, w9
	ldr	w0, [x19, #4]
	mov	x1, x21
	mov	x3, x22
	bl	_write_eeprom
LBB0_10:
	mov	x0, x19
	bl	_spin_unlock_irq
	mov	w0, #0
LBB0_11:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_CP_EEPROM_MAGIC,8,3            ; @CP_EEPROM_MAGIC
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_cp_set_eeprom
.subsections_via_symbols
