	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function altera_tse_adjust_link
_altera_tse_adjust_link:                ## @altera_tse_adjust_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	%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	%rdi, %r13
	callq	_netdev_priv
	movq	%rax, %rbx
	movq	8(%r13), %r12
	movq	%rax, %r15
	addq	$12, %r15
	movq	%r15, %rdi
	callq	_spin_lock
	cmpq	$0, 8(%r12)
	je	LBB0_17
## %bb.1:
	movq	16(%rbx), %rdi
	callq	_ioread32
	movl	%eax, %edi
	movl	(%r12), %ecx
	cmpl	(%rbx), %ecx
	jne	LBB0_3
## %bb.2:
	xorl	%r14d, %r14d
	jmp	LBB0_4
LBB0_17:
	cmpl	$0, 8(%rbx)
	je	LBB0_22
## %bb.18:
	movl	$0, 8(%rbx)
	movl	$4294967295, %eax               ## imm = 0xFFFFFFFF
	movq	%rax, (%rbx)
	jmp	LBB0_20
LBB0_3:
	movq	_MAC_CMDCFG_HD_ENA@GOTPCREL(%rip), %rax
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movl	(%rax), %r12d
	movl	%r12d, %eax
	notl	%eax
	andl	%edi, %eax
	orl	%edi, %r12d
	testl	%ecx, %ecx
	cmovnel	%eax, %r12d
	movl	24(%rbx), %edi
	movl	(%r13), %edx
	leaq	L_.str(%rip), %rsi
	callq	_netdev_dbg
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movl	$1, %r14d
	movl	%r12d, %edi
	movq	-48(%rbp), %r12                 ## 8-byte Reload
LBB0_4:
	movl	4(%r12), %eax
	cmpl	4(%rbx), %eax
	je	LBB0_15
## %bb.5:
	cmpl	$10, %eax
	je	LBB0_10
## %bb.6:
	cmpl	$100, %eax
	je	LBB0_9
## %bb.7:
	cmpl	$1000, %eax                     ## imm = 0x3E8
	jne	LBB0_11
## %bb.8:
	movq	_MAC_CMDCFG_ETH_SPEED@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	_MAC_CMDCFG_ENA_10@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, %edi
	jmp	LBB0_14
LBB0_10:
	movq	_MAC_CMDCFG_ETH_SPEED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, %edi
	movq	_MAC_CMDCFG_ENA_10@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	jmp	LBB0_14
LBB0_9:
	movq	_MAC_CMDCFG_ETH_SPEED@GOTPCREL(%rip), %rax
	movq	_MAC_CMDCFG_ENA_10@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	notl	%ecx
	andl	%ecx, %edi
	jmp	LBB0_14
LBB0_11:
	movl	%edi, %r14d
	movq	%rbx, %rdi
	callq	_netif_msg_link
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movl	4(%r12), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	callq	_netdev_warn
LBB0_13:
	movl	%r14d, %edi
LBB0_14:
	movl	4(%r12), %eax
	movl	%eax, 4(%rbx)
	movl	$1, %r14d
LBB0_15:
	movq	16(%rbx), %rsi
	callq	_iowrite32
	cmpl	$0, 8(%rbx)
	je	LBB0_16
## %bb.19:
	testl	%r14d, %r14d
	jne	LBB0_20
	jmp	LBB0_22
LBB0_16:
	movl	$1, 8(%rbx)
LBB0_20:
	movq	%rbx, %rdi
	callq	_netif_msg_link
	testq	%rax, %rax
	je	LBB0_22
## %bb.21:
	movq	%r12, %rdi
	callq	_phy_print_status
LBB0_22:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MAC_CMDCFG_HD_ENA,4,2          ## @MAC_CMDCFG_HD_ENA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: Link duplex = 0x%x\n"

	.comm	_MAC_CMDCFG_ETH_SPEED,4,2       ## @MAC_CMDCFG_ETH_SPEED
	.comm	_MAC_CMDCFG_ENA_10,4,2          ## @MAC_CMDCFG_ENA_10
L_.str.1:                               ## @.str.1
	.asciz	"Speed (%d) is not 10/100/1000!\n"

	.no_dead_strip	_altera_tse_adjust_link
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function altera_tse_adjust_link
_altera_tse_adjust_link:                ; @altera_tse_adjust_link
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x23, x0
	bl	_netdev_priv
	mov	x21, x0
	ldr	x20, [x23, #8]
	add	x19, x0, #12
	mov	x0, x19
	bl	_spin_lock
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_3
; %bb.1:
	ldr	x0, [x21, #16]
	bl	_ioread32
	mov	x22, x0
	ldr	w3, [x20]
	ldr	w8, [x21]
	cmp	w3, w8
	b.ne	LBB0_5
; %bb.2:
	mov	w24, #0
	b	LBB0_6
LBB0_3:
	ldr	w8, [x21, #8]
	cbz	w8, LBB0_21
; %bb.4:
	str	wzr, [x21, #8]
	movi	d0, #0x000000ffffffff
	str	d0, [x21]
	b	LBB0_19
LBB0_5:
Lloh0:
	adrp	x8, _MAC_CMDCFG_HD_ENA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAC_CMDCFG_HD_ENA@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	bic	w9, w22, w8
	orr	w8, w8, w22
	cmp	w3, #0
	csel	w22, w8, w9, eq
	ldr	w0, [x21, #24]
	ldr	w2, [x23]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_netdev_dbg
	ldr	w8, [x20]
	str	w8, [x21]
	mov	w24, #1
LBB0_6:
	ldr	w8, [x20, #4]
	ldr	w9, [x21, #4]
	cmp	w8, w9
	b.eq	LBB0_16
; %bb.7:
	cmp	w8, #10
	b.eq	LBB0_11
; %bb.8:
	cmp	w8, #100
	b.eq	LBB0_12
; %bb.9:
	cmp	w8, #1000
	b.ne	LBB0_13
; %bb.10:
Lloh5:
	adrp	x8, _MAC_CMDCFG_ETH_SPEED@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MAC_CMDCFG_ETH_SPEED@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	orr	w8, w8, w22
Lloh8:
	adrp	x9, _MAC_CMDCFG_ENA_10@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MAC_CMDCFG_ENA_10@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	bic	w22, w8, w9
	b	LBB0_15
LBB0_11:
Lloh11:
	adrp	x8, _MAC_CMDCFG_ETH_SPEED@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MAC_CMDCFG_ETH_SPEED@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	bic	w8, w22, w8
Lloh14:
	adrp	x9, _MAC_CMDCFG_ENA_10@GOTPAGE
Lloh15:
	ldr	x9, [x9, _MAC_CMDCFG_ENA_10@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w22, w8, w9
	b	LBB0_15
LBB0_12:
Lloh17:
	adrp	x8, _MAC_CMDCFG_ETH_SPEED@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MAC_CMDCFG_ETH_SPEED@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	adrp	x9, _MAC_CMDCFG_ENA_10@GOTPAGE
Lloh21:
	ldr	x9, [x9, _MAC_CMDCFG_ENA_10@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bic	w22, w22, w8
	b	LBB0_15
LBB0_13:
	mov	x0, x21
	bl	_netif_msg_link
	cbz	x0, LBB0_15
; %bb.14:
	ldr	w2, [x20, #4]
Lloh23:
	adrp	x1, l_.str.1@PAGE
Lloh24:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x23
	bl	_netdev_warn
LBB0_15:
	ldr	w8, [x20, #4]
	str	w8, [x21, #4]
	mov	w24, #1
LBB0_16:
	ldr	x1, [x21, #16]
	mov	x0, x22
	bl	_iowrite32
	ldr	w8, [x21, #8]
	cbz	w8, LBB0_18
; %bb.17:
	cbnz	w24, LBB0_19
	b	LBB0_21
LBB0_18:
	mov	w8, #1
	str	w8, [x21, #8]
LBB0_19:
	mov	x0, x21
	bl	_netif_msg_link
	cbz	x0, LBB0_21
; %bb.20:
	mov	x0, x20
	bl	_phy_print_status
LBB0_21:
	mov	x0, x19
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_spin_unlock
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_MAC_CMDCFG_HD_ENA,4,2          ; @MAC_CMDCFG_HD_ENA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: Link duplex = 0x%x\n"

	.comm	_MAC_CMDCFG_ETH_SPEED,4,2       ; @MAC_CMDCFG_ETH_SPEED
	.comm	_MAC_CMDCFG_ENA_10,4,2          ; @MAC_CMDCFG_ENA_10
l_.str.1:                               ; @.str.1
	.asciz	"Speed (%d) is not 10/100/1000!\n"

	.no_dead_strip	_altera_tse_adjust_link
.subsections_via_symbols
