	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alx_init_sw
_alx_init_sw:                           ## @alx_init_sw
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	80(%rdi), %rbx
	callq	_alx_identify_hw
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	addq	$32, %rbx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dev_err
	jmp	LBB0_7
LBB0_2:
	movq	(%rbx), %rcx
	movq	_ALX_DEV_ID_AR8161@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	cmpq	(%rdx), %rcx
	jne	LBB0_6
## %bb.3:
	movq	8(%rbx), %rcx
	movq	_PCI_VENDOR_ID_ATTANSIC@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_6
## %bb.4:
	cmpl	$145, 16(%rbx)
	jne	LBB0_6
## %bb.5:
	xorl	%eax, %eax
	cmpq	$0, 24(%rbx)
	sete	%al
LBB0_6:
	movl	%eax, 32(%r15)
	movl	$400, 36(%r15)                  ## imm = 0x190
	movq	16(%r15), %rax
	movl	16(%rax), %edi
	movl	%edi, 76(%r15)
	callq	_ALX_MAX_FRAME_LEN
	movq	%rax, 24(%r15)
	movq	16(%r15), %rax
	movl	$34, (%rax)
	movq	_ALX_MAX_FRAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ALX_MAX_FRAME_LEN
	movq	16(%r15), %rcx
	movq	%rax, 8(%rcx)
	movabsq	$2199023255808, %rax            ## imm = 0x20000000100
	movq	%rax, (%r15)
	movl	$200, 40(%r15)
	movq	_ALX_ISR_MISC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15)
	movl	68(%r15), %eax
	movl	%eax, 72(%r15)
	movl	$85, 44(%r15)
	movq	_SPEED_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 64(%r15)
	movq	_DUPLEX_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 60(%r15)
	movq	_ADVERTISED_Autoneg@GOTPCREL(%rip), %rax
	movq	_ADVERTISED_10baseT_Half@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_ADVERTISED_10baseT_Full@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_ADVERTISED_100baseT_Full@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_ADVERTISED_100baseT_Half@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_ADVERTISED_1000baseT_Full@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, 48(%r15)
	movq	_ALX_FC_ANEG@GOTPCREL(%rip), %rax
	movq	_ALX_FC_RX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_ALX_FC_TX@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, 52(%r15)
	movq	_ALX_MAC_CTRL_WOLSPED_SWEN@GOTPCREL(%rip), %rax
	movq	_ALX_MAC_CTRL_MHASH_ALG_HI5B@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_ALX_MAC_CTRL_BRD_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_ALX_MAC_CTRL_PCRCE@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_ALX_MAC_CTRL_CRCE@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_ALX_MAC_CTRL_RXFC_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_ALX_MAC_CTRL_TXFC_EN@GOTPCREL(%rip), %rax
	movq	_ALX_MAC_CTRL_PRMBLEN_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$7, %esi
	shll	%cl, %esi
	orl	(%rax), %edx
	orl	%edx, %esi
	movl	%esi, 56(%r15)
LBB0_7:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unrecognized chip, aborting\n"

	.comm	_ALX_DEV_ID_AR8161,8,3          ## @ALX_DEV_ID_AR8161
	.comm	_PCI_VENDOR_ID_ATTANSIC,8,3     ## @PCI_VENDOR_ID_ATTANSIC
	.comm	_ALX_MAX_FRAME_SIZE,4,2         ## @ALX_MAX_FRAME_SIZE
	.comm	_ALX_ISR_MISC,4,2               ## @ALX_ISR_MISC
	.comm	_SPEED_UNKNOWN,4,2              ## @SPEED_UNKNOWN
	.comm	_DUPLEX_UNKNOWN,4,2             ## @DUPLEX_UNKNOWN
	.comm	_ADVERTISED_Autoneg,4,2         ## @ADVERTISED_Autoneg
	.comm	_ADVERTISED_10baseT_Half,4,2    ## @ADVERTISED_10baseT_Half
	.comm	_ADVERTISED_10baseT_Full,4,2    ## @ADVERTISED_10baseT_Full
	.comm	_ADVERTISED_100baseT_Full,4,2   ## @ADVERTISED_100baseT_Full
	.comm	_ADVERTISED_100baseT_Half,4,2   ## @ADVERTISED_100baseT_Half
	.comm	_ADVERTISED_1000baseT_Full,4,2  ## @ADVERTISED_1000baseT_Full
	.comm	_ALX_FC_ANEG,4,2                ## @ALX_FC_ANEG
	.comm	_ALX_FC_RX,4,2                  ## @ALX_FC_RX
	.comm	_ALX_FC_TX,4,2                  ## @ALX_FC_TX
	.comm	_ALX_MAC_CTRL_WOLSPED_SWEN,4,2  ## @ALX_MAC_CTRL_WOLSPED_SWEN
	.comm	_ALX_MAC_CTRL_MHASH_ALG_HI5B,4,2 ## @ALX_MAC_CTRL_MHASH_ALG_HI5B
	.comm	_ALX_MAC_CTRL_BRD_EN,4,2        ## @ALX_MAC_CTRL_BRD_EN
	.comm	_ALX_MAC_CTRL_PCRCE,4,2         ## @ALX_MAC_CTRL_PCRCE
	.comm	_ALX_MAC_CTRL_CRCE,4,2          ## @ALX_MAC_CTRL_CRCE
	.comm	_ALX_MAC_CTRL_RXFC_EN,4,2       ## @ALX_MAC_CTRL_RXFC_EN
	.comm	_ALX_MAC_CTRL_TXFC_EN,4,2       ## @ALX_MAC_CTRL_TXFC_EN
	.comm	_ALX_MAC_CTRL_PRMBLEN_SHIFT,4,2 ## @ALX_MAC_CTRL_PRMBLEN_SHIFT
	.no_dead_strip	_alx_init_sw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function alx_init_sw
lCPI0_0:
	.long	256                             ; 0x100
	.long	512                             ; 0x200
lCPI0_1:
	.long	200                             ; 0xc8
	.long	85                              ; 0x55
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_alx_init_sw:                           ; @alx_init_sw
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x20, x0
	ldr	x21, [x0, #80]
	bl	_alx_identify_hw
	mov	x19, x0
	cbz	w0, LBB0_2
; %bb.1:
	add	x0, x21, #32
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_8
LBB0_2:
	ldr	x8, [x21]
Lloh2:
	adrp	x9, _ALX_DEV_ID_AR8161@GOTPAGE
Lloh3:
	ldr	x9, [x9, _ALX_DEV_ID_AR8161@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.3:
	ldr	x8, [x21, #8]
Lloh5:
	adrp	x9, _PCI_VENDOR_ID_ATTANSIC@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PCI_VENDOR_ID_ATTANSIC@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.4:
	ldr	w8, [x21, #16]
	cmp	w8, #145
	b.ne	LBB0_6
; %bb.5:
	ldr	x8, [x21, #24]
	cmp	x8, #0
	cset	w8, eq
	b	LBB0_7
LBB0_6:
	mov	w8, #0
LBB0_7:
	mov	w9, #400
	stp	w8, w9, [x20, #32]
	ldr	x8, [x20, #16]
	ldr	w0, [x8, #16]
	str	w0, [x20, #76]
	bl	_ALX_MAX_FRAME_LEN
	str	x0, [x20, #24]
	ldr	x8, [x20, #16]
	mov	w9, #34
	str	w9, [x8]
Lloh8:
	adrp	x8, _ALX_MAX_FRAME_SIZE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ALX_MAX_FRAME_SIZE@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_ALX_MAX_FRAME_LEN
	ldr	x8, [x20, #16]
	str	x0, [x8, #8]
Lloh11:
	adrp	x8, lCPI0_0@PAGE
Lloh12:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x20]
Lloh13:
	adrp	x8, _ALX_ISR_MISC@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ALX_ISR_MISC@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	str	w8, [x20, #8]
	ldr	w8, [x20, #68]
	str	w8, [x20, #72]
Lloh16:
	adrp	x8, lCPI0_1@PAGE
Lloh17:
	ldr	d0, [x8, lCPI0_1@PAGEOFF]
	str	d0, [x20, #40]
Lloh18:
	adrp	x8, _SPEED_UNKNOWN@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SPEED_UNKNOWN@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	w8, [x20, #64]
Lloh21:
	adrp	x8, _ADVERTISED_Autoneg@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ADVERTISED_Autoneg@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, _ADVERTISED_10baseT_Half@GOTPAGE
Lloh25:
	ldr	x9, [x9, _ADVERTISED_10baseT_Half@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
Lloh27:
	adrp	x10, _ADVERTISED_10baseT_Full@GOTPAGE
Lloh28:
	ldr	x10, [x10, _ADVERTISED_10baseT_Full@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh29:
	ldr	w9, [x10]
	orr	w8, w8, w9
Lloh30:
	adrp	x9, _ADVERTISED_100baseT_Full@GOTPAGE
Lloh31:
	ldr	x9, [x9, _ADVERTISED_100baseT_Full@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh33:
	adrp	x9, _ADVERTISED_100baseT_Half@GOTPAGE
Lloh34:
	ldr	x9, [x9, _ADVERTISED_100baseT_Half@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
Lloh36:
	adrp	x10, _ADVERTISED_1000baseT_Full@GOTPAGE
Lloh37:
	ldr	x10, [x10, _ADVERTISED_1000baseT_Full@GOTPAGEOFF]
	orr	w8, w8, w9
Lloh38:
	ldr	w9, [x10]
	orr	w8, w8, w9
Lloh39:
	adrp	x9, _ALX_FC_ANEG@GOTPAGE
Lloh40:
	ldr	x9, [x9, _ALX_FC_ANEG@GOTPAGEOFF]
Lloh41:
	ldr	w9, [x9]
Lloh42:
	adrp	x10, _ALX_FC_RX@GOTPAGE
Lloh43:
	ldr	x10, [x10, _ALX_FC_RX@GOTPAGEOFF]
Lloh44:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh45:
	adrp	x10, _ALX_FC_TX@GOTPAGE
Lloh46:
	ldr	x10, [x10, _ALX_FC_TX@GOTPAGEOFF]
Lloh47:
	ldr	w10, [x10]
	orr	w9, w9, w10
	stp	w8, w9, [x20, #48]
Lloh48:
	adrp	x8, _ALX_MAC_CTRL_WOLSPED_SWEN@GOTPAGE
Lloh49:
	ldr	x8, [x8, _ALX_MAC_CTRL_WOLSPED_SWEN@GOTPAGEOFF]
Lloh50:
	ldr	w8, [x8]
Lloh51:
	adrp	x9, _ALX_MAC_CTRL_MHASH_ALG_HI5B@GOTPAGE
Lloh52:
	ldr	x9, [x9, _ALX_MAC_CTRL_MHASH_ALG_HI5B@GOTPAGEOFF]
Lloh53:
	ldr	w9, [x9]
Lloh54:
	adrp	x10, _ALX_MAC_CTRL_BRD_EN@GOTPAGE
Lloh55:
	ldr	x10, [x10, _ALX_MAC_CTRL_BRD_EN@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh56:
	ldr	w9, [x10]
	orr	w8, w8, w9
Lloh57:
	adrp	x9, _ALX_MAC_CTRL_PCRCE@GOTPAGE
Lloh58:
	ldr	x9, [x9, _ALX_MAC_CTRL_PCRCE@GOTPAGEOFF]
Lloh59:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh60:
	adrp	x9, _ALX_MAC_CTRL_CRCE@GOTPAGE
Lloh61:
	ldr	x9, [x9, _ALX_MAC_CTRL_CRCE@GOTPAGEOFF]
Lloh62:
	ldr	w9, [x9]
Lloh63:
	adrp	x10, _ALX_MAC_CTRL_RXFC_EN@GOTPAGE
Lloh64:
	ldr	x10, [x10, _ALX_MAC_CTRL_RXFC_EN@GOTPAGEOFF]
	orr	w8, w8, w9
Lloh65:
	ldr	w9, [x10]
	orr	w8, w8, w9
Lloh66:
	adrp	x9, _ALX_MAC_CTRL_TXFC_EN@GOTPAGE
Lloh67:
	ldr	x9, [x9, _ALX_MAC_CTRL_TXFC_EN@GOTPAGEOFF]
Lloh68:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh69:
	adrp	x9, _ALX_MAC_CTRL_PRMBLEN_SHIFT@GOTPAGE
Lloh70:
	ldr	x9, [x9, _ALX_MAC_CTRL_PRMBLEN_SHIFT@GOTPAGEOFF]
Lloh71:
	ldr	w9, [x9]
	mov	w10, #7
	lsl	w9, w10, w9
Lloh72:
	adrp	x10, _DUPLEX_UNKNOWN@GOTPAGE
Lloh73:
	ldr	x10, [x10, _DUPLEX_UNKNOWN@GOTPAGEOFF]
Lloh74:
	ldr	w10, [x10]
	orr	w8, w8, w9
	stp	w8, w10, [x20, #56]
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh72, Lloh73, Lloh74
	.loh AdrpLdrGotLdr	Lloh69, Lloh70, Lloh71
	.loh AdrpLdrGotLdr	Lloh66, Lloh67, Lloh68
	.loh AdrpLdrGotLdr	Lloh63, Lloh64, Lloh65
	.loh AdrpLdrGotLdr	Lloh60, Lloh61, Lloh62
	.loh AdrpLdrGotLdr	Lloh57, Lloh58, Lloh59
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdrp	Lloh16, Lloh18
	.loh AdrpLdr	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdrp	Lloh11, Lloh13
	.loh AdrpLdr	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unrecognized chip, aborting\n"

	.comm	_ALX_DEV_ID_AR8161,8,3          ; @ALX_DEV_ID_AR8161
	.comm	_PCI_VENDOR_ID_ATTANSIC,8,3     ; @PCI_VENDOR_ID_ATTANSIC
	.comm	_ALX_MAX_FRAME_SIZE,4,2         ; @ALX_MAX_FRAME_SIZE
	.comm	_ALX_ISR_MISC,4,2               ; @ALX_ISR_MISC
	.comm	_SPEED_UNKNOWN,4,2              ; @SPEED_UNKNOWN
	.comm	_DUPLEX_UNKNOWN,4,2             ; @DUPLEX_UNKNOWN
	.comm	_ADVERTISED_Autoneg,4,2         ; @ADVERTISED_Autoneg
	.comm	_ADVERTISED_10baseT_Half,4,2    ; @ADVERTISED_10baseT_Half
	.comm	_ADVERTISED_10baseT_Full,4,2    ; @ADVERTISED_10baseT_Full
	.comm	_ADVERTISED_100baseT_Full,4,2   ; @ADVERTISED_100baseT_Full
	.comm	_ADVERTISED_100baseT_Half,4,2   ; @ADVERTISED_100baseT_Half
	.comm	_ADVERTISED_1000baseT_Full,4,2  ; @ADVERTISED_1000baseT_Full
	.comm	_ALX_FC_ANEG,4,2                ; @ALX_FC_ANEG
	.comm	_ALX_FC_RX,4,2                  ; @ALX_FC_RX
	.comm	_ALX_FC_TX,4,2                  ; @ALX_FC_TX
	.comm	_ALX_MAC_CTRL_WOLSPED_SWEN,4,2  ; @ALX_MAC_CTRL_WOLSPED_SWEN
	.comm	_ALX_MAC_CTRL_MHASH_ALG_HI5B,4,2 ; @ALX_MAC_CTRL_MHASH_ALG_HI5B
	.comm	_ALX_MAC_CTRL_BRD_EN,4,2        ; @ALX_MAC_CTRL_BRD_EN
	.comm	_ALX_MAC_CTRL_PCRCE,4,2         ; @ALX_MAC_CTRL_PCRCE
	.comm	_ALX_MAC_CTRL_CRCE,4,2          ; @ALX_MAC_CTRL_CRCE
	.comm	_ALX_MAC_CTRL_RXFC_EN,4,2       ; @ALX_MAC_CTRL_RXFC_EN
	.comm	_ALX_MAC_CTRL_TXFC_EN,4,2       ; @ALX_MAC_CTRL_TXFC_EN
	.comm	_ALX_MAC_CTRL_PRMBLEN_SHIFT,4,2 ; @ALX_MAC_CTRL_PRMBLEN_SHIFT
	.no_dead_strip	_alx_init_sw
.subsections_via_symbols
