	.file	"557919.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Can't fork child!"
.LC1:
	.string	"Can't open FIFO for writing!"
	.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, 64
	mov	eax, edi
	mov	QWORD PTR -64[rbp], rsi
	mov	BYTE PTR -52[rbp], al
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -48[rbp], 1000
	mov	eax, DWORD PTR -48[rbp]
	add	eax, 1
	cdqe
	mov	esi, 1
	mov	rdi, rax
	call	calloc@PLT
	mov	QWORD PTR -32[rbp], rax
	mov	DWORD PTR -22[rbp], 1768304177
	mov	WORD PTR -18[rbp], 28518
	mov	BYTE PTR -16[rbp], 0
	mov	DWORD PTR -15[rbp], 1768304178
	mov	WORD PTR -11[rbp], 28518
	mov	BYTE PTR -9[rbp], 0
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -44[rbp], eax
	mov	edi, 0
	call	umask@PLT
	lea	rax, -22[rbp]
	mov	edx, 0
	mov	esi, 4534
	mov	rdi, rax
	call	mknod@PLT
	lea	rax, -15[rbp]
	mov	edx, 0
	mov	esi, 4534
	mov	rdi, rax
	call	mknod@PLT
	call	fork@PLT
	mov	DWORD PTR -40[rbp], eax
	cmp	DWORD PTR -40[rbp], 0
	jns	.L2
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	edi, -1
	call	exit@PLT
.L2:
	cmp	DWORD PTR -44[rbp], 1
	jne	.L3
	cmp	DWORD PTR -40[rbp], 0
	jne	.L4
	lea	rax, -22[rbp]
	mov	esi, 1
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], 0
	jns	.L5
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	edi, -1
	call	exit@PLT
.L5:
	mov	rdx, QWORD PTR stdin[rip]
	mov	ecx, DWORD PTR -48[rbp]
	mov	rax, QWORD PTR -32[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	fgets@PLT
	mov	eax, DWORD PTR -48[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR -36[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	jmp	.L5
.L4:
	lea	rax, -15[rbp]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], 0
	jns	.L6
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	edi, -1
	call	exit@PLT
.L6:
	mov	eax, DWORD PTR -48[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR -36[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	puts@PLT
	jmp	.L6
.L3:
	cmp	DWORD PTR -44[rbp], 2
	jne	.L7
	cmp	DWORD PTR -40[rbp], 0
	jne	.L8
	lea	rax, -15[rbp]
	mov	esi, 1
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], 0
	jns	.L9
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	edi, -1
	call	exit@PLT
.L9:
	mov	rdx, QWORD PTR stdin[rip]
	mov	ecx, DWORD PTR -48[rbp]
	mov	rax, QWORD PTR -32[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	fgets@PLT
	mov	eax, DWORD PTR -48[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR -36[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	jmp	.L9
.L8:
	lea	rax, -22[rbp]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], 0
	jns	.L10
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	edi, -1
	call	exit@PLT
.L10:
	mov	eax, DWORD PTR -48[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR -36[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	puts@PLT
	jmp	.L10
.L7:
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	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	"557919.c"
	.text
	.section	.rodata
	.align	2
.LC2:
	.ascii	"Can't fork child!\000"
	.align	2
.LC3:
	.ascii	"Can't open FIFO for writing!\000"
	.align	2
.LC0:
	.ascii	"1.fifo\000"
	.align	2
.LC1:
	.ascii	"2.fifo\000"
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	mov	r3, r0
	str	r1, [fp, #-52]
	strb	r3, [fp, #-45]
	ldr	r3, .L13
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #1000
	str	r3, [fp, #-44]
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	mov	r1, #1
	mov	r0, r3
	bl	calloc
	mov	r3, r0
	str	r3, [fp, #-40]
	ldr	r2, .L13+4
	sub	r3, fp, #24
	ldm	r2, {r0, r1}
	str	r0, [r3]
	add	r3, r3, #4
	strh	r1, [r3]	@ movhi
	add	r3, r3, #2
	lsr	r2, r1, #16
	strb	r2, [r3]
	ldr	r2, .L13+8
	sub	r3, fp, #16
	ldm	r2, {r0, r1}
	str	r0, [r3]
	add	r3, r3, #4
	strh	r1, [r3]	@ movhi
	add	r3, r3, #2
	lsr	r2, r1, #16
	strb	r2, [r3]
	ldr	r3, [fp, #-52]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-36]
	mov	r0, #0
	bl	umask
	sub	r0, fp, #24
	mov	r2, #0
	mov	r3, #0
	ldr	r1, .L13+12
	bl	mknod
	sub	r0, fp, #16
	mov	r2, #0
	mov	r3, #0
	ldr	r1, .L13+12
	bl	mknod
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bge	.L2
	ldr	r0, .L13+16
	bl	puts
	mvn	r0, #0
	bl	exit
.L2:
	ldr	r3, [fp, #-36]
	cmp	r3, #1
	bne	.L3
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L4
	sub	r3, fp, #24
	mov	r1, #1
	mov	r0, r3
	bl	open
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bge	.L5
	ldr	r0, .L13+20
	bl	puts
	mvn	r0, #0
	bl	exit
.L5:
	ldr	r3, .L13+24
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, [fp, #-44]
	ldr	r0, [fp, #-40]
	bl	fgets
	ldr	r3, [fp, #-44]
	mov	r2, r3
	ldr	r1, [fp, #-40]
	ldr	r0, [fp, #-28]
	bl	write
	b	.L5
.L4:
	sub	r3, fp, #16
	mov	r1, #0
	mov	r0, r3
	bl	open
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bge	.L6
	ldr	r0, .L13+20
	bl	puts
	mvn	r0, #0
	bl	exit
.L6:
	ldr	r3, [fp, #-44]
	mov	r2, r3
	ldr	r1, [fp, #-40]
	ldr	r0, [fp, #-28]
	bl	read
	ldr	r0, [fp, #-40]
	bl	puts
	b	.L6
.L3:
	ldr	r3, [fp, #-36]
	cmp	r3, #2
	bne	.L7
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L8
	sub	r3, fp, #16
	mov	r1, #1
	mov	r0, r3
	bl	open
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bge	.L9
	ldr	r0, .L13+20
	bl	puts
	mvn	r0, #0
	bl	exit
.L9:
	ldr	r3, .L13+24
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, [fp, #-44]
	ldr	r0, [fp, #-40]
	bl	fgets
	ldr	r3, [fp, #-44]
	mov	r2, r3
	ldr	r1, [fp, #-40]
	ldr	r0, [fp, #-28]
	bl	write
	b	.L9
.L8:
	sub	r3, fp, #24
	mov	r1, #0
	mov	r0, r3
	bl	open
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bge	.L10
	ldr	r0, .L13+20
	bl	puts
	mvn	r0, #0
	bl	exit
.L10:
	ldr	r3, [fp, #-44]
	mov	r2, r3
	ldr	r1, [fp, #-40]
	ldr	r0, [fp, #-28]
	bl	read
	ldr	r0, [fp, #-40]
	bl	puts
	b	.L10
.L7:
	mov	r3, #0
	ldr	r2, .L13
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L12
	bl	__stack_chk_fail
.L12:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L14:
	.align	2
.L13:
	.word	.LC4
	.word	.LC0
	.word	.LC1
	.word	4534
	.word	.LC2
	.word	.LC3
	.word	stdin
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
