	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_alx_read_phy_link              ## -- Begin function alx_read_phy_link
	.p2align	4, 0x90
_alx_read_phy_link:                     ## @alx_read_phy_link
	.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, %rbx
	movq	8(%rdi), %r14
	movq	_MII_BMSR@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	leaq	-28(%rbp), %rdx
	callq	_alx_read_phy_reg
	testl	%eax, %eax
	jne	LBB0_12
## %bb.1:
	movl	(%r15), %esi
	leaq	-28(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_alx_read_phy_reg
	testl	%eax, %eax
	jne	LBB0_12
## %bb.2:
	movq	_BMSR_LSTATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -28(%rbp)
	je	LBB0_3
## %bb.4:
	movq	_ALX_MII_GIGA_PSSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_alx_read_phy_reg
	testl	%eax, %eax
	jne	LBB0_12
## %bb.5:
	movl	-32(%rbp), %edx
	movq	_ALX_GIGA_PSSR_SPD_DPLX_RESOLVED@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	je	LBB0_11
## %bb.6:
	movq	_ALX_GIGA_PSSR_SPEED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%edx, %eax
	addl	$-128, %eax
	cmpl	$2, %eax
	ja	LBB0_11
## %bb.7:
	cltq
	leaq	l_switch.table.alx_read_phy_link(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	movq	_ALX_GIGA_PSSR_DPLX@GOTPCREL(%rip), %rax
	andl	(%rax), %edx
	jne	LBB0_8
## %bb.9:
	movq	_DUPLEX_HALF@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_3:
	movq	_SPEED_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	movq	_DUPLEX_UNKNOWN@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	xorl	%eax, %eax
	jmp	LBB0_12
LBB0_11:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_DUPLEX_FULL@GOTPCREL(%rip), %rax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_MII_BMSR,4,2                   ## @MII_BMSR
	.comm	_BMSR_LSTATUS,4,2               ## @BMSR_LSTATUS
	.comm	_SPEED_UNKNOWN,4,2              ## @SPEED_UNKNOWN
	.comm	_DUPLEX_UNKNOWN,4,2             ## @DUPLEX_UNKNOWN
	.comm	_ALX_MII_GIGA_PSSR,4,2          ## @ALX_MII_GIGA_PSSR
	.comm	_ALX_GIGA_PSSR_SPD_DPLX_RESOLVED,4,2 ## @ALX_GIGA_PSSR_SPD_DPLX_RESOLVED
	.comm	_ALX_GIGA_PSSR_SPEED,4,2        ## @ALX_GIGA_PSSR_SPEED
	.comm	_SPEED_1000,4,2                 ## @SPEED_1000
	.comm	_SPEED_100,4,2                  ## @SPEED_100
	.comm	_SPEED_10,4,2                   ## @SPEED_10
	.comm	_ALX_GIGA_PSSR_DPLX,4,2         ## @ALX_GIGA_PSSR_DPLX
	.comm	_DUPLEX_FULL,4,2                ## @DUPLEX_FULL
	.comm	_DUPLEX_HALF,4,2                ## @DUPLEX_HALF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid PHY speed/duplex: 0x%x\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.alx_read_phy_link
l_switch.table.alx_read_phy_link:
	.quad	_SPEED_10
	.quad	_SPEED_100
	.quad	_SPEED_1000

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_alx_read_phy_link              ; -- Begin function alx_read_phy_link
	.p2align	2
_alx_read_phy_link:                     ; @alx_read_phy_link
	.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, #8]
Lloh0:
	adrp	x21, _MII_BMSR@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MII_BMSR@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	bl	_alx_read_phy_reg
	cbnz	w0, LBB0_2
; %bb.1:
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_alx_read_phy_reg
	cbz	w0, LBB0_3
LBB0_2:
	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_3:
	ldr	w8, [sp, #12]
Lloh2:
	adrp	x9, _BMSR_LSTATUS@GOTPAGE
Lloh3:
	ldr	x9, [x9, _BMSR_LSTATUS@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.4:
Lloh5:
	adrp	x8, _ALX_MII_GIGA_PSSR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ALX_MII_GIGA_PSSR@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x19
	bl	_alx_read_phy_reg
	cbnz	w0, LBB0_2
; %bb.5:
	ldr	w2, [sp, #8]
Lloh8:
	adrp	x8, _ALX_GIGA_PSSR_SPD_DPLX_RESOLVED@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ALX_GIGA_PSSR_SPD_DPLX_RESOLVED@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w2
	b.eq	LBB0_9
; %bb.6:
Lloh11:
	adrp	x8, _ALX_GIGA_PSSR_SPEED@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ALX_GIGA_PSSR_SPEED@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	and	w8, w8, w2
	sub	w8, w8, #128
	cmp	w8, #2
	b.hi	LBB0_9
; %bb.7:
	mov	w0, #0
Lloh14:
	adrp	x9, l_switch.table.alx_read_phy_link@PAGE
Lloh15:
	add	x9, x9, l_switch.table.alx_read_phy_link@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
	ldr	w8, [x8]
	str	w8, [x19, #4]
Lloh16:
	adrp	x8, _ALX_GIGA_PSSR_DPLX@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ALX_GIGA_PSSR_DPLX@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
Lloh19:
	adrp	x9, _DUPLEX_FULL@GOTPAGE
Lloh20:
	ldr	x9, [x9, _DUPLEX_FULL@GOTPAGEOFF]
Lloh21:
	adrp	x10, _DUPLEX_HALF@GOTPAGE
Lloh22:
	ldr	x10, [x10, _DUPLEX_HALF@GOTPAGEOFF]
	tst	w8, w2
	csel	x8, x10, x9, eq
	ldr	w8, [x8]
	str	w8, [x19]
	b	LBB0_2
LBB0_8:
	mov	w0, #0
Lloh23:
	adrp	x8, _SPEED_UNKNOWN@GOTPAGE
Lloh24:
	ldr	x8, [x8, _SPEED_UNKNOWN@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
Lloh26:
	adrp	x9, _DUPLEX_UNKNOWN@GOTPAGE
Lloh27:
	ldr	x9, [x9, _DUPLEX_UNKNOWN@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	stp	w9, w8, [x19]
	b	LBB0_2
LBB0_9:
Lloh29:
	adrp	x1, l_.str@PAGE
Lloh30:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh31:
	adrp	x8, _EINVAL@GOTPAGE
Lloh32:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_MII_BMSR,4,2                   ; @MII_BMSR
	.comm	_BMSR_LSTATUS,4,2               ; @BMSR_LSTATUS
	.comm	_SPEED_UNKNOWN,4,2              ; @SPEED_UNKNOWN
	.comm	_DUPLEX_UNKNOWN,4,2             ; @DUPLEX_UNKNOWN
	.comm	_ALX_MII_GIGA_PSSR,4,2          ; @ALX_MII_GIGA_PSSR
	.comm	_ALX_GIGA_PSSR_SPD_DPLX_RESOLVED,4,2 ; @ALX_GIGA_PSSR_SPD_DPLX_RESOLVED
	.comm	_ALX_GIGA_PSSR_SPEED,4,2        ; @ALX_GIGA_PSSR_SPEED
	.comm	_SPEED_1000,4,2                 ; @SPEED_1000
	.comm	_SPEED_100,4,2                  ; @SPEED_100
	.comm	_SPEED_10,4,2                   ; @SPEED_10
	.comm	_ALX_GIGA_PSSR_DPLX,4,2         ; @ALX_GIGA_PSSR_DPLX
	.comm	_DUPLEX_FULL,4,2                ; @DUPLEX_FULL
	.comm	_DUPLEX_HALF,4,2                ; @DUPLEX_HALF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid PHY speed/duplex: 0x%x\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.alx_read_phy_link
l_switch.table.alx_read_phy_link:
	.quad	_SPEED_10
	.quad	_SPEED_100
	.quad	_SPEED_1000

.subsections_via_symbols
