	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function et131x_pci_init
_et131x_pci_init:                       ## @et131x_pci_init
	.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	%rsi, %r14
	movq	%rdi, %r15
	callq	_et131x_init_eeprom
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_19
## %bb.1:
	movq	%r14, %rdi
	callq	_pci_is_pcie
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	movslq	(%r14), %r12
	cmpq	$1, %r12
	jg	LBB0_8
## %bb.4:
	movq	_ET1310_PCI_ACK_NACK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	_et131x_pci_init.acknak(%rip), %rax
	movl	(%rax,%r12,4), %edx
	movq	%r14, %rdi
	callq	_pci_write_config_word
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %r12
	jmp	LBB0_18
LBB0_2:
	leaq	L_.str(%rip), %r12
	jmp	LBB0_18
LBB0_6:
	movq	_ET1310_PCI_REPLAY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	_et131x_pci_init.replay(%rip), %rax
	movl	(%rax,%r12,4), %edx
	movq	%r14, %rdi
	callq	_pci_write_config_word
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	leaq	L_.str.2(%rip), %r12
	jmp	LBB0_18
LBB0_8:
	movq	_ET1310_PCI_L0L1LATENCY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$17, %edx
	callq	_pci_write_config_byte
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	leaq	L_.str.3(%rip), %r12
	jmp	LBB0_18
LBB0_10:
	movq	%r14, %rdi
	movl	$2048, %esi                     ## imm = 0x800
	callq	_pcie_set_readrq
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	leaq	L_.str.4(%rip), %r12
LBB0_18:
	addq	$4, %r14
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_19:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	cmpl	$0, 12(%r15)
	je	LBB0_15
## %bb.13:
	movq	_ETH_ALEN@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_20
## %bb.14:
	xorl	%r13d, %r13d
	leaq	L_.str.5(%rip), %r12
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	_ET1310_PCI_MAC_ADDRESS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r13, %rsi
	movq	(%r15), %rdx
	addq	%r13, %rdx
	movq	%r14, %rdi
	callq	_pci_read_config_byte
	testq	%rax, %rax
	jne	LBB0_18
## %bb.16:                              ##   in Loop: Header=BB0_17 Depth=1
	incq	%r13
	movq	_ETH_ALEN@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %r13
	jl	LBB0_17
LBB0_20:
	movl	8(%r15), %edi
	movq	(%r15), %rsi
	callq	_ether_addr_copy
	jmp	LBB0_19
LBB0_15:
	movq	%r15, %rdi
	callq	_et131x_hwaddr_init
	xorl	%ebx, %ebx
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Missing PCIe capabilities\n"

	.section	__TEXT,__const
	.p2align	2                               ## @et131x_pci_init.acknak
_et131x_pci_init.acknak:
	.long	118                             ## 0x76
	.long	208                             ## 0xd0

	.p2align	2                               ## @et131x_pci_init.replay
_et131x_pci_init.replay:
	.long	480                             ## 0x1e0
	.long	749                             ## 0x2ed

	.comm	_ET1310_PCI_ACK_NACK,4,2        ## @ET1310_PCI_ACK_NACK
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"Could not write PCI config space for ACK/NAK\n"

	.comm	_ET1310_PCI_REPLAY,4,2          ## @ET1310_PCI_REPLAY
L_.str.2:                               ## @.str.2
	.asciz	"Could not write PCI config space for Replay Timer\n"

	.comm	_ET1310_PCI_L0L1LATENCY,4,2     ## @ET1310_PCI_L0L1LATENCY
L_.str.3:                               ## @.str.3
	.asciz	"Could not write PCI config space for Latency Timers\n"

L_.str.4:                               ## @.str.4
	.asciz	"Couldn't change PCI config space for Max read size\n"

	.comm	_ETH_ALEN,4,2                   ## @ETH_ALEN
	.comm	_ET1310_PCI_MAC_ADDRESS,8,3     ## @ET1310_PCI_MAC_ADDRESS
L_.str.5:                               ## @.str.5
	.asciz	"Could not read PCI config space for MAC address\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function et131x_pci_init
_et131x_pci_init:                       ; @et131x_pci_init
	.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	x19, x1
	mov	x21, x0
	bl	_et131x_init_eeprom
	mov	x20, x0
	tbnz	w0, #31, LBB0_13
; %bb.1:
	mov	x0, x19
	bl	_pci_is_pcie
	cbz	w0, LBB0_5
; %bb.2:
	ldrsw	x22, [x19]
	cmp	w22, #1
	b.gt	LBB0_8
; %bb.3:
Lloh0:
	adrp	x8, _ET1310_PCI_ACK_NACK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ET1310_PCI_ACK_NACK@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _et131x_pci_init.acknak@PAGE
Lloh4:
	add	x8, x8, _et131x_pci_init.acknak@PAGEOFF
	ldr	w2, [x8, x22, lsl #2]
	mov	x0, x19
	bl	_pci_write_config_word
	cbz	x0, LBB0_6
; %bb.4:
Lloh5:
	adrp	x22, l_.str.1@PAGE
Lloh6:
	add	x22, x22, l_.str.1@PAGEOFF
	b	LBB0_12
LBB0_5:
Lloh7:
	adrp	x22, l_.str@PAGE
Lloh8:
	add	x22, x22, l_.str@PAGEOFF
	b	LBB0_12
LBB0_6:
Lloh9:
	adrp	x8, _ET1310_PCI_REPLAY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ET1310_PCI_REPLAY@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x8, _et131x_pci_init.replay@PAGE
Lloh13:
	add	x8, x8, _et131x_pci_init.replay@PAGEOFF
	ldr	w2, [x8, x22, lsl #2]
	mov	x0, x19
	bl	_pci_write_config_word
	cbz	x0, LBB0_8
; %bb.7:
Lloh14:
	adrp	x22, l_.str.2@PAGE
Lloh15:
	add	x22, x22, l_.str.2@PAGEOFF
	b	LBB0_12
LBB0_8:
Lloh16:
	adrp	x8, _ET1310_PCI_L0L1LATENCY@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ET1310_PCI_L0L1LATENCY@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #17
	bl	_pci_write_config_byte
	cbz	x0, LBB0_10
; %bb.9:
Lloh19:
	adrp	x22, l_.str.3@PAGE
Lloh20:
	add	x22, x22, l_.str.3@PAGEOFF
	b	LBB0_12
LBB0_10:
	mov	x0, x19
	mov	w1, #2048
	bl	_pcie_set_readrq
	cbz	x0, LBB0_14
; %bb.11:
Lloh21:
	adrp	x22, l_.str.4@PAGE
Lloh22:
	add	x22, x22, l_.str.4@PAGEOFF
LBB0_12:
	add	x0, x19, #4
	mov	x1, x22
	bl	_dev_err
Lloh23:
	adrp	x8, _EIO@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_13:
	mov	x0, x20
	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_14:
	ldr	w8, [x21, #12]
	cbz	w8, LBB0_20
; %bb.15:
Lloh26:
	adrp	x23, _ETH_ALEN@GOTPAGE
Lloh27:
	ldr	x23, [x23, _ETH_ALEN@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_19
; %bb.16:
	mov	x24, #0
Lloh28:
	adrp	x25, _ET1310_PCI_MAC_ADDRESS@GOTPAGE
Lloh29:
	ldr	x25, [x25, _ET1310_PCI_MAC_ADDRESS@GOTPAGEOFF]
Lloh30:
	adrp	x22, l_.str.5@PAGE
Lloh31:
	add	x22, x22, l_.str.5@PAGEOFF
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x25]
	add	x1, x24, x8
	ldr	x8, [x21]
	add	x2, x24, x8
	mov	x0, x19
	bl	_pci_read_config_byte
	cbnz	x0, LBB0_12
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	add	x24, x24, #1
	ldrsw	x8, [x23]
	cmp	x24, x8
	b.lt	LBB0_17
LBB0_19:
	ldr	w0, [x21, #8]
	ldr	x1, [x21]
	bl	_ether_addr_copy
	b	LBB0_13
LBB0_20:
	mov	x0, x21
	bl	_et131x_hwaddr_init
	mov	w20, #0
	b	LBB0_13
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Missing PCIe capabilities\n"

	.section	__TEXT,__const
	.p2align	2                               ; @et131x_pci_init.acknak
_et131x_pci_init.acknak:
	.long	118                             ; 0x76
	.long	208                             ; 0xd0

	.p2align	2                               ; @et131x_pci_init.replay
_et131x_pci_init.replay:
	.long	480                             ; 0x1e0
	.long	749                             ; 0x2ed

	.comm	_ET1310_PCI_ACK_NACK,4,2        ; @ET1310_PCI_ACK_NACK
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"Could not write PCI config space for ACK/NAK\n"

	.comm	_ET1310_PCI_REPLAY,4,2          ; @ET1310_PCI_REPLAY
l_.str.2:                               ; @.str.2
	.asciz	"Could not write PCI config space for Replay Timer\n"

	.comm	_ET1310_PCI_L0L1LATENCY,4,2     ; @ET1310_PCI_L0L1LATENCY
l_.str.3:                               ; @.str.3
	.asciz	"Could not write PCI config space for Latency Timers\n"

l_.str.4:                               ; @.str.4
	.asciz	"Couldn't change PCI config space for Max read size\n"

	.comm	_ETH_ALEN,4,2                   ; @ETH_ALEN
	.comm	_ET1310_PCI_MAC_ADDRESS,8,3     ; @ET1310_PCI_MAC_ADDRESS
l_.str.5:                               ; @.str.5
	.asciz	"Could not read PCI config space for MAC address\n"

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