	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mv88e6xxx_g2_set_eeprom16      ## -- Begin function mv88e6xxx_g2_set_eeprom16
	.p2align	4, 0x90
_mv88e6xxx_g2_set_eeprom16:             ## @mv88e6xxx_g2_set_eeprom16
	.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	%rdx, %rbx
	movq	%rsi, %r15
	movq	%rdi, %r14
	movl	(%rsi), %r12d
	movl	4(%rsi), %r13d
	movq	_MV88E6XXX_G2_EEPROM_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	callq	_mv88e6xxx_g2_read
	testl	%eax, %eax
	je	LBB0_1
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_MV88E6XXX_G2_EEPROM_CMD_WRITE_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -44(%rbp)
	je	LBB0_2
## %bb.3:
	movl	$0, 4(%r15)
	testb	$1, %r12b
	jne	LBB0_4
## %bb.7:
	cmpl	$2, %r13d
	jb	LBB0_10
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	4(%rbx), %edx
	shll	$8, %edx
	orl	(%rbx), %edx
	movl	%edx, -44(%rbp)
	movl	%r12d, %esi
	shrl	%esi
	movq	%r14, %rdi
	callq	_mv88e6xxx_g2_eeprom_write16
	testl	%eax, %eax
	jne	LBB0_14
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	addq	$8, %rbx
	addl	$2, %r12d
	addl	$-2, %r13d
	addl	$2, 4(%r15)
	cmpl	$1, %r13d
	ja	LBB0_8
LBB0_10:
	xorl	%eax, %eax
	testl	%r13d, %r13d
	je	LBB0_14
## %bb.11:
	shrl	%r12d
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_mv88e6xxx_g2_eeprom_read16
	testl	%eax, %eax
	jne	LBB0_14
## %bb.12:
	movzbl	-43(%rbp), %edx
	shll	$8, %edx
	orl	(%rbx), %edx
	movl	%edx, -44(%rbp)
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_mv88e6xxx_g2_eeprom_write16
	testl	%eax, %eax
	jne	LBB0_14
## %bb.13:
	incl	4(%r15)
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_2:
	movq	_EROFS@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_14
LBB0_4:
	movl	%r12d, %esi
	shrl	%esi
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	callq	_mv88e6xxx_g2_eeprom_read16
	testl	%eax, %eax
	jne	LBB0_14
## %bb.5:
	movl	(%rbx), %eax
	shll	$8, %eax
	movzbl	-44(%rbp), %edx
	orl	%eax, %edx
	movl	%edx, -44(%rbp)
	movq	%r14, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_mv88e6xxx_g2_eeprom_write16
	testl	%eax, %eax
	jne	LBB0_14
## %bb.6:
	addq	$4, %rbx
	incl	%r12d
	decl	%r13d
	incl	4(%r15)
	cmpl	$2, %r13d
	jae	LBB0_8
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_MV88E6XXX_G2_EEPROM_CMD,4,2    ## @MV88E6XXX_G2_EEPROM_CMD
	.comm	_MV88E6XXX_G2_EEPROM_CMD_WRITE_EN,4,2 ## @MV88E6XXX_G2_EEPROM_CMD_WRITE_EN
	.comm	_EROFS,4,2                      ## @EROFS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mv88e6xxx_g2_set_eeprom16      ; -- Begin function mv88e6xxx_g2_set_eeprom16
	.p2align	2
_mv88e6xxx_g2_set_eeprom16:             ; @mv88e6xxx_g2_set_eeprom16
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	ldp	w23, w24, [x1]
Lloh0:
	adrp	x8, _MV88E6XXX_G2_EEPROM_CMD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MV88E6XXX_G2_EEPROM_CMD@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_mv88e6xxx_g2_read
	cbz	w0, LBB0_2
LBB0_1:
	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
	add	sp, sp, #80
	ret
LBB0_2:
	ldr	w8, [sp, #12]
Lloh3:
	adrp	x9, _MV88E6XXX_G2_EEPROM_CMD_WRITE_EN@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MV88E6XXX_G2_EEPROM_CMD_WRITE_EN@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.3:
	str	wzr, [x19, #4]
	tbnz	w23, #0, LBB0_12
; %bb.4:
	cmp	w24, #2
	b.lo	LBB0_7
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldp	w8, w9, [x21]
	orr	w2, w8, w9, lsl #8
	str	w2, [sp, #12]
	lsr	w1, w23, #1
	mov	x0, x20
	bl	_mv88e6xxx_g2_eeprom_write16
	cbnz	w0, LBB0_1
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x21, x21, #8
	add	w23, w23, #2
	sub	w24, w24, #2
	ldr	w8, [x19, #4]
	add	w8, w8, #2
	str	w8, [x19, #4]
	cmp	w24, #1
	b.hi	LBB0_5
LBB0_7:
	cbz	w24, LBB0_15
; %bb.8:
	lsr	w22, w23, #1
	add	x2, sp, #12
	mov	x0, x20
	mov	x1, x22
	bl	_mv88e6xxx_g2_eeprom_read16
	cbnz	w0, LBB0_1
; %bb.9:
	ldrb	w8, [sp, #13]
	ldr	w9, [x21]
	orr	w2, w9, w8, lsl #8
	str	w2, [sp, #12]
	mov	x0, x20
	mov	x1, x22
	bl	_mv88e6xxx_g2_eeprom_write16
	cbnz	w0, LBB0_1
; %bb.10:
	ldr	w8, [x19, #4]
	add	w8, w8, #1
	str	w8, [x19, #4]
	b	LBB0_1
LBB0_11:
Lloh6:
	adrp	x8, _EROFS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EROFS@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_1
LBB0_12:
	lsr	w22, w23, #1
	add	x2, sp, #12
	mov	x0, x20
	mov	x1, x22
	bl	_mv88e6xxx_g2_eeprom_read16
	cbnz	w0, LBB0_1
; %bb.13:
	ldr	w8, [x21]
	ldrb	w2, [sp, #12]
	bfi	w2, w8, #8, #24
	str	w2, [sp, #12]
	mov	x0, x20
	mov	x1, x22
	bl	_mv88e6xxx_g2_eeprom_write16
	cbnz	w0, LBB0_1
; %bb.14:
	add	x21, x21, #4
	add	w23, w23, #1
	sub	w24, w24, #1
	ldr	w8, [x19, #4]
	add	w8, w8, #1
	str	w8, [x19, #4]
	cmp	w24, #2
	b.hs	LBB0_5
	b	LBB0_7
LBB0_15:
	mov	w0, #0
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_MV88E6XXX_G2_EEPROM_CMD,4,2    ; @MV88E6XXX_G2_EEPROM_CMD
	.comm	_MV88E6XXX_G2_EEPROM_CMD_WRITE_EN,4,2 ; @MV88E6XXX_G2_EEPROM_CMD_WRITE_EN
	.comm	_EROFS,4,2                      ; @EROFS
.subsections_via_symbols
