	.file	"extr_ocelot.c_ocelot_mact_read.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ocelot_mact_read, @function
ocelot_mact_read:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r14
	.cfi_offset 14, -24
	mov	r14d, edx
	push	r13
	push	r12
	.cfi_offset 13, -32
	.cfi_offset 12, -40
	mov	r12, rcx
	push	rbx
	.cfi_offset 3, -48
	mov	rbx, rdi
	sub	rsp, 16
	mov	r13, QWORD PTR 8[rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -40[rbp], rax
	xor	eax, eax
	movsx	rax, DWORD PTR ETH_ALEN[rip]
	mov	rcx, rsp
	add	rax, 15
	mov	rdx, rax
	and	rax, -4096
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L3
.L15:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L15
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L16
.L4:
	mov	edx, esi
	mov	esi, DWORD PTR ANA_TABLES_MACTINDX_M_INDEX[rip]
	mov	rdi, r13
	call	ocelot_field_write@PLT
	mov	esi, DWORD PTR ANA_TABLES_MACTINDX_BUCKET[rip]
	mov	edx, r14d
	mov	rdi, r13
	call	ocelot_field_write@PLT
	mov	edi, DWORD PTR MACACCESS_CMD_READ[rip]
	mov	r14d, DWORD PTR ANA_TABLES_MACACCESS[rip]
	call	ANA_TABLES_MACACCESS_MAC_TABLE_CMD@PLT
	mov	rdi, r13
	mov	edx, r14d
	mov	esi, eax
	call	ocelot_write@PLT
	mov	rdi, r13
	call	ocelot_mact_wait_for_completion@PLT
	test	rax, rax
	je	.L5
	mov	eax, DWORD PTR ETIMEDOUT[rip]
	neg	eax
.L1:
	mov	rbx, QWORD PTR -40[rbp]
	xor	rbx, QWORD PTR fs:40
	jne	.L17
	lea	rsp, -32[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	mov	esi, DWORD PTR ANA_TABLES_MACACCESS[rip]
	mov	rdi, r13
	call	ocelot_read@PLT
	test	DWORD PTR ANA_TABLES_MACACCESS_VALID[rip], eax
	je	.L8
	and	eax, DWORD PTR ANA_TABLES_MACACCESS_DEST_IDX_M[rip]
	sar	eax, 3
	cmp	DWORD PTR [rbx], eax
	je	.L18
.L8:
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L16:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L18:
	mov	esi, DWORD PTR ANA_TABLES_MACLDATA[rip]
	mov	rdi, r13
	call	ocelot_read@PLT
	mov	esi, DWORD PTR ANA_TABLES_MACHDATA[rip]
	mov	rdi, r13
	mov	ebx, eax
	call	ocelot_read@PLT
	mov	edi, DWORD PTR 4[r12]
	mov	rsi, rsp
	bswap	ebx
	mov	edx, eax
	sar	eax, 16
	mov	DWORD PTR 2[rsp], ebx
	and	eax, 4095
	rol	dx, 8
	mov	DWORD PTR [r12], eax
	mov	WORD PTR [rsp], dx
	call	ether_addr_copy@PLT
	xor	eax, eax
	jmp	.L1
.L17:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	ocelot_mact_read, .-ocelot_mact_read
	.comm	MACACCESS_CMD_READ,4,4
	.comm	ETIMEDOUT,4,4
	.comm	ETH_ALEN,4,4
	.comm	EINVAL,4,4
	.comm	ANA_TABLES_MACTINDX_M_INDEX,4,4
	.comm	ANA_TABLES_MACTINDX_BUCKET,4,4
	.comm	ANA_TABLES_MACLDATA,4,4
	.comm	ANA_TABLES_MACHDATA,4,4
	.comm	ANA_TABLES_MACACCESS_VALID,4,4
	.comm	ANA_TABLES_MACACCESS_DEST_IDX_M,4,4
	.comm	ANA_TABLES_MACACCESS,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_ocelot.c_ocelot_mact_read.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ocelot_mact_read, %function
ocelot_mact_read:
	@ 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, #12
	mov	r4, r2
	ldr	r2, .L11
	ldr	lr, .L11+4
	ldr	ip, [r2]
	ldr	r5, [r0, #4]
	add	ip, ip, #7
	bic	ip, ip, #7
	mov	r7, r3
	ldr	r3, .L11+8
	sub	sp, sp, ip
	mov	r2, r1
	mov	r6, r0
	ldr	r1, [lr]
	mov	r0, r5
	ldr	r3, [r3]
	str	r3, [fp, #-32]
	mov	r3,#0
	bl	ocelot_field_write
	ldr	r3, .L11+12
	mov	r2, r4
	ldr	r1, [r3]
	mov	r0, r5
	bl	ocelot_field_write
	ldr	r3, .L11+16
	ldr	r8, .L11+20
	ldr	r0, [r3]
	bl	ANA_TABLES_MACACCESS_MAC_TABLE_CMD
	ldr	r2, [r8]
	mov	r1, r0
	mov	r0, r5
	bl	ocelot_write
	mov	r0, r5
	bl	ocelot_mact_wait_for_completion
	subs	r4, r0, #0
	beq	.L2
	ldr	r3, .L11+24
	ldr	r0, [r3]
	rsb	r4, r0, #0
.L1:
	ldr	r3, .L11+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-32]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L9
	mov	r0, r4
	sub	sp, fp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, fp, pc}
.L2:
	mov	r0, r5
	ldr	r1, [r8]
	bl	ocelot_read
	ldr	r3, .L11+28
	ldr	r3, [r3]
	tst	r0, r3
	beq	.L5
	ldr	r2, .L11+32
	ldr	r3, [r6]
	ldr	r2, [r2]
	and	r0, r0, r2
	cmp	r3, r0, asr #3
	beq	.L10
.L5:
	ldr	r3, .L11+36
	ldr	r0, [r3]
	rsb	r4, r0, #0
	b	.L1
.L10:
	ldr	r3, .L11+40
	mov	r0, r5
	ldr	r1, [r3]
	bl	ocelot_read
	mov	r3, r0
	ldr	r2, .L11+44
	mov	r0, r5
	ldr	r1, [r2]
	mov	r5, r3
	bl	ocelot_read
	mov	r3, r0
	ldr	r2, .L11+48
	asr	lr, r0, #8
	and	r2, r2, r0, asr #16
	str	r2, [r7]
	lsr	ip, r5, #24
	asr	r2, r5, #16
	strb	r3, [sp, #1]
	mov	r1, sp
	asr	r3, r5, #8
	ldr	r0, [r7, #4]
	strb	r5, [sp, #5]
	strb	lr, [sp]
	strb	ip, [sp, #2]
	strb	r2, [sp, #3]
	strb	r3, [sp, #4]
	bl	ether_addr_copy
	b	.L1
.L9:
	bl	__stack_chk_fail
.L12:
	.align	2
.L11:
	.word	ETH_ALEN
	.word	ANA_TABLES_MACTINDX_M_INDEX
	.word	.LC0
	.word	ANA_TABLES_MACTINDX_BUCKET
	.word	MACACCESS_CMD_READ
	.word	ANA_TABLES_MACACCESS
	.word	ETIMEDOUT
	.word	ANA_TABLES_MACACCESS_VALID
	.word	ANA_TABLES_MACACCESS_DEST_IDX_M
	.word	EINVAL
	.word	ANA_TABLES_MACLDATA
	.word	ANA_TABLES_MACHDATA
	.word	4095
	.size	ocelot_mact_read, .-ocelot_mact_read
	.comm	MACACCESS_CMD_READ,4,4
	.comm	ETIMEDOUT,4,4
	.comm	ETH_ALEN,4,4
	.comm	EINVAL,4,4
	.comm	ANA_TABLES_MACTINDX_M_INDEX,4,4
	.comm	ANA_TABLES_MACTINDX_BUCKET,4,4
	.comm	ANA_TABLES_MACLDATA,4,4
	.comm	ANA_TABLES_MACHDATA,4,4
	.comm	ANA_TABLES_MACACCESS_VALID,4,4
	.comm	ANA_TABLES_MACACCESS_DEST_IDX_M,4,4
	.comm	ANA_TABLES_MACACCESS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
