	.file	"735903.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"Digite o nome do arquivo a ser aberto: "
.LC1:
	.string	"rb"
	.align 8
.LC2:
	.string	"Erro na abertura do arquivo -- programa abortado"
.LC3:
	.string	"Registro %d\n"
.LC4:
	.string	"|"
.LC5:
	.string	"\tCampo %d: %s\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 368
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -336[rbp]
	mov	esi, 50
	mov	rdi, rax
	call	input
	lea	rax, -336[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -344[rbp], rax
	cmp	QWORD PTR -344[rbp], 0
	jne	.L2
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	DWORD PTR -360[rbp], 0
	lea	rcx, -272[rbp]
	mov	rax, QWORD PTR -344[rbp]
	mov	edx, 256
	mov	rsi, rcx
	mov	rdi, rax
	call	leia_reg
	mov	WORD PTR -362[rbp], ax
	jmp	.L3
.L6:
	add	DWORD PTR -360[rbp], 1
	mov	eax, DWORD PTR -360[rbp]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -356[rbp], 0
	lea	rax, -272[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	strtok@PLT
	mov	QWORD PTR -352[rbp], rax
	jmp	.L4
.L5:
	add	DWORD PTR -356[rbp], 1
	mov	rdx, QWORD PTR -352[rbp]
	mov	eax, DWORD PTR -356[rbp]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rsi, .LC4[rip]
	mov	edi, 0
	call	strtok@PLT
	mov	QWORD PTR -352[rbp], rax
.L4:
	cmp	QWORD PTR -352[rbp], 0
	jne	.L5
	mov	edi, 10
	call	putchar@PLT
	lea	rcx, -272[rbp]
	mov	rax, QWORD PTR -344[rbp]
	mov	edx, 256
	mov	rsi, rcx
	mov	rdi, rax
	call	leia_reg
	mov	WORD PTR -362[rbp], ax
.L3:
	cmp	WORD PTR -362[rbp], 0
	jg	.L6
	mov	rax, QWORD PTR -344[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC6:
	.string	"Buffer overflow"
	.text
	.globl	leia_reg
	.type	leia_reg, @function
leia_reg:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -36[rbp], edx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rdx, QWORD PTR -24[rbp]
	lea	rax, -10[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 2
	mov	rdi, rax
	call	fread@PLT
	test	rax, rax
	jne	.L10
	mov	eax, 0
	jmp	.L13
.L10:
	movzx	eax, WORD PTR -10[rbp]
	cwde
	cmp	DWORD PTR -36[rbp], eax
	jle	.L12
	movzx	eax, WORD PTR -10[rbp]
	movsx	rdx, ax
	mov	rcx, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR -32[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	WORD PTR -10[rbp], ax
	movzx	eax, WORD PTR -10[rbp]
	movsx	rdx, ax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	movzx	eax, WORD PTR -10[rbp]
	jmp	.L13
.L12:
	lea	rdi, .LC6[rip]
	call	puts@PLT
	mov	eax, 0
.L13:
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	leia_reg, .-leia_reg
	.globl	input
	.type	input, @function
input:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -4[rbp], 0
	call	getchar@PLT
	mov	BYTE PTR -5[rbp], al
	jmp	.L16
.L18:
	cmp	DWORD PTR -28[rbp], 1
	jle	.L17
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rdx, rax
	movzx	eax, BYTE PTR -5[rbp]
	mov	BYTE PTR [rdx], al
	add	DWORD PTR -4[rbp], 1
	sub	DWORD PTR -28[rbp], 1
.L17:
	call	getchar@PLT
	mov	BYTE PTR -5[rbp], al
.L16:
	cmp	BYTE PTR -5[rbp], 10
	jne	.L18
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	mov	eax, DWORD PTR -4[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	input, .-input
	.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	"735903.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Digite o nome do arquivo a ser aberto: \000"
	.align	2
.LC1:
	.ascii	"rb\000"
	.align	2
.LC2:
	.ascii	"Erro na abertura do arquivo -- programa abortado\000"
	.align	2
.LC3:
	.ascii	"Registro %d\012\000"
	.align	2
.LC4:
	.ascii	"|\000"
	.align	2
.LC5:
	.ascii	"\011Campo %d: %s\012\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 336
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #340
	ldr	r3, .L9
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r0, .L9+4
	bl	printf
	sub	r3, fp, #324
	mov	r1, #50
	mov	r0, r3
	bl	input
	sub	r3, fp, #324
	ldr	r1, .L9+8
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-328]
	ldr	r3, [fp, #-328]
	cmp	r3, #0
	bne	.L2
	ldr	r0, .L9+12
	bl	puts
	mov	r0, #1
	bl	exit
.L2:
	mov	r3, #0
	str	r3, [fp, #-340]
	sub	r3, fp, #12
	sub	r4, r3, #328
	sub	r4, r4, #2
	sub	r3, fp, #272
	mov	r2, #256
	mov	r1, r3
	ldr	r0, [fp, #-328]
	bl	leia_reg
	mov	r3, r0
	strh	r3, [r4]	@ movhi
	b	.L3
.L6:
	ldr	r3, [fp, #-340]
	add	r3, r3, #1
	str	r3, [fp, #-340]
	ldr	r1, [fp, #-340]
	ldr	r0, .L9+16
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-336]
	sub	r3, fp, #272
	ldr	r1, .L9+20
	mov	r0, r3
	bl	strtok
	str	r0, [fp, #-332]
	b	.L4
.L5:
	ldr	r3, [fp, #-336]
	add	r3, r3, #1
	str	r3, [fp, #-336]
	ldr	r2, [fp, #-332]
	ldr	r1, [fp, #-336]
	ldr	r0, .L9+24
	bl	printf
	ldr	r1, .L9+20
	mov	r0, #0
	bl	strtok
	str	r0, [fp, #-332]
.L4:
	ldr	r3, [fp, #-332]
	cmp	r3, #0
	bne	.L5
	mov	r0, #10
	bl	putchar
	sub	r3, fp, #12
	sub	r4, r3, #328
	sub	r4, r4, #2
	sub	r3, fp, #272
	mov	r2, #256
	mov	r1, r3
	ldr	r0, [fp, #-328]
	bl	leia_reg
	mov	r3, r0
	strh	r3, [r4]	@ movhi
.L3:
	sub	r3, fp, #12
	sub	r3, r3, #328
	sub	r3, r3, #2
	ldrsh	r3, [r3]
	cmp	r3, #0
	bgt	.L6
	ldr	r0, [fp, #-328]
	bl	fclose
	mov	r3, #0
	ldr	r2, .L9
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L8
	bl	__stack_chk_fail
.L8:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L10:
	.align	2
.L9:
	.word	.LC6
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	main, .-main
	.section	.rodata
	.align	2
.LC7:
	.ascii	"Buffer overflow\000"
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	leia_reg
	.syntax unified
	.arm
	.fpu softvfp
	.type	leia_reg, %function
leia_reg:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	ldr	r3, .L17
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r0, fp, #10
	ldr	r3, [fp, #-16]
	mov	r2, #1
	mov	r1, #2
	bl	fread
	mov	r3, r0
	cmp	r3, #0
	bne	.L12
	mov	r3, #0
	b	.L15
.L12:
	ldrsh	r3, [fp, #-10]
	mov	r2, r3
	ldr	r3, [fp, #-24]
	cmp	r3, r2
	ble	.L14
	ldrsh	r3, [fp, #-10]
	mov	r2, r3
	ldr	r3, [fp, #-16]
	mov	r1, #1
	ldr	r0, [fp, #-20]
	bl	fread
	mov	r3, r0
	lsl	r3, r3, #16
	asr	r3, r3, #16
	strh	r3, [fp, #-10]	@ movhi
	ldrsh	r3, [fp, #-10]
	mov	r2, r3
	ldr	r3, [fp, #-20]
	add	r3, r3, r2
	mov	r2, #0
	strb	r2, [r3]
	ldrsh	r3, [fp, #-10]
	b	.L15
.L14:
	ldr	r0, .L17+4
	bl	puts
	mov	r3, #0
.L15:
	ldr	r2, .L17
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L16
	bl	__stack_chk_fail
.L16:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L18:
	.align	2
.L17:
	.word	.LC8
	.word	.LC7
	.size	leia_reg, .-leia_reg
	.align	2
	.global	input
	.syntax unified
	.arm
	.fpu softvfp
	.type	input, %function
input:
	@ 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]
	str	r1, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-8]
	bl	getchar
	mov	r3, r0
	strb	r3, [fp, #-9]
	b	.L20
.L22:
	ldr	r3, [fp, #-20]
	cmp	r3, #1
	ble	.L21
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldrb	r2, [fp, #-9]
	strb	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-20]
	sub	r3, r3, #1
	str	r3, [fp, #-20]
.L21:
	bl	getchar
	mov	r3, r0
	strb	r3, [fp, #-9]
.L20:
	ldrb	r3, [fp, #-9]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L22
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	input, .-input
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
