	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_alx_setup_speed_duplex         ## -- Begin function alx_setup_speed_duplex
	.p2align	4, 0x90
_alx_setup_speed_duplex:                ## @alx_setup_speed_duplex
	.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
	movl	%edx, %r13d
	movl	%esi, %r14d
	movq	%rdi, %r12
	movq	_ALX_MII_DBG_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	xorl	%edx, %edx
	callq	_alx_write_phy_reg
	movq	_ALX_DRV@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_alx_read_mem32
	movl	%eax, %edi
	movq	_ALX_DRV_PHY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	xorl	%edx, %edx
	callq	_ALX_SET_FIELD
	movq	_ADVERTISED_Autoneg@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_13
## %bb.1:
	movq	_ADVERTISE_CSMA@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r14d, %edi
	callq	_ethtool_adv_to_mii_adv_t
	movl	%eax, %r15d
	orl	%ebx, %r15d
	movq	_ALX_FC_ANEG@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	je	LBB0_6
## %bb.2:
	movq	_ALX_FC_RX@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	je	LBB0_4
## %bb.3:
	movq	_ADVERTISED_Pause@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movq	_ALX_FC_TX@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	jne	LBB0_6
	jmp	LBB0_5
LBB0_13:
	movq	_BMCR_RESET@GOTPCREL(%rip), %rax
	movq	_ADVERTISED_100baseT_Full@GOTPCREL(%rip), %rcx
	cmpl	%r14d, (%rcx)
	movq	_BMCR_SPEED100@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	$0, %edx
	cmovel	%ecx, %edx
	movq	_BMCR_FULLDPLX@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	cmovel	%esi, %ebx
	movq	_ADVERTISED_100baseT_Half@GOTPCREL(%rip), %rdi
	cmpl	%r14d, (%rdi)
	movq	_ADVERTISED_10baseT_Full@GOTPCREL(%rip), %rdi
	cmovel	%ecx, %edx
	orl	(%rax), %edx
	cmpl	%r14d, (%rdi)
	cmovel	%esi, %ebx
	orl	%edx, %ebx
	movq	_MII_BMCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_alx_write_phy_reg
	movl	%eax, %ebx
	testl	%ebx, %ebx
	jne	LBB0_16
	jmp	LBB0_15
LBB0_4:
	movq	_ALX_FC_TX@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	je	LBB0_6
LBB0_5:
	movq	_ADVERTISED_Asym_Pause@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
LBB0_6:
	movq	%r12, %rdi
	callq	_alx_hw_giga
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movl	%r14d, %edi
	callq	_ethtool_adv_to_mii_ctrl1000_t
	movl	%eax, %r13d
	jmp	LBB0_9
LBB0_7:
	xorl	%r13d, %r13d
LBB0_9:
	movq	_BMCR_RESET@GOTPCREL(%rip), %rax
	movq	_BMCR_ANENABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	orl	(%rax), %ebx
	movq	_BMCR_ANRESTART@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_MII_ADVERTISE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	%r15d, %edx
	callq	_alx_write_phy_reg
	testl	%eax, %eax
	movq	_ALX_DRV@GOTPCREL(%rip), %r15
	jne	LBB0_12
## %bb.10:
	movq	_MII_CTRL1000@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	%r13d, %edx
	callq	_alx_write_phy_reg
	testl	%eax, %eax
	jne	LBB0_12
## %bb.11:
	movq	_MII_BMCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_alx_write_phy_reg
	testl	%eax, %eax
	je	LBB0_15
LBB0_12:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	testl	%ebx, %ebx
	jne	LBB0_16
LBB0_15:
	movq	_ALX_MII_DBG_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ALX_PHY_INITED@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_alx_write_phy_reg
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_ethadv_to_hw_cfg
	orl	%eax, -44(%rbp)                 ## 4-byte Folded Spill
	xorl	%ebx, %ebx
LBB0_16:
	movl	(%r15), %esi
	movq	%r12, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_alx_write_mem32
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ALX_MII_DBG_ADDR,4,2           ## @ALX_MII_DBG_ADDR
	.comm	_ALX_DRV,4,2                    ## @ALX_DRV
	.comm	_ALX_DRV_PHY,4,2                ## @ALX_DRV_PHY
	.comm	_ADVERTISED_Autoneg,4,2         ## @ADVERTISED_Autoneg
	.comm	_ADVERTISE_CSMA,4,2             ## @ADVERTISE_CSMA
	.comm	_ALX_FC_ANEG,4,2                ## @ALX_FC_ANEG
	.comm	_ALX_FC_RX,4,2                  ## @ALX_FC_RX
	.comm	_ADVERTISED_Pause,4,2           ## @ADVERTISED_Pause
	.comm	_ALX_FC_TX,4,2                  ## @ALX_FC_TX
	.comm	_ADVERTISED_Asym_Pause,4,2      ## @ADVERTISED_Asym_Pause
	.comm	_BMCR_RESET,4,2                 ## @BMCR_RESET
	.comm	_BMCR_ANENABLE,4,2              ## @BMCR_ANENABLE
	.comm	_BMCR_ANRESTART,4,2             ## @BMCR_ANRESTART
	.comm	_MII_ADVERTISE,4,2              ## @MII_ADVERTISE
	.comm	_MII_CTRL1000,4,2               ## @MII_CTRL1000
	.comm	_MII_BMCR,4,2                   ## @MII_BMCR
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_ADVERTISED_100baseT_Half,4,2   ## @ADVERTISED_100baseT_Half
	.comm	_ADVERTISED_100baseT_Full,4,2   ## @ADVERTISED_100baseT_Full
	.comm	_BMCR_SPEED100,4,2              ## @BMCR_SPEED100
	.comm	_ADVERTISED_10baseT_Full,4,2    ## @ADVERTISED_10baseT_Full
	.comm	_BMCR_FULLDPLX,4,2              ## @BMCR_FULLDPLX
	.comm	_ALX_PHY_INITED,4,2             ## @ALX_PHY_INITED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_alx_setup_speed_duplex         ; -- Begin function alx_setup_speed_duplex
	.p2align	2
_alx_setup_speed_duplex:                ; @alx_setup_speed_duplex
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x23, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x25, _ALX_MII_DBG_ADDR@GOTPAGE
Lloh1:
	ldr	x25, [x25, _ALX_MII_DBG_ADDR@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	w2, #0
	bl	_alx_write_phy_reg
Lloh2:
	adrp	x24, _ALX_DRV@GOTPAGE
Lloh3:
	ldr	x24, [x24, _ALX_DRV@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x19
	bl	_alx_read_mem32
	mov	x21, x0
Lloh4:
	adrp	x8, _ALX_DRV_PHY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ALX_DRV_PHY@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_ALX_SET_FIELD
Lloh7:
	adrp	x8, _ADVERTISED_Autoneg@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ADVERTISED_Autoneg@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_4
; %bb.1:
Lloh10:
	adrp	x8, _ADVERTISE_CSMA@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ADVERTISE_CSMA@GOTPAGEOFF]
Lloh12:
	ldr	w22, [x8]
	mov	x0, x20
	bl	_ethtool_adv_to_mii_adv_t
	orr	w22, w0, w22
Lloh13:
	adrp	x8, _ALX_FC_ANEG@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ALX_FC_ANEG@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	tst	w8, w23
	b.eq	LBB0_7
; %bb.2:
Lloh16:
	adrp	x8, _ALX_FC_RX@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ALX_FC_RX@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	tst	w8, w23
	b.eq	LBB0_5
; %bb.3:
Lloh19:
	adrp	x8, _ADVERTISED_Pause@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ADVERTISED_Pause@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	orr	w22, w8, w22
Lloh22:
	adrp	x8, _ALX_FC_TX@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ALX_FC_TX@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	tst	w8, w23
	b.ne	LBB0_7
	b	LBB0_6
LBB0_4:
Lloh25:
	adrp	x8, _BMCR_RESET@GOTPAGE
Lloh26:
	ldr	x8, [x8, _BMCR_RESET@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
Lloh28:
	adrp	x9, _ADVERTISED_100baseT_Half@GOTPAGE
Lloh29:
	ldr	x9, [x9, _ADVERTISED_100baseT_Half@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	cmp	w9, w20
	cset	w9, eq
Lloh31:
	adrp	x10, _ADVERTISED_100baseT_Full@GOTPAGE
Lloh32:
	ldr	x10, [x10, _ADVERTISED_100baseT_Full@GOTPAGEOFF]
Lloh33:
	ldr	w10, [x10]
	cmp	w10, w20
	cset	w10, eq
	orr	w9, w9, w10
Lloh34:
	adrp	x11, _BMCR_SPEED100@GOTPAGE
Lloh35:
	ldr	x11, [x11, _BMCR_SPEED100@GOTPAGEOFF]
Lloh36:
	ldr	w11, [x11]
	cmp	w9, #0
	csel	w9, w11, wzr, ne
	orr	w8, w9, w8
Lloh37:
	adrp	x9, _ADVERTISED_10baseT_Full@GOTPAGE
Lloh38:
	ldr	x9, [x9, _ADVERTISED_10baseT_Full@GOTPAGEOFF]
Lloh39:
	ldr	w9, [x9]
	cmp	w9, w20
	cset	w9, eq
	orr	w9, w9, w10
Lloh40:
	adrp	x10, _BMCR_FULLDPLX@GOTPAGE
Lloh41:
	ldr	x10, [x10, _BMCR_FULLDPLX@GOTPAGEOFF]
Lloh42:
	ldr	w10, [x10]
	cmp	w9, #0
	csel	w9, w10, wzr, ne
	orr	w2, w8, w9
Lloh43:
	adrp	x8, _MII_BMCR@GOTPAGE
Lloh44:
	ldr	x8, [x8, _MII_BMCR@GOTPAGEOFF]
Lloh45:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_alx_write_phy_reg
	mov	x22, x0
	cbnz	w22, LBB0_15
	b	LBB0_14
LBB0_5:
Lloh46:
	adrp	x8, _ALX_FC_TX@GOTPAGE
Lloh47:
	ldr	x8, [x8, _ALX_FC_TX@GOTPAGEOFF]
Lloh48:
	ldr	w8, [x8]
	tst	w8, w23
	b.eq	LBB0_7
LBB0_6:
Lloh49:
	adrp	x8, _ADVERTISED_Asym_Pause@GOTPAGE
Lloh50:
	ldr	x8, [x8, _ADVERTISED_Asym_Pause@GOTPAGEOFF]
Lloh51:
	ldr	w8, [x8]
	orr	w22, w8, w22
LBB0_7:
	mov	x0, x19
	bl	_alx_hw_giga
	cbz	x0, LBB0_9
; %bb.8:
	mov	x0, x20
	bl	_ethtool_adv_to_mii_ctrl1000_t
	mov	x23, x0
	b	LBB0_10
LBB0_9:
	mov	w23, #0
LBB0_10:
Lloh52:
	adrp	x8, _BMCR_RESET@GOTPAGE
Lloh53:
	ldr	x8, [x8, _BMCR_RESET@GOTPAGEOFF]
Lloh54:
	ldr	w26, [x8]
Lloh55:
	adrp	x8, _BMCR_ANENABLE@GOTPAGE
Lloh56:
	ldr	x8, [x8, _BMCR_ANENABLE@GOTPAGEOFF]
Lloh57:
	ldr	w27, [x8]
Lloh58:
	adrp	x8, _BMCR_ANRESTART@GOTPAGE
Lloh59:
	ldr	x8, [x8, _BMCR_ANRESTART@GOTPAGEOFF]
Lloh60:
	ldr	w28, [x8]
Lloh61:
	adrp	x8, _MII_ADVERTISE@GOTPAGE
Lloh62:
	ldr	x8, [x8, _MII_ADVERTISE@GOTPAGEOFF]
Lloh63:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x22
	bl	_alx_write_phy_reg
	cbnz	w0, LBB0_13
; %bb.11:
Lloh64:
	adrp	x8, _MII_CTRL1000@GOTPAGE
Lloh65:
	ldr	x8, [x8, _MII_CTRL1000@GOTPAGEOFF]
Lloh66:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x23
	bl	_alx_write_phy_reg
	cbnz	w0, LBB0_13
; %bb.12:
	orr	w8, w27, w26
	orr	w2, w8, w28
Lloh67:
	adrp	x8, _MII_BMCR@GOTPAGE
Lloh68:
	ldr	x8, [x8, _MII_BMCR@GOTPAGEOFF]
Lloh69:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_alx_write_phy_reg
	cbz	w0, LBB0_14
LBB0_13:
Lloh70:
	adrp	x8, _EBUSY@GOTPAGE
Lloh71:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh72:
	ldr	w8, [x8]
	neg	w22, w8
	cbnz	w22, LBB0_15
LBB0_14:
	ldr	w1, [x25]
Lloh73:
	adrp	x8, _ALX_PHY_INITED@GOTPAGE
Lloh74:
	ldr	x8, [x8, _ALX_PHY_INITED@GOTPAGEOFF]
Lloh75:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_alx_write_phy_reg
	mov	x0, x19
	mov	x1, x20
	bl	_ethadv_to_hw_cfg
	mov	w22, #0
	orr	w21, w0, w21
LBB0_15:
	ldr	w1, [x24]
	mov	x0, x19
	mov	x2, x21
	bl	_alx_write_mem32
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh61, Lloh62, Lloh63
	.loh AdrpLdrGotLdr	Lloh58, Lloh59, Lloh60
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh64, Lloh65, Lloh66
	.loh AdrpLdrGotLdr	Lloh67, Lloh68, Lloh69
	.loh AdrpLdrGotLdr	Lloh70, Lloh71, Lloh72
	.loh AdrpLdrGotLdr	Lloh73, Lloh74, Lloh75
	.cfi_endproc
                                        ; -- End function
	.comm	_ALX_MII_DBG_ADDR,4,2           ; @ALX_MII_DBG_ADDR
	.comm	_ALX_DRV,4,2                    ; @ALX_DRV
	.comm	_ALX_DRV_PHY,4,2                ; @ALX_DRV_PHY
	.comm	_ADVERTISED_Autoneg,4,2         ; @ADVERTISED_Autoneg
	.comm	_ADVERTISE_CSMA,4,2             ; @ADVERTISE_CSMA
	.comm	_ALX_FC_ANEG,4,2                ; @ALX_FC_ANEG
	.comm	_ALX_FC_RX,4,2                  ; @ALX_FC_RX
	.comm	_ADVERTISED_Pause,4,2           ; @ADVERTISED_Pause
	.comm	_ALX_FC_TX,4,2                  ; @ALX_FC_TX
	.comm	_ADVERTISED_Asym_Pause,4,2      ; @ADVERTISED_Asym_Pause
	.comm	_BMCR_RESET,4,2                 ; @BMCR_RESET
	.comm	_BMCR_ANENABLE,4,2              ; @BMCR_ANENABLE
	.comm	_BMCR_ANRESTART,4,2             ; @BMCR_ANRESTART
	.comm	_MII_ADVERTISE,4,2              ; @MII_ADVERTISE
	.comm	_MII_CTRL1000,4,2               ; @MII_CTRL1000
	.comm	_MII_BMCR,4,2                   ; @MII_BMCR
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_ADVERTISED_100baseT_Half,4,2   ; @ADVERTISED_100baseT_Half
	.comm	_ADVERTISED_100baseT_Full,4,2   ; @ADVERTISED_100baseT_Full
	.comm	_BMCR_SPEED100,4,2              ; @BMCR_SPEED100
	.comm	_ADVERTISED_10baseT_Full,4,2    ; @ADVERTISED_10baseT_Full
	.comm	_BMCR_FULLDPLX,4,2              ; @BMCR_FULLDPLX
	.comm	_ALX_PHY_INITED,4,2             ; @ALX_PHY_INITED
.subsections_via_symbols
