	.file	"extr_ar8216.c_ar8xxx_sw_get_ports.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ar8xxx_sw_get_ports, @function
ar8xxx_sw_get_ports:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	rbx, rsi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	call	swdev_to_ar8xxx@PLT
	mov	rdx, QWORD PTR [rbx]
	cmp	rdx, QWORD PTR AR8X16_MAX_VLANS[rip]
	jnb	.L14
	mov	rcx, QWORD PTR [rax]
	mov	edi, DWORD PTR 0[rbp]
	mov	r8d, DWORD PTR [rcx+rdx*4]
	mov	QWORD PTR 8[rbx], 0
	test	edi, edi
	jle	.L4
	mov	ecx, DWORD PTR SWITCH_PORT_FLAG_TAGGED[rip]
	mov	r9d, 1
	xor	r10d, r10d
	sal	r9d, cl
	xor	ecx, ecx
	.p2align 4,,10
	.p2align 3
.L7:
	bt	r8d, ecx
	jnc	.L5
	mov	rdx, QWORD PTR 8[rbx]
	lea	rsi, 1[rdx]
	mov	QWORD PTR 8[rbx], rsi
	mov	rsi, QWORD PTR 16[rbx]
	lea	rdx, [rsi+rdx*8]
	mov	esi, DWORD PTR 8[rax]
	mov	DWORD PTR [rdx], ecx
	sar	esi, cl
	and	esi, 1
	mov	esi, r10d
	cmovne	esi, r9d
	mov	DWORD PTR 4[rdx], esi
.L5:
	add	ecx, 1
	cmp	ecx, edi
	jne	.L7
.L4:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	mov	eax, DWORD PTR EINVAL[rip]
	add	rsp, 8
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	neg	eax
	ret
	.cfi_endproc
.LFE0:
	.size	ar8xxx_sw_get_ports, .-ar8xxx_sw_get_ports
	.comm	SWITCH_PORT_FLAG_TAGGED,4,4
	.comm	EINVAL,4,4
	.comm	AR8X16_MAX_VLANS,8,8
	.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_ar8xxx_sw_get_ports.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ar8xxx_sw_get_ports, %function
ar8xxx_sw_get_ports:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r1
	mov	r5, r0
	bl	swdev_to_ar8xxx
	ldr	r2, .L15
	ldr	r3, [r4]
	ldr	r2, [r2]
	cmp	r3, r2
	bcs	.L14
	mov	r2, #0
	ldr	r5, [r5]
	ldr	r1, [r0]
	cmp	r5, r2
	ldr	r6, [r1, r3, lsl #2]
	str	r2, [r4, #4]
	ble	.L4
	mov	r7, #1
	ldr	r3, .L15+4
	ldr	r3, [r3]
	lsl	r7, r7, r3
.L7:
	asr	r3, r6, r2
	tst	r3, #1
	beq	.L5
	ldr	r3, [r0, #4]
	ldr	r1, [r4, #4]
	asr	r3, r3, r2
	ands	r3, r3, #1
	movne	r3, r7
	ldr	ip, [r4, #8]
	add	r8, r1, #1
	add	lr, ip, r1, lsl #3
	str	r8, [r4, #4]
	str	r2, [ip, r1, lsl #3]
	str	r3, [lr, #4]
.L5:
	add	r2, r2, #1
	cmp	r2, r5
	bne	.L7
.L4:
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L14:
	ldr	r3, .L15+8
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L16:
	.align	2
.L15:
	.word	AR8X16_MAX_VLANS
	.word	SWITCH_PORT_FLAG_TAGGED
	.word	EINVAL
	.size	ar8xxx_sw_get_ports, .-ar8xxx_sw_get_ports
	.comm	SWITCH_PORT_FLAG_TAGGED,4,4
	.comm	EINVAL,4,4
	.comm	AR8X16_MAX_VLANS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
