	.file	"extr_ip175c.c_ip175c_port_vlan_setup.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"cpuport != 5 not supported for IP175C"
	.align 8
.LC1:
	.string	"numports != 6 not supported for IP175C"
	.text
	.p2align 4
	.type	ip175c_port_vlan_setup, @function
ip175c_port_vlan_setup:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	mov	r13, rdi
	push	r12
	push	rbx
	sub	rsp, 40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	movsx	rax, DWORD PTR IP175X_NUM_PORTS[rip]
	mov	rbx, rsp
	mov	rcx, rax
	lea	rax, 15[0+rax*4]
	mov	rdx, rax
	and	rax, -4096
	sub	rbx, rax
	and	rdx, -16
	mov	rax, rbx
	cmp	rsp, rax
	je	.L3
.L36:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L36
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L37
.L4:
	mov	r15d, ecx
	mov	rbx, rsp
	mov	r12, rsp
	shr	r15d, 31
	add	r15d, ecx
	sar	r15d
	movsx	rax, r15d
	lea	rax, 15[0+rax*4]
	mov	rdx, rax
	and	rax, -4096
	sub	rbx, rax
	and	rdx, -16
	mov	rax, rbx
	cmp	rsp, rax
	je	.L6
.L38:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L38
.L6:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L39
.L7:
	lea	r14, 3[rsp]
	xor	edi, edi
	lea	rsi, .LC0[rip]
	mov	DWORD PTR -68[rbp], ecx
	mov	rbx, r14
	and	r14, -4
	shr	rbx, 2
	cmp	DWORD PTR 0[r13], 5
	sete	dil
	call	KASSERT@PLT
	xor	edi, edi
	cmp	DWORD PTR 4[r13], 6
	lea	rsi, .LC1[rip]
	sete	dil
	call	KASSERT@PLT
	mov	ecx, DWORD PTR -68[rbp]
	xor	esi, esi
	mov	rdi, r12
	lea	edx, 0[0+rcx*4]
	call	memset@PLT
	mov	eax, DWORD PTR 32[r13]
	test	eax, eax
	jle	.L12
	mov	r8, QWORD PTR 8[r13]
	mov	rdi, QWORD PTR 24[r13]
	lea	esi, -1[rax]
	xor	eax, eax
	.p2align 4,,10
	.p2align 3
.L11:
	movsx	rdx, DWORD PTR [r8+rax*4]
	mov	ecx, DWORD PTR [rdi+rax*4]
	mov	DWORD PTR [r12+rdx*4], ecx
	mov	rdx, rax
	add	rax, 1
	cmp	rdx, rsi
	jne	.L11
.L12:
	mov	edx, DWORD PTR 4[r13]
	test	edx, edx
	jle	.L10
	mov	ecx, DWORD PTR 0[r13]
	mov	eax, 1
	sub	edx, 1
	lea	rsi, 4[r12+rdx*4]
	sal	eax, cl
	mov	edi, eax
	mov	ecx, eax
	mov	rax, r12
	not	edi
	.p2align 4,,10
	.p2align 3
.L16:
	mov	edx, DWORD PTR [rax]
	test	ecx, edx
	je	.L15
	or	dl, -128
	and	edx, edi
	mov	DWORD PTR [rax], edx
.L15:
	add	rax, 4
	cmp	rsi, rax
	jne	.L16
.L10:
	lea	edx, 0[0+r15*4]
	xor	esi, esi
	mov	rdi, r14
	call	memset@PLT
	mov	edx, DWORD PTR 4[r13]
	xor	eax, eax
	mov	ecx, edx
	shr	ecx, 31
	add	ecx, edx
	sar	ecx
	cmp	edx, 1
	jle	.L14
	.p2align 4,,10
	.p2align 3
.L13:
	mov	edx, DWORD PTR [r12+rax*8]
	sal	edx, 8
	or	edx, DWORD PTR 4[r12+rax*8]
	mov	DWORD PTR [r14+rax*4], edx
	add	rax, 1
	cmp	ecx, eax
	jg	.L13
.L14:
	mov	edi, DWORD PTR 16[r13]
	mov	edx, 19
	mov	esi, 29
	mov	ecx, DWORD PTR 0[0+rbx*4]
	call	ip17x_writephy@PLT
	test	eax, eax
	je	.L40
.L1:
	mov	rbx, QWORD PTR -56[rbp]
	xor	rbx, QWORD PTR fs:40
	jne	.L41
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L37:
	.cfi_restore_state
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L40:
	mov	ecx, DWORD PTR 4[0+rbx*4]
	mov	edi, DWORD PTR 16[r13]
	mov	edx, 20
	mov	esi, 29
	call	ip17x_writephy@PLT
	test	eax, eax
	jne	.L1
	mov	edi, DWORD PTR 16[r13]
	mov	ecx, 65280
	mov	edx, 21
	mov	r8d, DWORD PTR 8[0+rbx*4]
	mov	esi, 29
	call	ip17x_updatephy@PLT
	test	eax, eax
	jne	.L1
	mov	edi, DWORD PTR 16[r13]
	mov	ecx, 255
	mov	edx, 18
	mov	r8d, DWORD PTR 8[0+rbx*4]
	mov	esi, 30
	call	ip17x_updatephy@PLT
	jmp	.L1
.L39:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L7
.L41:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	ip175c_port_vlan_setup, .-ip175c_port_vlan_setup
	.comm	IP175X_NUM_PORTS,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_ip175c.c_ip175c_port_vlan_setup.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"cpuport != 5 not supported for IP175C\000"
	.align	2
.LC1:
	.ascii	"numports != 6 not supported for IP175C\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ip175c_port_vlan_setup, %function
ip175c_port_vlan_setup:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, fp, lr}
	add	fp, sp, #24
	sub	sp, sp, #20
	mov	r5, r0
	ldr	r0, [r0]
	ldr	r3, .L29
	sub	r0, r0, #5
	clz	r0, r0
	ldr	r2, [r3]
	lsr	r0, r0, #5
	add	r8, r2, r2, lsr #31
	lsl	r4, r2, #2
	asr	r8, r8, #1
	lsl	r8, r8, #2
	add	r1, r4, #7
	bic	r1, r1, #7
	add	r3, r8, #7
	sub	sp, sp, r1
	bic	r3, r3, #7
	add	r7, sp, #8
	sub	sp, sp, r3
	ldr	r3, .L29+4
	ldr	r1, .L29+8
	ldr	r3, [r3]
	str	r3, [fp, #-32]
	mov	r3,#0
	bl	KASSERT
	ldr	r0, [r5, #4]
	ldr	r1, .L29+12
	sub	r0, r0, #6
	clz	r0, r0
	lsr	r0, r0, #5
	bl	KASSERT
	mov	r2, r4
	mov	r0, r7
	mov	r1, #0
	bl	memset
	ldr	ip, [r5, #20]
	add	r6, sp, #8
	cmp	ip, #0
	ble	.L6
	ldr	r3, [r5, #8]
	ldr	r2, [r5, #16]
	sub	r3, r3, #4
	add	ip, r3, ip, lsl #2
	sub	r2, r2, #4
.L5:
	ldr	r1, [r3, #4]!
	ldr	r0, [r2, #4]!
	cmp	r3, ip
	str	r0, [r7, r1, lsl #2]
	bne	.L5
.L6:
	ldr	r0, [r5, #4]
	cmp	r0, #0
	ble	.L26
	mov	r1, #1
	ldr	r3, [r5]
	mov	r4, #0
	lsl	r1, r1, r3
	mvn	ip, r1
	sub	r2, r7, #4
.L10:
	ldr	r3, [r2, #4]!
	add	r4, r4, #1
	tst	r1, r3
	orrne	r3, r3, #128
	andne	r3, r3, ip
	strne	r3, [r2]
	cmp	r4, r0
	bne	.L10
	mov	r1, #0
	mov	r2, r8
	mov	r0, r6
	bl	memset
	cmp	r4, #1
	add	r4, r4, r4, lsr #31
	movgt	r3, #0
	asr	r4, r4, #1
	subgt	r1, r6, #4
	addgt	ip, r7, #4
	ble	.L8
.L14:
	ldr	r0, [r7, r3, lsl #3]
	ldr	r2, [ip, r3, lsl #3]
	add	r3, r3, #1
	orr	r2, r2, r0, lsl #8
	cmp	r3, r4
	str	r2, [r1, #4]!
	blt	.L14
.L8:
	mov	r2, #19
	mov	r1, #29
	ldr	r3, [r6]
	ldr	r0, [r5, #12]
	bl	ip17x_writephy
	cmp	r0, #0
	beq	.L27
.L1:
	ldr	r3, .L29+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-32]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L28
	sub	sp, fp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, fp, pc}
.L27:
	mov	r2, #20
	mov	r1, #29
	ldr	r3, [r6, #4]
	ldr	r0, [r5, #12]
	bl	ip17x_writephy
	cmp	r0, #0
	bne	.L1
	ldr	r4, [r6, #8]
	mov	r3, #65280
	str	r4, [sp]
	mov	r2, #21
	mov	r1, #29
	ldr	r0, [r5, #12]
	bl	ip17x_updatephy
	cmp	r0, #0
	bne	.L1
	str	r4, [sp]
	mov	r3, #255
	mov	r2, #18
	mov	r1, #30
	ldr	r0, [r5, #12]
	bl	ip17x_updatephy
	b	.L1
.L26:
	mov	r2, r8
	mov	r1, #0
	mov	r0, r6
	bl	memset
	b	.L8
.L28:
	bl	__stack_chk_fail
.L30:
	.align	2
.L29:
	.word	IP175X_NUM_PORTS
	.word	.LC2
	.word	.LC0
	.word	.LC1
	.size	ip175c_port_vlan_setup, .-ip175c_port_vlan_setup
	.comm	IP175X_NUM_PORTS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
