	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function et131x_init_eeprom
_et131x_init_eeprom:                    ## @et131x_init_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	16(%rdi), %r15
	movq	_ET1310_PCI_EEPROM_STATUS@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	-36(%rbp), %r12
	movq	%r15, %rdi
	movq	%r12, %rdx
	callq	_pci_read_config_byte
	movl	(%rbx), %esi
	movq	%r15, %rdi
	movq	%r12, %rdx
	callq	_pci_read_config_byte
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	addq	$4, %r15
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_2
LBB0_3:
	testb	$76, -36(%rbp)
	je	LBB0_10
## %bb.4:
	cmpl	$1, (%r15)
	jne	LBB0_9
## %bb.5:
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$254, %edx
	callq	_eeprom_write
	movq	%rax, %r12
	movq	%r14, %rdi
	movl	$1, %esi
	movl	$19, %edx
	callq	_eeprom_write
	movq	%rax, %rbx
	movq	%r14, %rdi
	movl	$2, %esi
	movl	$16, %edx
	callq	_eeprom_write
	cmpl	$1, (%r15)
	jne	LBB0_9
## %bb.6:
	testq	%rax, %rax
	js	LBB0_9
## %bb.7:
	testq	%rbx, %rbx
	js	LBB0_9
## %bb.8:
	testq	%r12, %r12
	js	LBB0_9
LBB0_10:
	movl	$1, (%r14)
	movq	8(%r14), %rdx
	movq	%r14, %rdi
	movl	$112, %esi
	callq	_eeprom_read
	movq	8(%r14), %rdx
	addq	$4, %rdx
	movq	%r14, %rdi
	movl	$113, %esi
	callq	_eeprom_read
	movq	8(%r14), %rax
	xorl	%ebx, %ebx
	cmpl	$205, (%rax)
	je	LBB0_12
## %bb.11:
	movl	$0, 4(%rax)
	jmp	LBB0_12
LBB0_9:
	addq	$4, %r15
	movl	-36(%rbp), %edx
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movl	$0, (%r14)
LBB0_2:
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ET1310_PCI_EEPROM_STATUS,4,2   ## @ET1310_PCI_EEPROM_STATUS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not read PCI config space for EEPROM Status\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.1:                               ## @.str.1
	.asciz	"Fatal EEPROM Status Error - 0x%04x\n"

	.no_dead_strip	_et131x_init_eeprom
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function et131x_init_eeprom
_et131x_init_eeprom:                    ; @et131x_init_eeprom
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	x20, [x0, #16]
Lloh0:
	adrp	x21, _ET1310_PCI_EEPROM_STATUS@GOTPAGE
Lloh1:
	ldr	x21, [x21, _ET1310_PCI_EEPROM_STATUS@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x20
	bl	_pci_read_config_byte
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x20
	bl	_pci_read_config_byte
	cbz	x0, LBB0_2
; %bb.1:
	add	x0, x20, #4
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_11
LBB0_2:
	ldrb	w8, [sp, #12]
	mov	w9, #76
	tst	w8, w9
	b.eq	LBB0_8
; %bb.3:
	ldr	w8, [x20]
	cmp	w8, #1
	b.ne	LBB0_10
; %bb.4:
	mov	x0, x19
	mov	w1, #0
	mov	w2, #254
	bl	_eeprom_write
	mov	x21, x0
	mov	x0, x19
	mov	w1, #1
	mov	w2, #19
	bl	_eeprom_write
	mov	x22, x0
	mov	x0, x19
	mov	w1, #2
	mov	w2, #16
	bl	_eeprom_write
	ldr	w8, [x20]
	cmp	w8, #1
	b.ne	LBB0_10
; %bb.5:
	tbnz	x0, #63, LBB0_10
; %bb.6:
	tbnz	x22, #63, LBB0_10
; %bb.7:
	tbnz	x21, #63, LBB0_10
LBB0_8:
	mov	w8, #1
	str	w8, [x19]
	ldr	x2, [x19, #8]
	mov	x0, x19
	mov	w1, #112
	bl	_eeprom_read
	ldr	x8, [x19, #8]
	add	x2, x8, #4
	mov	x0, x19
	mov	w1, #113
	bl	_eeprom_read
	ldr	x8, [x19, #8]
	ldr	w9, [x8]
	cmp	w9, #205
	b.ne	LBB0_13
; %bb.9:
	mov	w0, #0
	b	LBB0_12
LBB0_10:
	add	x0, x20, #4
	ldr	w8, [sp, #12]
	str	x8, [sp]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	str	wzr, [x19]
LBB0_11:
Lloh6:
	adrp	x8, _EIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_13:
	mov	w0, #0
	str	wzr, [x8, #4]
	b	LBB0_12
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_ET1310_PCI_EEPROM_STATUS,4,2   ; @ET1310_PCI_EEPROM_STATUS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not read PCI config space for EEPROM Status\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.1:                               ; @.str.1
	.asciz	"Fatal EEPROM Status Error - 0x%04x\n"

	.no_dead_strip	_et131x_init_eeprom
.subsections_via_symbols
