	.file	"783263.c"
	.intel_syntax noprefix
	.text
	.globl	uart0_fd
	.bss
	.align 4
	.type	uart0_fd, @object
	.size	uart0_fd, 4
uart0_fd:
	.zero	4
	.section	.rodata
.LC0:
	.string	" Fechando /dev/ttyS0..."
	.text
	.globl	ctrl_c
	.type	ctrl_c, @function
ctrl_c:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	DWORD PTR -4[rbp], edi
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	eax, DWORD PTR uart0_fd[rip]
	mov	edi, eax
	call	close@PLT
	mov	edi, -1
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	ctrl_c, .-ctrl_c
	.globl	f_media
	.type	f_media, @function
f_media:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	pxor	xmm0, xmm0
	movss	DWORD PTR -4[rbp], xmm0
	mov	DWORD PTR -8[rbp], 0
	jmp	.L3
.L4:
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	pxor	xmm0, xmm0
	cvtsi2ss	xmm0, eax
	movss	xmm1, DWORD PTR -4[rbp]
	addss	xmm0, xmm1
	movss	DWORD PTR -4[rbp], xmm0
	add	DWORD PTR -8[rbp], 1
.L3:
	cmp	DWORD PTR -8[rbp], 99
	jle	.L4
	movss	xmm0, DWORD PTR -4[rbp]
	movss	xmm1, DWORD PTR .LC2[rip]
	divss	xmm0, xmm1
	movss	DWORD PTR -4[rbp], xmm0
	movss	xmm0, DWORD PTR -4[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	f_media, .-f_media
	.section	.rodata
.LC3:
	.string	"/dev/ttyS0"
	.align 8
.LC4:
	.string	"Erro abrindo a UART. Garanta que ela nao esteja sendo usada por outra aplicacao."
.LC5:
	.string	"/dev/ttyS0 aberto."
.LC6:
	.string	"UART configurada:"
.LC7:
	.string	"stty -F /dev/ttyS0"
.LC8:
	.string	""
.LC9:
	.string	"Erro na leitura"
.LC10:
	.string	"Media %.2f\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 192
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rsi, ctrl_c[rip]
	mov	edi, 2
	call	signal@PLT
	mov	esi, 2
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR uart0_fd[rip], eax
	mov	eax, DWORD PTR uart0_fd[rip]
	cmp	eax, -1
	jne	.L7
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	eax, -1
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L14
	jmp	.L15
.L7:
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	eax, DWORD PTR uart0_fd[rip]
	lea	rdx, -176[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	tcgetattr@PLT
	mov	DWORD PTR -168[rbp], 2224
	mov	DWORD PTR -176[rbp], 0
	mov	DWORD PTR -172[rbp], 0
	mov	DWORD PTR -164[rbp], 0
	mov	BYTE PTR -154[rbp], 0
	mov	BYTE PTR -153[rbp], 1
	lea	rax, -176[rbp]
	mov	esi, 13
	mov	rdi, rax
	call	cfsetospeed@PLT
	lea	rax, -176[rbp]
	mov	esi, 13
	mov	rdi, rax
	call	cfsetispeed@PLT
	mov	eax, DWORD PTR uart0_fd[rip]
	mov	esi, 2
	mov	edi, eax
	call	tcflush@PLT
	mov	eax, DWORD PTR uart0_fd[rip]
	lea	rdx, -176[rbp]
	mov	esi, 0
	mov	edi, eax
	call	tcsetattr@PLT
	lea	rdi, .LC6[rip]
	call	puts@PLT
	lea	rdi, .LC7[rip]
	call	system@PLT
	lea	rdi, .LC8[rip]
	call	puts@PLT
.L13:
	mov	DWORD PTR -184[rbp], 0
	jmp	.L9
.L12:
	lea	rdx, -112[rbp]
	mov	eax, DWORD PTR -184[rbp]
	cdqe
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR uart0_fd[rip]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	test	rax, rax
	jle	.L10
	mov	eax, DWORD PTR uart0_fd[rip]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	lseek@PLT
	jmp	.L11
.L10:
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
.L11:
	add	DWORD PTR -184[rbp], 1
.L9:
	cmp	DWORD PTR -184[rbp], 99
	jle	.L12
	lea	rax, -112[rbp]
	mov	rdi, rax
	call	f_media
	movd	eax, xmm0
	mov	DWORD PTR -180[rbp], eax
	pxor	xmm1, xmm1
	cvtss2sd	xmm1, DWORD PTR -180[rbp]
	movq	rax, xmm1
	movq	xmm0, rax
	lea	rdi, .LC10[rip]
	mov	eax, 1
	call	printf@PLT
	jmp	.L13
.L15:
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.section	.rodata
	.align 4
.LC2:
	.long	1120403456
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"783263.c"
	.text
	.comm	uart0_fd,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	" Fechando /dev/ttyS0...\000"
	.text
	.align	2
	.global	ctrl_c
	.syntax unified
	.arm
	.fpu softvfp
	.type	ctrl_c, %function
ctrl_c:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r0, .L2
	bl	puts
	ldr	r3, .L2+4
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	mvn	r0, #0
	bl	exit
.L3:
	.align	2
.L2:
	.word	.LC0
	.word	uart0_fd
	.size	ctrl_c, .-ctrl_c
	.global	__aeabi_i2f
	.global	__aeabi_fadd
	.global	__aeabi_fdiv
	.align	2
	.global	f_media
	.syntax unified
	.arm
	.fpu softvfp
	.type	f_media, %function
f_media:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-8]	@ float
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L5
.L6:
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r0, r3
	bl	__aeabi_i2f
	mov	r3, r0
	mov	r1, r3
	ldr	r0, [fp, #-8]	@ float
	bl	__aeabi_fadd
	mov	r3, r0
	str	r3, [fp, #-8]	@ float
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L5:
	ldr	r3, [fp, #-12]
	cmp	r3, #99
	ble	.L6
	ldr	r1, .L8
	ldr	r0, [fp, #-8]	@ float
	bl	__aeabi_fdiv
	mov	r3, r0
	str	r3, [fp, #-8]	@ float
	ldr	r3, [fp, #-8]	@ float
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L9:
	.align	2
.L8:
	.word	1120403456
	.size	f_media, .-f_media
	.section	.rodata
	.align	2
.LC1:
	.ascii	"/dev/ttyS0\000"
	.align	2
.LC2:
	.ascii	"Erro abrindo a UART. Garanta que ela nao esteja sen"
	.ascii	"do usada por outra aplicacao.\000"
	.align	2
.LC3:
	.ascii	"/dev/ttyS0 aberto.\000"
	.align	2
.LC4:
	.ascii	"UART configurada:\000"
	.align	2
.LC5:
	.ascii	"stty -F /dev/ttyS0\000"
	.align	2
.LC6:
	.ascii	"\000"
	.align	2
.LC7:
	.ascii	"Erro na leitura\000"
	.global	__aeabi_f2d
	.align	2
.LC8:
	.ascii	"Media %.2f\012\000"
	.align	2
.LC9:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 176
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #176
	ldr	r3, .L20
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r1, .L20+4
	mov	r0, #2
	bl	signal
	mov	r1, #2
	ldr	r0, .L20+8
	bl	open
	mov	r3, r0
	ldr	r2, .L20+12
	str	r3, [r2]
	ldr	r3, .L20+12
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L11
	ldr	r0, .L20+16
	bl	puts
	mvn	r3, #0
	ldr	r2, .L20
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L18
	b	.L19
.L11:
	ldr	r0, .L20+20
	bl	puts
	ldr	r3, .L20+12
	ldr	r3, [r3]
	sub	r2, fp, #168
	mov	r1, r2
	mov	r0, r3
	bl	tcgetattr
	mov	r3, #2224
	str	r3, [fp, #-160]
	mov	r3, #0
	str	r3, [fp, #-168]
	mov	r3, #0
	str	r3, [fp, #-164]
	mov	r3, #0
	str	r3, [fp, #-156]
	mov	r3, #0
	strb	r3, [fp, #-146]
	mov	r3, #1
	strb	r3, [fp, #-145]
	sub	r3, fp, #168
	mov	r1, #13
	mov	r0, r3
	bl	cfsetospeed
	sub	r3, fp, #168
	mov	r1, #13
	mov	r0, r3
	bl	cfsetispeed
	ldr	r3, .L20+12
	ldr	r3, [r3]
	mov	r1, #2
	mov	r0, r3
	bl	tcflush
	ldr	r3, .L20+12
	ldr	r3, [r3]
	sub	r2, fp, #168
	mov	r1, #0
	mov	r0, r3
	bl	tcsetattr
	ldr	r0, .L20+24
	bl	puts
	ldr	r0, .L20+28
	bl	system
	ldr	r0, .L20+32
	bl	puts
.L17:
	mov	r3, #0
	str	r3, [fp, #-176]
	b	.L13
.L16:
	ldr	r3, .L20+12
	ldr	r0, [r3]
	sub	r2, fp, #108
	ldr	r3, [fp, #-176]
	add	r3, r2, r3
	mov	r2, #1
	mov	r1, r3
	bl	read
	mov	r3, r0
	cmp	r3, #0
	ble	.L14
	ldr	r3, .L20+12
	ldr	r3, [r3]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	lseek
	b	.L15
.L14:
	ldr	r0, .L20+36
	bl	printf
.L15:
	ldr	r3, [fp, #-176]
	add	r3, r3, #1
	str	r3, [fp, #-176]
.L13:
	ldr	r3, [fp, #-176]
	cmp	r3, #99
	ble	.L16
	sub	r3, fp, #108
	mov	r0, r3
	bl	f_media
	str	r0, [fp, #-172]	@ float
	ldr	r0, [fp, #-172]	@ float
	bl	__aeabi_f2d
	mov	r2, r0
	mov	r3, r1
	ldr	r0, .L20+40
	bl	printf
	b	.L17
.L19:
	bl	__stack_chk_fail
.L18:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC9
	.word	ctrl_c
	.word	.LC1
	.word	uart0_fd
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
