	.file	"43752.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"open"
.LC1:
	.string	"read"
.LC2:
	.string	"write longiutd"
.LC3:
	.string	"write mensaje"
.LC4:
	.string	"fin"
.LC5:
	.string	"fin\n"
.LC6:
	.string	"close fifo"
	.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, 560
	mov	DWORD PTR -548[rbp], edi
	mov	QWORD PTR -560[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -548[rbp], 1
	jg	.L2
	mov	eax, -1
	jmp	.L15
.L2:
	mov	rax, QWORD PTR -560[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	esi, 1
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -536[rbp], eax
	cmp	DWORD PTR -536[rbp], 0
	jns	.L4
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L15
.L4:
	lea	rax, -528[rbp]
	mov	edx, 512
	mov	rsi, rax
	mov	edi, 0
	call	read@PLT
	mov	DWORD PTR -532[rbp], eax
	cmp	DWORD PTR -532[rbp], 0
	jns	.L5
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L15
.L5:
	mov	eax, DWORD PTR -532[rbp]
	sub	eax, 1
	cdqe
	mov	BYTE PTR -528[rbp+rax], 0
	lea	rax, -528[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR -540[rbp], eax
	lea	rcx, -540[rbp]
	mov	eax, DWORD PTR -536[rbp]
	mov	edx, 4
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	cmp	rax, 4
	je	.L6
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L15
.L6:
	mov	eax, DWORD PTR -540[rbp]
	movsx	rdx, eax
	lea	rcx, -528[rbp]
	mov	eax, DWORD PTR -536[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	edx, DWORD PTR -540[rbp]
	movsx	rdx, edx
	cmp	rax, rdx
	je	.L8
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L15
.L13:
	lea	rax, -528[rbp]
	mov	edx, 512
	mov	rsi, rax
	mov	edi, 0
	call	read@PLT
	mov	DWORD PTR -532[rbp], eax
	cmp	DWORD PTR -532[rbp], 0
	jns	.L9
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L15
.L9:
	mov	eax, DWORD PTR -532[rbp]
	sub	eax, 1
	cdqe
	mov	BYTE PTR -528[rbp+rax], 0
	lea	rax, -528[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR -540[rbp], eax
	lea	rax, -528[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	je	.L17
	lea	rcx, -540[rbp]
	mov	eax, DWORD PTR -536[rbp]
	mov	edx, 4
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	cmp	rax, 4
	je	.L12
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L15
.L12:
	mov	eax, DWORD PTR -540[rbp]
	movsx	rdx, eax
	lea	rcx, -528[rbp]
	mov	eax, DWORD PTR -536[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	edx, DWORD PTR -540[rbp]
	movsx	rdx, edx
	cmp	rax, rdx
	je	.L8
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L15
.L8:
	lea	rax, -528[rbp]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L13
	jmp	.L11
.L17:
	nop
.L11:
	mov	eax, DWORD PTR -536[rbp]
	mov	edi, eax
	call	close@PLT
	test	eax, eax
	jns	.L14
	lea	rdi, .LC6[rip]
	call	perror@PLT
.L14:
	mov	eax, 0
.L15:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.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	"43752.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"open\000"
	.align	2
.LC1:
	.ascii	"read\000"
	.align	2
.LC2:
	.ascii	"write longiutd\000"
	.align	2
.LC3:
	.ascii	"write mensaje\000"
	.align	2
.LC4:
	.ascii	"fin\000"
	.align	2
.LC5:
	.ascii	"fin\012\000"
	.align	2
.LC6:
	.ascii	"close fifo\000"
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 536
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #536
	str	r0, [fp, #-536]
	str	r1, [fp, #-540]
	ldr	r3, .L18
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-536]
	cmp	r3, #1
	bgt	.L2
	mvn	r3, #0
	b	.L15
.L2:
	ldr	r3, [fp, #-540]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, #1
	mov	r0, r3
	bl	open
	str	r0, [fp, #-528]
	ldr	r3, [fp, #-528]
	cmp	r3, #0
	bge	.L4
	ldr	r0, .L18+4
	bl	perror
	mvn	r3, #0
	b	.L15
.L4:
	sub	r3, fp, #520
	mov	r2, #512
	mov	r1, r3
	mov	r0, #0
	bl	read
	str	r0, [fp, #-524]
	ldr	r3, [fp, #-524]
	cmp	r3, #0
	bge	.L5
	ldr	r0, .L18+8
	bl	perror
	mvn	r3, #0
	b	.L15
.L5:
	ldr	r3, [fp, #-524]
	sub	r3, r3, #1
	sub	r2, fp, #4
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3, #-516]
	sub	r3, fp, #520
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	str	r3, [fp, #-532]
	sub	r3, fp, #532
	mov	r2, #4
	mov	r1, r3
	ldr	r0, [fp, #-528]
	bl	write
	mov	r3, r0
	cmp	r3, #4
	beq	.L6
	ldr	r0, .L18+12
	bl	perror
	mvn	r3, #0
	b	.L15
.L6:
	ldr	r3, [fp, #-532]
	mov	r2, r3
	sub	r3, fp, #520
	mov	r1, r3
	ldr	r0, [fp, #-528]
	bl	write
	mov	r2, r0
	ldr	r3, [fp, #-532]
	cmp	r2, r3
	beq	.L8
	ldr	r0, .L18+16
	bl	perror
	mvn	r3, #0
	b	.L15
.L13:
	sub	r3, fp, #520
	mov	r2, #512
	mov	r1, r3
	mov	r0, #0
	bl	read
	str	r0, [fp, #-524]
	ldr	r3, [fp, #-524]
	cmp	r3, #0
	bge	.L9
	ldr	r0, .L18+8
	bl	perror
	mvn	r3, #0
	b	.L15
.L9:
	ldr	r3, [fp, #-524]
	sub	r3, r3, #1
	sub	r2, fp, #4
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3, #-516]
	sub	r3, fp, #520
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	str	r3, [fp, #-532]
	sub	r3, fp, #520
	ldr	r1, .L18+20
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L17
	sub	r3, fp, #532
	mov	r2, #4
	mov	r1, r3
	ldr	r0, [fp, #-528]
	bl	write
	mov	r3, r0
	cmp	r3, #4
	beq	.L12
	ldr	r0, .L18+12
	bl	perror
	mvn	r3, #0
	b	.L15
.L12:
	ldr	r3, [fp, #-532]
	mov	r2, r3
	sub	r3, fp, #520
	mov	r1, r3
	ldr	r0, [fp, #-528]
	bl	write
	mov	r2, r0
	ldr	r3, [fp, #-532]
	cmp	r2, r3
	beq	.L8
	ldr	r0, .L18+16
	bl	perror
	mvn	r3, #0
	b	.L15
.L8:
	sub	r3, fp, #520
	ldr	r1, .L18+24
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L13
	b	.L11
.L17:
	nop
.L11:
	ldr	r0, [fp, #-528]
	bl	close
	mov	r3, r0
	cmp	r3, #0
	bge	.L14
	ldr	r0, .L18+28
	bl	perror
.L14:
	mov	r3, #0
.L15:
	ldr	r2, .L18
	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}
.L19:
	.align	2
.L18:
	.word	.LC7
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
