	.file	"extr_fifo.c_fifo_write.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	fifo_write
	.type	fifo_write, @function
fifo_write:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	ebp, ecx
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	fifo_remaining@PLT
	cmp	rax, r12
	jnb	.L9
	mov	eax, 1
	test	DWORD PTR FIFO_OVERWRITE[rip], ebp
	jne	.L10
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	mov	rdi, rbx
	call	fifo_remaining@PLT
	mov	rsi, QWORD PTR 8[rbx]
	xor	edx, edx
	mov	rcx, rax
	mov	rax, QWORD PTR [rbx]
	add	rax, r12
	sub	rax, rcx
	div	rsi
	mov	rax, QWORD PTR 16[rbx]
	add	rax, rcx
	sub	rax, r12
	mov	QWORD PTR 16[rbx], rax
	mov	QWORD PTR [rbx], rdx
.L3:
	add	rax, rdx
	xor	edx, edx
	div	rsi
	mov	rax, QWORD PTR 24[rbx]
	sub	rsi, rdx
	lea	rdi, [rax+rdx*4]
	cmp	r12, rsi
	cmovbe	rsi, r12
	mov	rbp, rsi
	mov	rdx, rsi
	mov	rsi, r13
	call	memcpy@PLT
	mov	rdi, QWORD PTR 24[rbx]
	mov	rdx, r12
	lea	rsi, 0[r13+rbp]
	sub	rdx, rbp
	call	memcpy@PLT
	add	QWORD PTR 16[rbx], r12
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	mov	rdx, QWORD PTR [rbx]
	mov	rax, QWORD PTR 16[rbx]
	mov	rsi, QWORD PTR 8[rbx]
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	fifo_write, .-fifo_write
	.comm	FIFO_OVERWRITE,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_fifo.c_fifo_write.c"
	.text
	.global	__aeabi_uidivmod
	.align	2
	.global	fifo_write
	.syntax unified
	.arm
	.fpu softvfp
	.type	fifo_write, %function
fifo_write:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r2
	mov	r7, r1
	mov	r6, r3
	mov	r4, r0
	bl	fifo_remaining
	cmp	r0, r5
	bcs	.L8
	ldr	r3, .L10
	ldr	r3, [r3]
	tst	r6, r3
	bne	.L9
	mov	r0, #1
	pop	{r4, r5, r6, r7, r8, pc}
.L9:
	mov	r0, r4
	bl	fifo_remaining
	mov	r8, r0
	ldm	r4, {r0, r6}
	add	r0, r5, r0
	mov	r1, r6
	sub	r0, r0, r8
	bl	__aeabi_uidivmod
	ldr	r3, [r4, #8]
	str	r1, [r4]
	sub	r3, r3, r5
	add	r0, r3, r8
	str	r0, [r4, #8]
.L3:
	add	r0, r1, r0
	mov	r1, r6
	bl	__aeabi_uidivmod
	sub	r6, r6, r1
	cmp	r5, r6
	movcc	r6, r5
	ldr	r0, [r4, #12]
	mov	r2, r6
	add	r0, r0, r1, lsl #2
	mov	r1, r7
	bl	memcpy
	sub	r2, r5, r6
	ldr	r0, [r4, #12]
	add	r1, r7, r6
	bl	memcpy
	ldr	r2, [r4, #8]
	mov	r0, #0
	add	r5, r2, r5
	str	r5, [r4, #8]
	pop	{r4, r5, r6, r7, r8, pc}
.L8:
	ldr	r1, [r4]
	ldr	r0, [r4, #8]
	ldr	r6, [r4, #4]
	b	.L3
.L11:
	.align	2
.L10:
	.word	FIFO_OVERWRITE
	.size	fifo_write, .-fifo_write
	.comm	FIFO_OVERWRITE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
