	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_t3_seeprom_write               ## -- Begin function t3_seeprom_write
	.p2align	4, 0x90
_t3_seeprom_write:                      ## @t3_seeprom_write
	.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	_EEPROMSIZE@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	setg	%al
	movq	_EEPROM_STAT_ADDR@GOTPCREL(%rip), %rcx
	cmpl	%esi, (%rcx)
	sete	%cl
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	testb	$3, %sil
	jne	LBB0_2
## %bb.1:
	orb	%cl, %al
	je	LBB0_2
## %bb.3:
	movq	%rdi, %r13
	movl	(%rdi), %r15d
	movl	4(%rdi), %ebx
	movq	_EEPROM_MAX_POLL@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_PCI_VPD_DATA@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	addq	%rbx, %r12
	movl	%edx, %edi
	callq	_le32_to_cpu
	movl	%r15d, %edi
	movq	%r12, %rsi
	movl	%eax, %edx
	callq	_pci_write_config_dword
	movl	(%r13), %edi
	movq	_PCI_VPD_ADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%rbx, %rsi
	movq	_PCI_VPD_ADDR_F@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	orl	-44(%rbp), %edx                 ## 4-byte Folded Reload
	callq	_pci_write_config_word
	decl	%r14d
	leaq	-48(%rbp), %r15
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1, %edi
	callq	_msleep
	movl	(%r13), %edi
	movq	_PCI_VPD_ADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%rbx, %rsi
	movq	%r15, %rdx
	callq	_pci_read_config_word
	movl	(%r12), %eax
	subl	$1, %r14d
	setb	%cl
	andl	-48(%rbp), %eax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	testb	%cl, %cl
	je	LBB0_4
LBB0_6:
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_CH_ERR
	movq	_EIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_9
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_9:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	xorl	%eax, %eax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_EEPROM_MAX_POLL,4,2            ## @EEPROM_MAX_POLL
	.comm	_EEPROMSIZE,4,2                 ## @EEPROMSIZE
	.comm	_EEPROM_STAT_ADDR,4,2           ## @EEPROM_STAT_ADDR
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PCI_VPD_DATA,8,3               ## @PCI_VPD_DATA
	.comm	_PCI_VPD_ADDR,8,3               ## @PCI_VPD_ADDR
	.comm	_PCI_VPD_ADDR_F,4,2             ## @PCI_VPD_ADDR_F
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"write to EEPROM address 0x%x failed\n"

	.comm	_EIO,4,2                        ## @EIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_t3_seeprom_write               ; -- Begin function t3_seeprom_write
	.p2align	2
_t3_seeprom_write:                      ; @t3_seeprom_write
	.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
Lloh0:
	adrp	x8, _EEPROMSIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EEPROMSIZE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
Lloh3:
	adrp	x8, _EEPROM_STAT_ADDR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EEPROM_STAT_ADDR@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ccmp	w8, w1, #4, le
	cset	w8, eq
	tst	w1, #0x3
	b.ne	LBB0_6
; %bb.1:
	tbz	w8, #0, LBB0_6
; %bb.2:
	mov	x19, x1
	mov	x20, x0
Lloh6:
	adrp	x8, _EEPROM_MAX_POLL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EEPROM_MAX_POLL@GOTPAGEOFF]
Lloh8:
	ldr	w24, [x8]
	ldp	w21, w23, [x0]
Lloh9:
	adrp	x8, _PCI_VPD_DATA@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PCI_VPD_DATA@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	add	x22, x8, x23
	mov	x0, x2
	bl	_le32_to_cpu
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
	bl	_pci_write_config_dword
	ldr	w0, [x20]
Lloh12:
	adrp	x21, _PCI_VPD_ADDR@GOTPAGE
Lloh13:
	ldr	x21, [x21, _PCI_VPD_ADDR@GOTPAGEOFF]
	ldr	x8, [x21]
	add	x1, x8, x23
Lloh14:
	adrp	x22, _PCI_VPD_ADDR_F@GOTPAGE
Lloh15:
	ldr	x22, [x22, _PCI_VPD_ADDR_F@GOTPAGEOFF]
	ldr	w8, [x22]
	orr	w2, w8, w19
	bl	_pci_write_config_word
	sub	w24, w24, #1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #1
	bl	_msleep
	ldr	w0, [x20]
	ldr	x8, [x21]
	add	x1, x8, x23
	add	x2, sp, #12
	bl	_pci_read_config_word
	ldr	w8, [sp, #12]
	ldr	w9, [x22]
	and	w8, w9, w8
	cmp	w8, #0
	ccmp	w24, #0, #4, ne
	sub	w24, w24, #1
	b.ne	LBB0_3
; %bb.4:
	cbz	w8, LBB0_9
; %bb.5:
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	bl	_CH_ERR
Lloh18:
	adrp	x8, _EIO@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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_9:
	mov	w0, #0
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_EEPROM_MAX_POLL,4,2            ; @EEPROM_MAX_POLL
	.comm	_EEPROMSIZE,4,2                 ; @EEPROMSIZE
	.comm	_EEPROM_STAT_ADDR,4,2           ; @EEPROM_STAT_ADDR
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PCI_VPD_DATA,8,3               ; @PCI_VPD_DATA
	.comm	_PCI_VPD_ADDR,8,3               ; @PCI_VPD_ADDR
	.comm	_PCI_VPD_ADDR_F,4,2             ; @PCI_VPD_ADDR_F
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"write to EEPROM address 0x%x failed\n"

	.comm	_EIO,4,2                        ; @EIO
.subsections_via_symbols
