	.file	"extr_ar8216.c_ar8216_read_port_link.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ar8216_read_port_link, @function
ar8216_read_port_link:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rdx
	mov	edx, 28
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rdi, r12
	mov	ebp, esi
	xor	esi, esi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	memset@PLT
	mov	rax, QWORD PTR 8[r13]
	mov	esi, ebp
	mov	rdi, r13
	call	[QWORD PTR [rax]]
	xor	edx, edx
	mov	ebx, eax
	and	eax, DWORD PTR AR8216_PORT_STATUS_LINK_AUTO[rip]
	setne	dl
	mov	DWORD PTR [r12], edx
	je	.L2
	xor	eax, eax
	test	DWORD PTR AR8216_PORT_STATUS_LINK_UP[rip], ebx
	setne	al
	mov	DWORD PTR 4[r12], eax
.L3:
	test	eax, eax
	je	.L1
	mov	eax, DWORD PTR [r12]
	test	eax, eax
	setne	cl
	test	DWORD PTR AR8216_PORT_STATUS_DUPLEX[rip], ebx
	setne	dl
	setne	al
	movzx	edx, dl
	mov	DWORD PTR 8[r12], edx
	xor	edx, edx
	test	DWORD PTR AR8216_PORT_STATUS_TXFLOW[rip], ebx
	setne	dl
	mov	DWORD PTR 12[r12], edx
	xor	edx, edx
	test	DWORD PTR AR8216_PORT_STATUS_RXFLOW[rip], ebx
	setne	dl
	mov	DWORD PTR 16[r12], edx
	test	al, al
	je	.L7
	test	cl, cl
	jne	.L25
.L7:
	mov	ecx, DWORD PTR AR8216_PORT_STATUS_SPEED_S[rip]
	and	ebx, DWORD PTR AR8216_PORT_STATUS_SPEED[rip]
	sar	ebx, cl
	cmp	ebx, 129
	je	.L8
	cmp	ebx, 130
	je	.L9
	cmp	ebx, 128
	je	.L26
	mov	eax, DWORD PTR SWITCH_PORT_SPEED_UNKNOWN[rip]
	mov	DWORD PTR 20[r12], eax
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	DWORD PTR 4[r12], 1
	mov	rax, QWORD PTR 0[r13]
	test	rax, rax
	je	.L4
	mov	edi, ebp
	call	rax
	test	eax, eax
	js	.L27
	setne	al
	movzx	eax, al
	mov	DWORD PTR 4[r12], eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L26:
	mov	eax, DWORD PTR SWITCH_PORT_SPEED_10[rip]
	mov	DWORD PTR 20[r12], eax
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	mov	eax, DWORD PTR SWITCH_PORT_SPEED_1000[rip]
	mov	DWORD PTR 20[r12], eax
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	mov	eax, DWORD PTR SWITCH_PORT_SPEED_100[rip]
	mov	DWORD PTR 20[r12], eax
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	.cfi_restore_state
	mov	rax, QWORD PTR 8[r13]
	mov	rax, QWORD PTR 8[rax]
	test	rax, rax
	je	.L7
	mov	esi, ebp
	mov	rdi, r13
	call	rax
	mov	DWORD PTR 24[r12], eax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	xor	eax, eax
	test	DWORD PTR AR8216_PORT_STATUS_DUPLEX[rip], ebx
	setne	al
	mov	DWORD PTR 8[r12], eax
	xor	eax, eax
	test	DWORD PTR AR8216_PORT_STATUS_TXFLOW[rip], ebx
	setne	al
	mov	DWORD PTR 12[r12], eax
	xor	eax, eax
	test	DWORD PTR AR8216_PORT_STATUS_RXFLOW[rip], ebx
	setne	al
	mov	DWORD PTR 16[r12], eax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L27:
	mov	eax, DWORD PTR 4[r12]
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	ar8216_read_port_link, .-ar8216_read_port_link
	.comm	SWITCH_PORT_SPEED_UNKNOWN,4,4
	.comm	SWITCH_PORT_SPEED_1000,4,4
	.comm	SWITCH_PORT_SPEED_100,4,4
	.comm	SWITCH_PORT_SPEED_10,4,4
	.comm	AR8216_PORT_STATUS_TXFLOW,4,4
	.comm	AR8216_PORT_STATUS_SPEED_S,4,4
	.comm	AR8216_PORT_STATUS_SPEED,4,4
	.comm	AR8216_PORT_STATUS_RXFLOW,4,4
	.comm	AR8216_PORT_STATUS_LINK_UP,4,4
	.comm	AR8216_PORT_STATUS_LINK_AUTO,4,4
	.comm	AR8216_PORT_STATUS_DUPLEX,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_ar8216.c_ar8216_read_port_link.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ar8216_read_port_link, %function
ar8216_read_port_link:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r6, r0
	mov	r7, r1
	mov	r4, r2
	mov	r0, r2
	mov	r1, #0
	mov	r2, #28
	bl	memset
	ldr	r3, [r6, #4]
	mov	r1, r7
	ldr	r3, [r3]
	mov	r0, r6
	blx	r3
	ldr	r3, .L26
	mov	r5, r0
	ldr	r3, [r3]
	and	r3, r3, r0
	cmp	r3, #0
	movne	r3, #1
	moveq	r3, #0
	str	r3, [r4]
	beq	.L2
	ldr	r3, .L26+4
	ldr	r3, [r3]
	tst	r0, r3
	movne	r3, #1
	moveq	r3, #0
	cmp	r3, #0
	str	r3, [r4, #4]
	popeq	{r4, r5, r6, r7, r8, pc}
.L25:
	ldr	r3, .L26+8
	ldr	r2, .L26+12
	ldr	r3, [r3]
	ldr	r1, [r2]
	tst	r5, r3
	movne	r2, #1
	moveq	r2, #0
	ldr	r3, .L26+16
	tst	r5, r1
	ldr	r3, [r3]
	movne	r0, #1
	moveq	r0, #0
	tst	r5, r3
	ldr	r3, [r4]
	movne	r1, #1
	moveq	r1, #0
	cmp	r3, #0
	movne	r3, r2
	moveq	r3, #0
	cmp	r3, #0
	str	r2, [r4, #8]
	str	r0, [r4, #12]
	str	r1, [r4, #16]
	bne	.L22
.L7:
	ldr	r2, .L26+20
	ldr	r3, .L26+24
	ldr	r0, [r2]
	ldr	r3, [r3]
	and	r5, r5, r0
	asr	r5, r5, r3
	cmp	r5, #129
	beq	.L8
	cmp	r5, #130
	beq	.L9
	cmp	r5, #128
	beq	.L23
	ldr	r3, .L26+28
	ldr	r3, [r3]
	str	r3, [r4, #20]
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	mov	r2, #1
	ldr	r3, [r6]
	str	r2, [r4, #4]
	cmp	r3, #0
	beq	.L4
	mov	r0, r7
	blx	r3
	cmp	r0, #0
	blt	.L24
	movne	r3, #1
	moveq	r3, #0
	cmp	r3, #0
	str	r3, [r4, #4]
	bne	.L25
	pop	{r4, r5, r6, r7, r8, pc}
.L23:
	ldr	r3, .L26+32
	ldr	r3, [r3]
	str	r3, [r4, #20]
	pop	{r4, r5, r6, r7, r8, pc}
.L9:
	ldr	r3, .L26+36
	ldr	r3, [r3]
	str	r3, [r4, #20]
	pop	{r4, r5, r6, r7, r8, pc}
.L22:
	ldr	r3, [r6, #4]
	ldr	r3, [r3, #4]
	cmp	r3, #0
	beq	.L7
	mov	r1, r7
	mov	r0, r6
	blx	r3
	str	r0, [r4, #24]
	b	.L7
.L8:
	ldr	r3, .L26+40
	ldr	r3, [r3]
	str	r3, [r4, #20]
	pop	{r4, r5, r6, r7, r8, pc}
.L4:
	ldr	r3, .L26+8
	ldr	r2, .L26+12
	ldr	r1, [r3]
	ldr	r3, .L26+16
	ldr	r2, [r2]
	ldr	r3, [r3]
	tst	r0, r1
	movne	r1, #1
	moveq	r1, #0
	tst	r0, r2
	movne	r2, #1
	moveq	r2, #0
	tst	r0, r3
	movne	r3, #1
	moveq	r3, #0
	str	r1, [r4, #8]
	str	r2, [r4, #12]
	str	r3, [r4, #16]
	b	.L7
.L24:
	ldr	r3, [r4, #4]
	cmp	r3, #0
	bne	.L25
	pop	{r4, r5, r6, r7, r8, pc}
.L27:
	.align	2
.L26:
	.word	AR8216_PORT_STATUS_LINK_AUTO
	.word	AR8216_PORT_STATUS_LINK_UP
	.word	AR8216_PORT_STATUS_DUPLEX
	.word	AR8216_PORT_STATUS_TXFLOW
	.word	AR8216_PORT_STATUS_RXFLOW
	.word	AR8216_PORT_STATUS_SPEED
	.word	AR8216_PORT_STATUS_SPEED_S
	.word	SWITCH_PORT_SPEED_UNKNOWN
	.word	SWITCH_PORT_SPEED_10
	.word	SWITCH_PORT_SPEED_1000
	.word	SWITCH_PORT_SPEED_100
	.size	ar8216_read_port_link, .-ar8216_read_port_link
	.comm	SWITCH_PORT_SPEED_UNKNOWN,4,4
	.comm	SWITCH_PORT_SPEED_1000,4,4
	.comm	SWITCH_PORT_SPEED_100,4,4
	.comm	SWITCH_PORT_SPEED_10,4,4
	.comm	AR8216_PORT_STATUS_TXFLOW,4,4
	.comm	AR8216_PORT_STATUS_SPEED_S,4,4
	.comm	AR8216_PORT_STATUS_SPEED,4,4
	.comm	AR8216_PORT_STATUS_RXFLOW,4,4
	.comm	AR8216_PORT_STATUS_LINK_UP,4,4
	.comm	AR8216_PORT_STATUS_LINK_AUTO,4,4
	.comm	AR8216_PORT_STATUS_DUPLEX,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
