	.file	"extr_qca8k.c_qca8k_fdb_access.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	qca8k_fdb_access, @function
qca8k_fdb_access:
.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	ebx, esi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	r8d, DWORD PTR QCA8K_ATU_FUNC_BUSY[rip]
	or	r8d, esi
	test	edx, edx
	js	.L2
	mov	ecx, DWORD PTR QCA8K_ATU_FUNC_PORT_S[rip]
	and	edx, DWORD PTR QCA8K_ATU_FUNC_PORT_M[rip]
	sal	edx, cl
	or	edx, DWORD PTR QCA8K_ATU_FUNC_PORT_EN[rip]
	or	r8d, edx
.L2:
	mov	esi, DWORD PTR QCA8K_REG_ATU_FUNC[rip]
	mov	edx, r8d
	mov	rdi, rbp
	call	qca8k_write@PLT
	mov	edx, DWORD PTR QCA8K_ATU_FUNC_BUSY[rip]
	mov	esi, DWORD PTR QCA8K_REG_ATU_FUNC[rip]
	mov	rdi, rbp
	call	qca8k_busy_wait@PLT
	test	rax, rax
	jne	.L4
	cmp	DWORD PTR QCA8K_FDB_LOAD[rip], ebx
	je	.L8
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	mov	esi, DWORD PTR QCA8K_REG_ATU_FUNC[rip]
	mov	rdi, rbp
	call	qca8k_read@PLT
	test	DWORD PTR QCA8K_ATU_FUNC_FULL[rip], eax
	setne	al
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movzx	eax, al
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	neg	eax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	eax, -1
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	qca8k_fdb_access, .-qca8k_fdb_access
	.comm	QCA8K_REG_ATU_FUNC,4,4
	.comm	QCA8K_FDB_LOAD,4,4
	.comm	QCA8K_ATU_FUNC_PORT_S,4,4
	.comm	QCA8K_ATU_FUNC_PORT_M,4,4
	.comm	QCA8K_ATU_FUNC_PORT_EN,4,4
	.comm	QCA8K_ATU_FUNC_FULL,4,4
	.comm	QCA8K_ATU_FUNC_BUSY,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_qca8k.c_qca8k_fdb_access.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	qca8k_fdb_access, %function
qca8k_fdb_access:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r7, .L7
	subs	r3, r2, #0
	ldr	r2, [r7]
	mov	r5, r1
	mov	r4, r0
	orr	r2, r1, r2
	blt	.L2
	ldr	ip, .L7+4
	ldr	r0, .L7+8
	ldr	r1, .L7+12
	ldr	ip, [ip]
	ldr	r0, [r0]
	ldr	r1, [r1]
	and	r3, r3, ip
	orr	r3, r1, r3, lsl r0
	orr	r2, r2, r3
.L2:
	ldr	r6, .L7+16
	mov	r0, r4
	ldr	r1, [r6]
	bl	qca8k_write
	mov	r0, r4
	ldr	r2, [r7]
	ldr	r1, [r6]
	bl	qca8k_busy_wait
	cmp	r0, #0
	bne	.L4
	ldr	r3, .L7+20
	ldr	r3, [r3]
	cmp	r3, r5
	popne	{r4, r5, r6, r7, r8, pc}
	mov	r0, r4
	ldr	r1, [r6]
	bl	qca8k_read
	ldr	r3, .L7+24
	ldr	r3, [r3]
	tst	r0, r3
	mvnne	r0, #0
	moveq	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L4:
	mvn	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L8:
	.align	2
.L7:
	.word	QCA8K_ATU_FUNC_BUSY
	.word	QCA8K_ATU_FUNC_PORT_M
	.word	QCA8K_ATU_FUNC_PORT_S
	.word	QCA8K_ATU_FUNC_PORT_EN
	.word	QCA8K_REG_ATU_FUNC
	.word	QCA8K_FDB_LOAD
	.word	QCA8K_ATU_FUNC_FULL
	.size	qca8k_fdb_access, .-qca8k_fdb_access
	.comm	QCA8K_REG_ATU_FUNC,4,4
	.comm	QCA8K_FDB_LOAD,4,4
	.comm	QCA8K_ATU_FUNC_PORT_S,4,4
	.comm	QCA8K_ATU_FUNC_PORT_M,4,4
	.comm	QCA8K_ATU_FUNC_PORT_EN,4,4
	.comm	QCA8K_ATU_FUNC_FULL,4,4
	.comm	QCA8K_ATU_FUNC_BUSY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
