	.file	"378318.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"numero parametri insufficiente"
	.align 8
.LC1:
	.string	"errore nella creazione di big_pipe"
.LC2:
	.string	"fork fallita"
.LC3:
	.string	"filename: %s\n"
.LC4:
	.string	"errore creazione pipe"
.LC5:
	.string	"fork del nipote fallita"
.LC6:
	.string	"-l"
.LC7:
	.string	"wc"
.LC8:
	.string	"errore in wait"
.LC9:
	.string	"somma finale: %ld\n"
.LC10:
	.string	"errore nella wait del padre"
.LC11:
	.string	"pid %d ha ritornato %d\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, 256
	mov	DWORD PTR -244[rbp], edi
	mov	QWORD PTR -256[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -244[rbp], 2
	jg	.L2
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	QWORD PTR -176[rbp], 0
	mov	eax, DWORD PTR -244[rbp]
	sub	eax, 1
	cdqe
	sal	rax, 3
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -168[rbp], rax
	mov	DWORD PTR -232[rbp], 0
	jmp	.L3
.L5:
	mov	eax, DWORD PTR -232[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -168[rbp]
	add	rax, rdx
	mov	rdi, rax
	call	pipe@PLT
	test	eax, eax
	jns	.L4
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	edi, 2
	call	exit@PLT
.L4:
	add	DWORD PTR -232[rbp], 1
.L3:
	mov	eax, DWORD PTR -244[rbp]
	sub	eax, 1
	cmp	DWORD PTR -232[rbp], eax
	jl	.L5
	mov	DWORD PTR -228[rbp], 0
	jmp	.L6
.L19:
	call	fork@PLT
	mov	DWORD PTR -204[rbp], eax
	cmp	DWORD PTR -204[rbp], 0
	jns	.L7
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	edi, 2
	call	exit@PLT
.L7:
	cmp	DWORD PTR -204[rbp], 0
	jne	.L8
	mov	eax, DWORD PTR -228[rbp]
	cdqe
	add	rax, 1
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -256[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -160[rbp], rax
	mov	DWORD PTR -224[rbp], 0
	jmp	.L9
.L11:
	mov	eax, DWORD PTR -224[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -168[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -224[rbp]
	cmp	eax, DWORD PTR -228[rbp]
	je	.L10
	mov	eax, DWORD PTR -224[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -168[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 4[rax]
	mov	edi, eax
	call	close@PLT
.L10:
	add	DWORD PTR -224[rbp], 1
.L9:
	mov	eax, DWORD PTR -244[rbp]
	sub	eax, 1
	cmp	DWORD PTR -224[rbp], eax
	jl	.L11
	mov	rax, QWORD PTR -160[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -152[rbp]
	mov	rdi, rax
	call	pipe@PLT
	test	eax, eax
	jns	.L12
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L12:
	call	fork@PLT
	mov	DWORD PTR -200[rbp], eax
	cmp	DWORD PTR -200[rbp], 0
	jns	.L13
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	edi, 3
	call	exit@PLT
.L13:
	cmp	DWORD PTR -200[rbp], 0
	jne	.L14
	mov	eax, DWORD PTR -152[rbp]
	mov	edi, eax
	call	close@PLT
	mov	edi, 1
	call	close@PLT
	mov	eax, DWORD PTR -148[rbp]
	mov	edi, eax
	call	dup@PLT
	mov	edi, 0
	call	close@PLT
	mov	rax, QWORD PTR -160[rbp]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -196[rbp], eax
	mov	ecx, 0
	lea	rdx, .LC6[rip]
	lea	rsi, .LC7[rip]
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	execlp@PLT
	mov	edi, -1
	call	exit@PLT
.L14:
	mov	DWORD PTR -220[rbp], 0
	mov	eax, DWORD PTR -148[rbp]
	mov	edi, eax
	call	close@PLT
	lea	rax, -236[rbp]
	mov	rdi, rax
	call	wait@PLT
	mov	DWORD PTR -200[rbp], eax
	cmp	DWORD PTR -200[rbp], 0
	jns	.L15
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 4
	call	exit@PLT
.L15:
	lea	rdx, -144[rbp]
	mov	eax, DWORD PTR -220[rbp]
	cdqe
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR -152[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	test	rax, rax
	jle	.L26
	mov	eax, DWORD PTR -220[rbp]
	cdqe
	movzx	eax, BYTE PTR -144[rbp+rax]
	cmp	al, 10
	jne	.L18
	mov	eax, DWORD PTR -220[rbp]
	cdqe
	mov	BYTE PTR -144[rbp+rax], 0
	jmp	.L17
.L18:
	add	DWORD PTR -220[rbp], 1
	jmp	.L15
.L26:
	nop
.L17:
	lea	rax, -144[rbp]
	mov	rdi, rax
	call	atoi@PLT
	cdqe
	mov	QWORD PTR -192[rbp], rax
	mov	eax, DWORD PTR -228[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -168[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 4[rax]
	lea	rcx, -192[rbp]
	mov	edx, 8
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	eax, DWORD PTR -236[rbp]
	mov	edi, eax
	call	exit@PLT
.L8:
	add	DWORD PTR -228[rbp], 1
.L6:
	mov	eax, DWORD PTR -244[rbp]
	sub	eax, 1
	cmp	DWORD PTR -228[rbp], eax
	jl	.L19
	mov	DWORD PTR -216[rbp], 0
	jmp	.L20
.L21:
	mov	eax, DWORD PTR -216[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -168[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	lea	rcx, -192[rbp]
	mov	edx, 8
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	rax, QWORD PTR -192[rbp]
	add	QWORD PTR -184[rbp], rax
	add	DWORD PTR -216[rbp], 1
.L20:
	mov	eax, DWORD PTR -244[rbp]
	sub	eax, 1
	cmp	DWORD PTR -216[rbp], eax
	jl	.L21
	mov	rax, QWORD PTR -184[rbp]
	mov	rsi, rax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -212[rbp], 1
	jmp	.L22
.L24:
	lea	rax, -192[rbp]
	mov	rdi, rax
	call	wait@PLT
	mov	DWORD PTR -208[rbp], eax
	cmp	DWORD PTR -208[rbp], 0
	jns	.L23
	lea	rdi, .LC10[rip]
	call	puts@PLT
	mov	edi, 5
	call	exit@PLT
.L23:
	mov	edx, DWORD PTR -192[rbp]
	mov	eax, DWORD PTR -208[rbp]
	mov	esi, eax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -212[rbp], 1
.L22:
	mov	eax, DWORD PTR -212[rbp]
	cmp	eax, DWORD PTR -244[rbp]
	jl	.L24
	mov	edi, 0
	call	exit@PLT
	.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	"378318.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"numero parametri insufficiente\000"
	.align	2
.LC1:
	.ascii	"errore nella creazione di big_pipe\000"
	.align	2
.LC2:
	.ascii	"fork fallita\000"
	.align	2
.LC3:
	.ascii	"filename: %s\012\000"
	.align	2
.LC4:
	.ascii	"errore creazione pipe\000"
	.align	2
.LC5:
	.ascii	"fork del nipote fallita\000"
	.align	2
.LC6:
	.ascii	"-l\000"
	.align	2
.LC7:
	.ascii	"wc\000"
	.align	2
.LC8:
	.ascii	"errore in wait\000"
	.align	2
.LC9:
	.ascii	"somma finale: %ld\012\000"
	.align	2
.LC10:
	.ascii	"errore nella wait del padre\000"
	.align	2
.LC11:
	.ascii	"pid %d ha ritornato %d\012\000"
	.align	2
.LC12:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 216
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #216
	str	r0, [fp, #-216]
	str	r1, [fp, #-220]
	ldr	r3, .L27
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-216]
	cmp	r3, #2
	bgt	.L2
	ldr	r0, .L27+4
	bl	puts
	mov	r0, #1
	bl	exit
.L2:
	mov	r3, #0
	str	r3, [fp, #-172]
	ldr	r3, [fp, #-216]
	sub	r3, r3, #1
	lsl	r3, r3, #3
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-168]
	mov	r3, #0
	str	r3, [fp, #-200]
	b	.L3
.L5:
	ldr	r3, [fp, #-200]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-168]
	add	r3, r2, r3
	mov	r0, r3
	bl	pipe
	mov	r3, r0
	cmp	r3, #0
	bge	.L4
	ldr	r0, .L27+8
	bl	puts
	mov	r0, #2
	bl	exit
.L4:
	ldr	r3, [fp, #-200]
	add	r3, r3, #1
	str	r3, [fp, #-200]
.L3:
	ldr	r3, [fp, #-216]
	sub	r3, r3, #1
	ldr	r2, [fp, #-200]
	cmp	r2, r3
	blt	.L5
	mov	r3, #0
	str	r3, [fp, #-196]
	b	.L6
.L19:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-160]
	ldr	r3, [fp, #-160]
	cmp	r3, #0
	bge	.L7
	ldr	r0, .L27+12
	bl	puts
	mov	r0, #2
	bl	exit
.L7:
	ldr	r3, [fp, #-160]
	cmp	r3, #0
	bne	.L8
	ldr	r3, [fp, #-196]
	add	r3, r3, #1
	lsl	r3, r3, #2
	ldr	r2, [fp, #-220]
	add	r3, r2, r3
	ldr	r3, [r3]
	str	r3, [fp, #-156]
	mov	r3, #0
	str	r3, [fp, #-192]
	b	.L9
.L11:
	ldr	r3, [fp, #-192]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-168]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	ldr	r2, [fp, #-192]
	ldr	r3, [fp, #-196]
	cmp	r2, r3
	beq	.L10
	ldr	r3, [fp, #-192]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-168]
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	close
.L10:
	ldr	r3, [fp, #-192]
	add	r3, r3, #1
	str	r3, [fp, #-192]
.L9:
	ldr	r3, [fp, #-216]
	sub	r3, r3, #1
	ldr	r2, [fp, #-192]
	cmp	r2, r3
	blt	.L11
	ldr	r1, [fp, #-156]
	ldr	r0, .L27+16
	bl	printf
	sub	r3, fp, #144
	mov	r0, r3
	bl	pipe
	mov	r3, r0
	cmp	r3, #0
	bge	.L12
	ldr	r0, .L27+20
	bl	puts
	mov	r0, #1
	bl	exit
.L12:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-152]
	ldr	r3, [fp, #-152]
	cmp	r3, #0
	bge	.L13
	ldr	r0, .L27+24
	bl	puts
	mov	r0, #3
	bl	exit
.L13:
	ldr	r3, [fp, #-152]
	cmp	r3, #0
	bne	.L14
	ldr	r3, [fp, #-144]
	mov	r0, r3
	bl	close
	mov	r0, #1
	bl	close
	ldr	r3, [fp, #-140]
	mov	r0, r3
	bl	dup
	mov	r0, #0
	bl	close
	mov	r1, #0
	ldr	r0, [fp, #-156]
	bl	open
	str	r0, [fp, #-148]
	mov	r3, #0
	ldr	r2, .L27+28
	ldr	r1, .L27+32
	ldr	r0, .L27+32
	bl	execlp
	mvn	r0, #0
	bl	exit
.L14:
	mov	r3, #0
	str	r3, [fp, #-188]
	ldr	r3, [fp, #-140]
	mov	r0, r3
	bl	close
	sub	r3, fp, #208
	mov	r0, r3
	bl	wait
	str	r0, [fp, #-152]
	ldr	r3, [fp, #-152]
	cmp	r3, #0
	bge	.L15
	ldr	r0, .L27+36
	bl	printf
	mov	r0, #4
	bl	exit
.L15:
	ldr	r0, [fp, #-144]
	sub	r2, fp, #136
	ldr	r3, [fp, #-188]
	add	r3, r2, r3
	mov	r2, #1
	mov	r1, r3
	bl	read
	mov	r3, r0
	cmp	r3, #0
	ble	.L26
	sub	r2, fp, #136
	ldr	r3, [fp, #-188]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L18
	sub	r2, fp, #136
	ldr	r3, [fp, #-188]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	b	.L17
.L18:
	ldr	r3, [fp, #-188]
	add	r3, r3, #1
	str	r3, [fp, #-188]
	b	.L15
.L26:
	nop
.L17:
	sub	r3, fp, #136
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	str	r3, [fp, #-204]
	ldr	r3, [fp, #-196]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-168]
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	sub	r1, fp, #204
	mov	r2, #4
	mov	r0, r3
	bl	write
	ldr	r3, [fp, #-208]
	mov	r0, r3
	bl	exit
.L8:
	ldr	r3, [fp, #-196]
	add	r3, r3, #1
	str	r3, [fp, #-196]
.L6:
	ldr	r3, [fp, #-216]
	sub	r3, r3, #1
	ldr	r2, [fp, #-196]
	cmp	r2, r3
	blt	.L19
	mov	r3, #0
	str	r3, [fp, #-180]
	b	.L20
.L21:
	ldr	r3, [fp, #-180]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-168]
	add	r3, r2, r3
	ldr	r3, [r3]
	sub	r1, fp, #204
	mov	r2, #4
	mov	r0, r3
	bl	read
	ldr	r3, [fp, #-204]
	ldr	r2, [fp, #-184]
	add	r3, r2, r3
	str	r3, [fp, #-184]
	ldr	r3, [fp, #-180]
	add	r3, r3, #1
	str	r3, [fp, #-180]
.L20:
	ldr	r3, [fp, #-216]
	sub	r3, r3, #1
	ldr	r2, [fp, #-180]
	cmp	r2, r3
	blt	.L21
	ldr	r1, [fp, #-184]
	ldr	r0, .L27+40
	bl	printf
	mov	r3, #1
	str	r3, [fp, #-176]
	b	.L22
.L24:
	sub	r3, fp, #204
	mov	r0, r3
	bl	wait
	str	r0, [fp, #-164]
	ldr	r3, [fp, #-164]
	cmp	r3, #0
	bge	.L23
	ldr	r0, .L27+44
	bl	puts
	mov	r0, #5
	bl	exit
.L23:
	ldr	r3, [fp, #-204]
	mov	r2, r3
	ldr	r1, [fp, #-164]
	ldr	r0, .L27+48
	bl	printf
	ldr	r3, [fp, #-176]
	add	r3, r3, #1
	str	r3, [fp, #-176]
.L22:
	ldr	r2, [fp, #-176]
	ldr	r3, [fp, #-216]
	cmp	r2, r3
	blt	.L24
	mov	r0, #0
	bl	exit
.L28:
	.align	2
.L27:
	.word	.LC12
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
