	.file	"extr_e1000_main.c_e1000_82547_fifo_workaround.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	e1000_82547_fifo_workaround, @function
e1000_82547_fifo_workaround:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r8, rsi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	r12, QWORD PTR [rdi]
	mov	r13, QWORD PTR 8[rdi]
	mov	rsi, QWORD PTR E1000_FIFO_HDR[rip]
	mov	rdi, QWORD PTR [r8]
	add	rdi, rsi
	call	ALIGN@PLT
	mov	rbp, rax
	mov	rax, QWORD PTR HALF_DUPLEX[rip]
	cmp	QWORD PTR 16[rbx], rax
	je	.L8
.L2:
	mov	rax, QWORD PTR 8[rbx]
	mov	rcx, QWORD PTR [rbx]
	xor	r14d, r14d
	add	rax, rbp
	mov	rdx, rax
	sub	rdx, rcx
	cmp	rax, rcx
	cmovge	rax, rdx
	mov	QWORD PTR 8[rbx], rax
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r14d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	lea	r15, 24[rbx]
	mov	r14d, 1
	mov	rdi, r15
	call	atomic_read@PLT
	test	rax, rax
	jne	.L1
	sub	r12, r13
	add	r12, QWORD PTR E1000_82547_PAD_LEN[rip]
	cmp	r12, rbp
	jg	.L2
	mov	esi, 1
	mov	rdi, r15
	call	atomic_set@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	e1000_82547_fifo_workaround, .-e1000_82547_fifo_workaround
	.comm	HALF_DUPLEX,8,8
	.comm	E1000_FIFO_HDR,8,8
	.comm	E1000_82547_PAD_LEN,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_e1000_main.c_e1000_82547_fifo_workaround.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	e1000_82547_fifo_workaround, %function
e1000_82547_fifo_workaround:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r0
	ldr	r3, .L9
	ldr	r0, [r1]
	ldr	r1, [r3]
	ldr	r6, [r4]
	add	r0, r1, r0
	ldr	r7, [r4, #4]
	bl	ALIGN
	ldr	r3, .L9+4
	ldr	r2, [r4, #8]
	ldr	r3, [r3]
	mov	r5, r0
	cmp	r2, r3
	beq	.L8
.L2:
	ldr	r0, [r4, #4]
	ldr	r3, [r4]
	add	r0, r5, r0
	cmp	r0, r3
	str	r0, [r4, #4]
	blt	.L5
	sub	r0, r0, r3
	str	r0, [r4, #4]
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L5:
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L8:
	add	r8, r4, #12
	mov	r0, r8
	bl	atomic_read
	cmp	r0, #0
	bne	.L4
	ldr	r2, .L9+8
	sub	r3, r6, r7
	ldr	r2, [r2]
	add	r3, r3, r2
	cmp	r3, r5
	bgt	.L2
	mov	r0, r8
	mov	r1, #1
	bl	atomic_set
	mov	r0, #1
	pop	{r4, r5, r6, r7, r8, pc}
.L4:
	mov	r0, #1
	pop	{r4, r5, r6, r7, r8, pc}
.L10:
	.align	2
.L9:
	.word	E1000_FIFO_HDR
	.word	HALF_DUPLEX
	.word	E1000_82547_PAD_LEN
	.size	e1000_82547_fifo_workaround, .-e1000_82547_fifo_workaround
	.comm	HALF_DUPLEX,4,4
	.comm	E1000_FIFO_HDR,4,4
	.comm	E1000_82547_PAD_LEN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
