	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm5461_read_link
_bcm5461_read_link:                     ## @bcm5461_read_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	_MII_NCONFIG@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movl	$31744, %edx                    ## imm = 0x7C00
	callq	_sungem_phy_write
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_sungem_phy_read
	movq	_BCM5461_MODE_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	sarl	%eax
	movq	_BCM54XX_COPPER@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_1
## %bb.5:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_bcm54xx_read_link              ## TAILCALL
LBB0_1:
	movq	_SPEED_1000@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	movl	(%r14), %esi
	movq	%rbx, %rdi
	movl	$28672, %edx                    ## imm = 0x7000
	callq	_sungem_phy_write
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_sungem_phy_read
	movq	_BCM5461_FIBER_DUPLEX@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_3
## %bb.2:
	movq	_DUPLEX_FULL@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_3:
	movq	_DUPLEX_HALF@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %eax
	orl	%eax, (%rbx)
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MII_NCONFIG,4,2                ## @MII_NCONFIG
	.comm	_BCM5461_MODE_MASK,4,2          ## @BCM5461_MODE_MASK
	.comm	_BCM54XX_COPPER,4,2             ## @BCM54XX_COPPER
	.comm	_SPEED_1000,4,2                 ## @SPEED_1000
	.comm	_BCM5461_FIBER_DUPLEX,4,2       ## @BCM5461_FIBER_DUPLEX
	.comm	_DUPLEX_FULL,4,2                ## @DUPLEX_FULL
	.comm	_DUPLEX_HALF,4,2                ## @DUPLEX_HALF
	.no_dead_strip	_bcm5461_read_link
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm5461_read_link
_bcm5461_read_link:                     ; @bcm5461_read_link
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x20, _MII_NCONFIG@GOTPAGE
Lloh1:
	ldr	x20, [x20, _MII_NCONFIG@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	w2, #31744
	bl	_sungem_phy_write
	ldr	w1, [x20]
	mov	x0, x19
	bl	_sungem_phy_read
Lloh2:
	adrp	x8, _BCM5461_MODE_MASK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _BCM5461_MODE_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh5:
	adrp	x9, _BCM54XX_COPPER@GOTPAGE
Lloh6:
	ldr	x9, [x9, _BCM54XX_COPPER@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	cmp	w9, w8, asr #1
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_bcm54xx_read_link
LBB0_2:
Lloh8:
	adrp	x8, _SPEED_1000@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SPEED_1000@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	str	w8, [x19, #4]
	ldr	w1, [x20]
	mov	x0, x19
	mov	w2, #28672
	bl	_sungem_phy_write
	ldr	w1, [x20]
	mov	x0, x19
	bl	_sungem_phy_read
Lloh11:
	adrp	x8, _BCM5461_FIBER_DUPLEX@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BCM5461_FIBER_DUPLEX@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_4
; %bb.3:
Lloh14:
	adrp	x8, _DUPLEX_FULL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _DUPLEX_FULL@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
Lloh16:
	adrp	x8, _DUPLEX_HALF@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DUPLEX_HALF@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_MII_NCONFIG,4,2                ; @MII_NCONFIG
	.comm	_BCM5461_MODE_MASK,4,2          ; @BCM5461_MODE_MASK
	.comm	_BCM54XX_COPPER,4,2             ; @BCM54XX_COPPER
	.comm	_SPEED_1000,4,2                 ; @SPEED_1000
	.comm	_BCM5461_FIBER_DUPLEX,4,2       ; @BCM5461_FIBER_DUPLEX
	.comm	_DUPLEX_FULL,4,2                ; @DUPLEX_FULL
	.comm	_DUPLEX_HALF,4,2                ; @DUPLEX_HALF
	.no_dead_strip	_bcm5461_read_link
.subsections_via_symbols
