	.file	"extr_tty_outq.c_ttyoutq_write.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	ttyoutq_write
	.type	ttyoutq_write, @function
ttyoutq_write:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	QWORD PTR 8[rsp], rsi
	test	rdx, rdx
	je	.L8
	mov	ecx, DWORD PTR [rdi]
	mov	r14, rdi
	mov	r15, rdx
	mov	r12, rsi
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	mov	r13, QWORD PTR 16[r14]
	test	edx, edx
	jne	.L5
	mov	r13, QWORD PTR 8[r13]
	test	r13, r13
	je	.L11
	mov	QWORD PTR 16[r14], r13
.L5:
	sub	esi, ebp
	mov	rdi, r15
	call	MIN@PLT
	xor	edi, edi
	test	rax, rax
	mov	rbx, rax
	setne	dil
	call	MPASS@PLT
	mov	rsi, r12
	mov	edi, ebp
	mov	rdx, rbx
	add	rdi, QWORD PTR 0[r13]
	add	r12, rbx
	call	memcpy@PLT
	mov	ecx, DWORD PTR [r14]
	add	ecx, ebx
	mov	DWORD PTR [r14], ecx
	sub	r15, rbx
	je	.L11
.L7:
	mov	esi, DWORD PTR TTYOUTQ_DATASIZE[rip]
	mov	eax, ecx
	xor	edx, edx
	div	esi
	mov	ebp, edx
	test	ecx, ecx
	jne	.L3
	xor	edi, edi
	cmp	QWORD PTR 8[r14], 0
	sete	dil
	call	MPASS@PLT
	mov	r13, QWORD PTR 24[r14]
	test	r13, r13
	je	.L11
	mov	QWORD PTR 16[r14], r13
	mov	esi, DWORD PTR TTYOUTQ_DATASIZE[rip]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rax, r12
	sub	rax, QWORD PTR 8[rsp]
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L8:
	.cfi_restore_state
	xor	eax, eax
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	ttyoutq_write, .-ttyoutq_write
	.comm	TTYOUTQ_DATASIZE,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_tty_outq.c_ttyoutq_write.c"
	.text
	.global	__aeabi_uidivmod
	.align	2
	.global	ttyoutq_write
	.syntax unified
	.arm
	.fpu softvfp
	.type	ttyoutq_write, %function
ttyoutq_write:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	subs	r6, r2, #0
	beq	.L8
	mov	r10, r0
	mov	r9, r1
	mov	r7, r1
	ldr	r5, [r0]
	ldr	r8, .L14
	b	.L7
.L3:
	cmp	r1, #0
	ldr	fp, [r10, #8]
	bne	.L5
	ldr	fp, [fp, #4]
	cmp	fp, #0
	beq	.L12
	str	fp, [r10, #8]
.L5:
	sub	r1, r4, r5
	mov	r0, r6
	bl	MIN
	mov	r4, r0
	subs	r0, r0, #0
	movne	r0, #1
	bl	MPASS
	ldr	r0, [fp]
	mov	r1, r7
	add	r0, r5, r0
	mov	r2, r4
	bl	memcpy
	ldr	r5, [r10]
	subs	r6, r6, r4
	add	r5, r4, r5
	add	r7, r7, r4
	str	r5, [r10]
	beq	.L12
.L7:
	ldr	r4, [r8]
	mov	r0, r5
	mov	r1, r4
	bl	__aeabi_uidivmod
	cmp	r5, #0
	mov	r5, r1
	bne	.L3
	ldr	r0, [r10, #4]
	clz	r0, r0
	lsr	r0, r0, #5
	bl	MPASS
	ldr	fp, [r10, #12]
	cmp	fp, #0
	ldrne	r4, [r8]
	strne	fp, [r10, #8]
	bne	.L5
.L12:
	sub	r0, r7, r9
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L8:
	mov	r0, r6
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L15:
	.align	2
.L14:
	.word	TTYOUTQ_DATASIZE
	.size	ttyoutq_write, .-ttyoutq_write
	.comm	TTYOUTQ_DATASIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
