	.file	"extr_serial.c_serial_read.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	serial_read, @function
serial_read:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13d, esi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12d, ecx
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdx
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, r9
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	get_serial_info@PLT
	mov	ecx, DWORD PTR [rax]
	mov	esi, DWORD PTR 4[rax]
	mov	rdx, QWORD PTR 16[rax]
	mov	edi, ecx
	or	edi, esi
	je	.L2
	imul	ecx, r12d
	lea	ecx, 99[rsi+rcx]
	mov	rsi, QWORD PTR VTIME[rip]
	movsx	rax, ecx
	sar	ecx, 31
	imul	rax, rax, 1374389535
	sar	rax, 37
	sub	eax, ecx
	mov	rcx, QWORD PTR [rdx]
	cdqe
	lea	rdi, [rcx+rsi*8]
	test	rax, rax
	je	.L9
.L4:
	mov	QWORD PTR [rdi], rax
	mov	rax, QWORD PTR VMIN[rip]
	mov	QWORD PTR [rcx+rax*8], 1
.L5:
	mov	esi, DWORD PTR TCSANOW[rip]
	mov	edi, r13d
	call	tcsetattr@PLT
	mov	edx, r12d
	mov	rsi, rbp
	mov	edi, r13d
	call	read@PLT
	mov	DWORD PTR [rbx], eax
	mov	eax, DWORD PTR STATUS_SUCCESS[rip]
	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
.L2:
	.cfi_restore_state
	mov	rcx, QWORD PTR [rdx]
	mov	rsi, QWORD PTR VTIME[rip]
	mov	eax, DWORD PTR 8[rax]
	lea	rdi, [rcx+rsi*8]
	test	eax, eax
	je	.L6
	imul	eax, r12d
	lea	esi, 99[rax]
	movsx	rax, esi
	sar	esi, 31
	imul	rax, rax, 1374389535
	sar	rax, 37
	sub	eax, esi
	cdqe
	test	rax, rax
	jne	.L4
.L9:
	mov	QWORD PTR [rdi], 0
	mov	rax, QWORD PTR VMIN[rip]
	mov	QWORD PTR [rcx+rax*8], 0
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	mov	eax, 90
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	serial_read, .-serial_read
	.comm	VTIME,8,8
	.comm	VMIN,8,8
	.comm	TIOCINQ,4,4
	.comm	TCSANOW,4,4
	.comm	STATUS_SUCCESS,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_serial.c_serial_read.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	serial_read, %function
serial_read:
	@ args = 8, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r6, [sp, #28]
	mov	r5, r2
	mov	r4, r3
	mov	r7, r1
	bl	get_serial_info
	ldr	ip, [r0]
	ldr	r3, [r0, #4]
	ldr	r2, [r0, #12]
	orrs	r1, ip, r3
	beq	.L2
	mla	ip, r4, ip, r3
	ldr	r0, .L10
	add	ip, ip, #99
	smull	r3, r0, ip, r0
	ldr	r3, .L10+4
	asr	ip, ip, #31
	ldr	r1, [r2]
	ldr	r3, [r3]
	rsb	r0, ip, r0, asr #5
	cmp	r0, #0
	add	r3, r1, r3, lsl #2
	beq	.L9
.L4:
	mov	ip, #1
	str	r0, [r3]
	ldr	r3, .L10+8
	ldr	r3, [r3]
	str	ip, [r1, r3, lsl #2]
.L5:
	ldr	r3, .L10+12
	mov	r0, r7
	ldr	r1, [r3]
	bl	tcsetattr
	mov	r2, r4
	mov	r1, r5
	mov	r0, r7
	bl	read
	ldr	r3, .L10+16
	str	r0, [r6]
	ldr	r0, [r3]
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	ldr	r3, .L10+4
	ldr	r0, [r0, #8]
	ldr	r3, [r3]
	ldr	r1, [r2]
	cmp	r0, #0
	add	r3, r1, r3, lsl #2
	beq	.L6
	mul	r0, r4, r0
	ldr	ip, .L10
	add	r0, r0, #99
	smull	lr, ip, r0, ip
	asr	r0, r0, #31
	rsb	r0, r0, ip, asr #5
	cmp	r0, #0
	bne	.L4
.L9:
	ldr	ip, .L10+8
	str	r0, [r3]
	ldr	r3, [ip]
	str	r0, [r1, r3, lsl #2]
	b	.L5
.L6:
	mov	r0, #90
	b	.L4
.L11:
	.align	2
.L10:
	.word	1374389535
	.word	VTIME
	.word	VMIN
	.word	TCSANOW
	.word	STATUS_SUCCESS
	.size	serial_read, .-serial_read
	.comm	VTIME,4,4
	.comm	VMIN,4,4
	.comm	TIOCINQ,4,4
	.comm	TCSANOW,4,4
	.comm	STATUS_SUCCESS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
