	.file	"extr_bxe_elink.c_elink_test_link.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	elink_test_link
	.type	elink_test_link, @function
elink_test_link:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	ebx, edx
	sub	rsp, 16
	.cfi_def_cfa_offset 64
	mov	r13, QWORD PTR 32[rdi]
	mov	r12, QWORD PTR ELINK_INT_PHY[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	DWORD PTR [rsp], 0
	sal	r12, 4
	add	r12, QWORD PTR 24[rdi]
	mov	rdi, r13
	call	CHIP_IS_E3@PLT
	test	rax, rax
	je	.L2
	mov	rdi, QWORD PTR ELINK_INT_PHY[rip]
	mov	r14, QWORD PTR 0[rbp]
	call	ELINK_LINK_CONFIG_IDX@PLT
	mov	rsi, QWORD PTR ELINK_SPEED_10000[rip]
	cmp	QWORD PTR [r14+rax*8], rsi
	jg	.L34
	mov	rsi, rbp
	mov	rdi, r12
	call	elink_get_warpcore_lane@PLT
	mov	r8, rsp
	mov	rsi, r12
	mov	rdi, r13
	mov	ecx, DWORD PTR MDIO_WC_REG_GP2_STATUS_GP_2_1[rip]
	mov	edx, DWORD PTR MDIO_WC_DEVAD[rip]
	mov	r14d, eax
	call	elink_cl45_read@PLT
	mov	edx, DWORD PTR [rsp]
	mov	ecx, r14d
	mov	eax, edx
	sar	edx, 12
	sar	eax, 8
	or	eax, edx
	and	eax, 15
	mov	edx, eax
	mov	DWORD PTR [rsp], eax
	mov	eax, 1
	sal	eax, cl
	and	eax, edx
.L4:
	test	eax, eax
	je	.L11
	mov	rax, QWORD PTR ELINK_LOOPBACK_XGXS[rip]
	cmp	QWORD PTR 8[rbp], rax
	je	.L31
.L8:
	mov	eax, DWORD PTR 16[rbp]
	cmp	eax, 2
	je	.L9
	cmp	eax, 3
	je	.L10
	cmp	eax, 1
	je	.L31
.L11:
	mov	eax, DWORD PTR ELINK_STATUS_NO_LINK[rip]
.L1:
	mov	rcx, QWORD PTR 8[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L35
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	ecx, DWORD PTR MDIO_GP_STATUS_TOP_AN_STATUS1[rip]
	mov	r8, rsp
	mov	rsi, r12
	mov	rdi, r13
	mov	edx, DWORD PTR MDIO_REG_BANK_GP_STATUS[rip]
	call	CL22_RD_OVER_CL45@PLT
	mov	eax, DWORD PTR [rsp]
	test	DWORD PTR MDIO_GP_STATUS_TOP_AN_STATUS1_LINK_STATUS[rip], eax
	je	.L11
	mov	rax, QWORD PTR ELINK_LOOPBACK_XGXS[rip]
	cmp	QWORD PTR 8[rbp], rax
	jne	.L8
	.p2align 4,,10
	.p2align 3
.L31:
	mov	eax, DWORD PTR ELINK_STATUS_OK[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L34:
	lea	r14, 4[rsp]
	mov	ecx, 1
	mov	rsi, r12
	mov	rdi, r13
	mov	edx, DWORD PTR MDIO_WC_DEVAD[rip]
	mov	r8, r14
	call	elink_cl45_read@PLT
	mov	r8, r14
	mov	ecx, 1
	mov	rsi, r12
	mov	edx, DWORD PTR MDIO_WC_DEVAD[rip]
	mov	rdi, r13
	call	elink_cl45_read@PLT
	mov	eax, DWORD PTR 4[rsp]
	and	eax, 4
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L10:
	mov	rax, QWORD PTR ELINK_EXT_PHY1[rip]
	xor	r14d, r14d
	movsx	r12, eax
	mov	r13d, eax
	sal	r12, 4
	cmp	eax, 2
	jg	.L11
	.p2align 4,,10
	.p2align 3
.L16:
	mov	rdi, QWORD PTR 24[rbp]
	mov	edx, 1
	add	rdi, r12
	mov	eax, DWORD PTR 8[rdi]
	cmp	eax, DWORD PTR ELINK_ETH_PHY_SFPP_10G_FIBER[rip]
	je	.L14
	cmp	eax, DWORD PTR ELINK_ETH_PHY_SFP_1G_FIBER[rip]
	je	.L14
	cmp	eax, DWORD PTR ELINK_ETH_PHY_XFP_FIBER[rip]
	je	.L14
	xor	edx, edx
	cmp	DWORD PTR ELINK_ETH_PHY_DA_TWINAX[rip], eax
	sete	dl
.L14:
	cmp	edx, ebx
	jne	.L15
	mov	rax, QWORD PTR [rdi]
	test	rax, rax
	je	.L15
	lea	rdx, 4[rsp]
	mov	rsi, rbp
	call	rax
	or	r14d, eax
.L15:
	add	r13d, 1
	add	r12, 16
	cmp	DWORD PTR 16[rbp], r13d
	jg	.L16
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L9:
	mov	rax, QWORD PTR ELINK_EXT_PHY1[rip]
	lea	rdx, 4[rsp]
	mov	rsi, rbp
	sal	rax, 4
	add	rax, QWORD PTR 24[rbp]
	mov	rdi, rax
	call	[QWORD PTR [rax]]
	mov	r14d, eax
.L12:
	test	r14d, r14d
	je	.L11
	jmp	.L31
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	elink_test_link, .-elink_test_link
	.comm	MDIO_WC_REG_GP2_STATUS_GP_2_1,4,4
	.comm	MDIO_WC_DEVAD,4,4
	.comm	MDIO_REG_BANK_GP_STATUS,4,4
	.comm	MDIO_GP_STATUS_TOP_AN_STATUS1_LINK_STATUS,4,4
	.comm	MDIO_GP_STATUS_TOP_AN_STATUS1,4,4
	.comm	ELINK_STATUS_OK,4,4
	.comm	ELINK_STATUS_NO_LINK,4,4
	.comm	ELINK_SPEED_10000,8,8
	.comm	ELINK_LOOPBACK_XGXS,8,8
	.comm	ELINK_INT_PHY,8,8
	.comm	ELINK_EXT_PHY1,8,8
	.comm	ELINK_ETH_PHY_XFP_FIBER,4,4
	.comm	ELINK_ETH_PHY_SFP_1G_FIBER,4,4
	.comm	ELINK_ETH_PHY_SFPP_10G_FIBER,4,4
	.comm	ELINK_ETH_PHY_DA_TWINAX,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_bxe_elink.c_elink_test_link.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	elink_test_link
	.syntax unified
	.arm
	.fpu softvfp
	.type	elink_test_link, %function
elink_test_link:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	r3, #0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r7, .L35
	ldr	r8, [r0, #16]
	ldr	r5, [r0, #12]
	ldr	r1, [r7]
	mov	r6, r2
	ldr	r2, .L35+4
	sub	sp, sp, #28
	mov	r4, r0
	mov	r0, r8
	ldr	r2, [r2]
	str	r2, [sp, #20]
	mov	r2,#0
	add	r5, r5, r1, lsl #3
	str	r3, [sp, #12]
	bl	CHIP_IS_E3
	cmp	r0, #0
	beq	.L2
	ldr	r0, [r7]
	ldr	r7, [r4]
	bl	ELINK_LINK_CONFIG_IDX
	ldr	r3, .L35+8
	ldr	r2, [r7, r0, lsl #2]
	ldr	r3, [r3]
	cmp	r2, r3
	bgt	.L32
	mov	r1, r4
	mov	r0, r5
	bl	elink_get_warpcore_lane
	mov	ip, r0
	ldr	r3, .L35+12
	ldr	r2, .L35+16
	add	lr, sp, #12
	ldr	r3, [r3]
	ldr	r2, [r2]
	mov	r1, r5
	mov	r0, r8
	str	lr, [sp]
	mov	r5, ip
	bl	elink_cl45_read
	mov	r2, #1
	ldr	r0, [sp, #12]
	asr	r3, r0, #12
	orr	r3, r3, r0, asr #8
	and	r3, r3, #15
	str	r3, [sp, #12]
	and	r0, r3, r2, lsl r5
.L4:
	cmp	r0, #0
	beq	.L11
.L7:
	ldr	r3, .L35+20
	ldr	r2, [r4, #4]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L30
	ldr	r2, [r4, #8]
	cmp	r2, #2
	beq	.L9
	cmp	r2, #3
	beq	.L10
	cmp	r2, #1
	beq	.L30
.L11:
	ldr	r3, .L35+24
	ldr	r0, [r3]
.L1:
	ldr	r3, .L35+4
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L33
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	ldr	r3, .L35+28
	ldr	r2, .L35+32
	add	ip, sp, #12
	ldr	r3, [r3]
	ldr	r2, [r2]
	mov	r1, r5
	mov	r0, r8
	str	ip, [sp]
	bl	CL22_RD_OVER_CL45
	ldr	r3, .L35+36
	ldr	r2, [sp, #12]
	ldr	r3, [r3]
	tst	r2, r3
	bne	.L7
	b	.L11
.L32:
	ldr	r7, .L35+16
	add	r9, sp, #16
	ldr	r2, [r7]
	mov	r3, #1
	mov	r1, r5
	mov	r0, r8
	str	r9, [sp]
	bl	elink_cl45_read
	str	r9, [sp]
	mov	r1, r5
	mov	r0, r8
	mov	r3, #1
	ldr	r2, [r7]
	bl	elink_cl45_read
	ldr	r0, [sp, #16]
	and	r0, r0, #4
	b	.L4
.L9:
	ldr	r2, .L35+40
	ldr	r3, [r4, #12]
	ldr	r0, [r2]
	mov	r1, r4
	add	r2, sp, #16
	ldr	r4, [r3, r0, lsl #3]
	add	r0, r3, r0, lsl #3
	blx	r4
	mov	r7, r0
.L12:
	cmp	r7, #0
	beq	.L11
.L30:
	ldr	r3, .L35+44
	ldr	r0, [r3]
	b	.L1
.L10:
	ldr	r3, .L35+40
	ldr	r5, [r3]
	cmp	r5, #2
	bgt	.L11
	mov	r7, #0
	ldr	r8, .L35+48
	ldr	r9, .L35+52
	ldr	fp, .L35+56
	ldr	r10, .L35+60
	b	.L13
.L34:
	ldr	lr, [r9]
	cmp	r3, lr
	beq	.L21
	ldr	lr, [fp]
	cmp	r3, lr
	beq	.L21
	ldr	lr, [r10]
	sub	r3, lr, r3
	clz	r3, r3
	lsr	r3, r3, #5
.L14:
	cmp	r3, r6
	bne	.L15
	ldr	r3, [r1, ip]
	cmp	r3, #0
	beq	.L15
	add	r2, sp, #16
	mov	r1, r4
	blx	r3
	ldr	r2, [r4, #8]
	orr	r7, r7, r0
.L15:
	add	r5, r5, #1
	cmp	r2, r5
	ble	.L12
.L13:
	ldr	r1, [r4, #12]
	ldr	lr, [r8]
	add	r0, r1, r5, lsl #3
	ldr	r3, [r0, #4]
	lsl	ip, r5, #3
	cmp	r3, lr
	bne	.L34
.L21:
	mov	r3, #1
	b	.L14
.L33:
	bl	__stack_chk_fail
.L36:
	.align	2
.L35:
	.word	ELINK_INT_PHY
	.word	.LC0
	.word	ELINK_SPEED_10000
	.word	MDIO_WC_REG_GP2_STATUS_GP_2_1
	.word	MDIO_WC_DEVAD
	.word	ELINK_LOOPBACK_XGXS
	.word	ELINK_STATUS_NO_LINK
	.word	MDIO_GP_STATUS_TOP_AN_STATUS1
	.word	MDIO_REG_BANK_GP_STATUS
	.word	MDIO_GP_STATUS_TOP_AN_STATUS1_LINK_STATUS
	.word	ELINK_EXT_PHY1
	.word	ELINK_STATUS_OK
	.word	ELINK_ETH_PHY_SFPP_10G_FIBER
	.word	ELINK_ETH_PHY_SFP_1G_FIBER
	.word	ELINK_ETH_PHY_XFP_FIBER
	.word	ELINK_ETH_PHY_DA_TWINAX
	.size	elink_test_link, .-elink_test_link
	.comm	MDIO_WC_REG_GP2_STATUS_GP_2_1,4,4
	.comm	MDIO_WC_DEVAD,4,4
	.comm	MDIO_REG_BANK_GP_STATUS,4,4
	.comm	MDIO_GP_STATUS_TOP_AN_STATUS1_LINK_STATUS,4,4
	.comm	MDIO_GP_STATUS_TOP_AN_STATUS1,4,4
	.comm	ELINK_STATUS_OK,4,4
	.comm	ELINK_STATUS_NO_LINK,4,4
	.comm	ELINK_SPEED_10000,4,4
	.comm	ELINK_LOOPBACK_XGXS,4,4
	.comm	ELINK_INT_PHY,4,4
	.comm	ELINK_EXT_PHY1,4,4
	.comm	ELINK_ETH_PHY_XFP_FIBER,4,4
	.comm	ELINK_ETH_PHY_SFP_1G_FIBER,4,4
	.comm	ELINK_ETH_PHY_SFPP_10G_FIBER,4,4
	.comm	ELINK_ETH_PHY_DA_TWINAX,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
