	.file	"170453146.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"Unexpected number of arguments.\nTerminating.."
.LC1:
	.string	"%s.txt"
.LC2:
	.string	"%s.zip"
	.align 8
.LC3:
	.string	"[PARENT] Creating first process..."
.LC4:
	.string	"w"
	.align 8
.LC5:
	.string	"[CHILD1] Writing %d random char to %s\n"
.LC6:
	.string	"%c\n"
	.align 8
.LC7:
	.string	"[PARENT] Creating second process..."
	.align 8
.LC8:
	.string	"[CHILD2] Executing zip command..."
.LC9:
	.string	"zip"
.LC10:
	.string	"/bin/zip"
	.align 8
.LC11:
	.string	"[PARENT] Creating third process..."
	.align 8
.LC12:
	.string	"[CHILD3] Executing ls command..."
.LC13:
	.string	"ls"
.LC14:
	.string	"/bin/ls"
.LC15:
	.string	"[PARENT] Done."
	.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, 192
	mov	DWORD PTR -180[rbp], edi
	mov	QWORD PTR -192[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -180[rbp], 3
	je	.L2
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	rax, QWORD PTR -192[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -152[rbp], eax
	mov	rax, QWORD PTR -192[rbp]
	add	rax, 8
	mov	rdx, QWORD PTR [rax]
	lea	rax, -128[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	mov	rax, QWORD PTR -192[rbp]
	add	rax, 8
	mov	rdx, QWORD PTR [rax]
	lea	rax, -64[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	lea	rdi, .LC3[rip]
	call	puts@PLT
	call	fork@PLT
	mov	DWORD PTR -148[rbp], eax
	cmp	DWORD PTR -148[rbp], 0
	jne	.L3
	lea	rax, -128[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -136[rbp], rax
	lea	rdx, -128[rbp]
	mov	eax, DWORD PTR -152[rbp]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -156[rbp], 0
	jmp	.L4
.L5:
	call	rand@PLT
	mov	edx, eax
	movsx	rax, edx
	imul	rax, rax, 715827883
	shr	rax, 32
	sar	eax, 2
	mov	esi, edx
	sar	esi, 31
	sub	eax, esi
	mov	ecx, eax
	mov	eax, ecx
	add	eax, eax
	add	eax, ecx
	sal	eax, 3
	mov	ecx, edx
	sub	ecx, eax
	mov	eax, ecx
	add	eax, 1
	mov	BYTE PTR -161[rbp], al
	movsx	edx, BYTE PTR -161[rbp]
	mov	rax, QWORD PTR -136[rbp]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	add	DWORD PTR -156[rbp], 1
.L4:
	mov	eax, DWORD PTR -156[rbp]
	cmp	eax, DWORD PTR -152[rbp]
	jl	.L5
	mov	rax, QWORD PTR -136[rbp]
	mov	rdi, rax
	call	fclose@PLT
	jmp	.L6
.L3:
	lea	rax, -160[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	wait@PLT
	lea	rdi, .LC7[rip]
	call	puts@PLT
	call	fork@PLT
	mov	DWORD PTR -144[rbp], eax
	cmp	DWORD PTR -144[rbp], 0
	jne	.L7
	lea	rdi, .LC8[rip]
	call	puts@PLT
	lea	rdx, -128[rbp]
	lea	rax, -64[rbp]
	mov	r8d, 0
	mov	rcx, rdx
	mov	rdx, rax
	lea	rsi, .LC9[rip]
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	execl@PLT
	jmp	.L6
.L7:
	lea	rax, -160[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	wait@PLT
	lea	rdi, .LC11[rip]
	call	puts@PLT
	call	fork@PLT
	mov	DWORD PTR -140[rbp], eax
	cmp	DWORD PTR -140[rbp], 0
	jne	.L8
	lea	rdi, .LC12[rip]
	call	puts@PLT
	mov	edx, 0
	lea	rsi, .LC13[rip]
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	execl@PLT
	jmp	.L6
.L8:
	lea	rax, -160[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	wait@PLT
	lea	rdi, .LC15[rip]
	call	puts@PLT
.L6:
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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	"170453146.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Unexpected number of arguments.\012Terminating..\000"
	.align	2
.LC1:
	.ascii	"%s.txt\000"
	.align	2
.LC2:
	.ascii	"%s.zip\000"
	.align	2
.LC3:
	.ascii	"[PARENT] Creating first process...\000"
	.align	2
.LC4:
	.ascii	"w\000"
	.align	2
.LC5:
	.ascii	"[CHILD1] Writing %d random char to %s\012\000"
	.align	2
.LC6:
	.ascii	"%c\012\000"
	.align	2
.LC7:
	.ascii	"[PARENT] Creating second process...\000"
	.align	2
.LC8:
	.ascii	"[CHILD2] Executing zip command...\000"
	.align	2
.LC9:
	.ascii	"zip\000"
	.align	2
.LC10:
	.ascii	"/bin/zip\000"
	.align	2
.LC11:
	.ascii	"[PARENT] Creating third process...\000"
	.align	2
.LC12:
	.ascii	"[CHILD3] Executing ls command...\000"
	.align	2
.LC13:
	.ascii	"ls\000"
	.align	2
.LC14:
	.ascii	"/bin/ls\000"
	.align	2
.LC15:
	.ascii	"[PARENT] Done.\000"
	.align	2
.LC16:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 152
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #160
	str	r0, [fp, #-152]
	str	r1, [fp, #-156]
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-152]
	cmp	r3, #3
	beq	.L2
	ldr	r0, .L11+4
	bl	puts
	mov	r0, #1
	bl	exit
.L2:
	ldr	r3, [fp, #-156]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-132]
	ldr	r3, [fp, #-156]
	add	r3, r3, #4
	ldr	r2, [r3]
	sub	r3, fp, #112
	ldr	r1, .L11+8
	mov	r0, r3
	bl	sprintf
	ldr	r3, [fp, #-156]
	add	r3, r3, #4
	ldr	r2, [r3]
	sub	r3, fp, #60
	ldr	r1, .L11+12
	mov	r0, r3
	bl	sprintf
	ldr	r0, .L11+16
	bl	puts
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-128]
	ldr	r3, [fp, #-128]
	cmp	r3, #0
	bne	.L3
	sub	r3, fp, #112
	ldr	r1, .L11+20
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-116]
	sub	r3, fp, #112
	mov	r2, r3
	ldr	r1, [fp, #-132]
	ldr	r0, .L11+24
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-136]
	b	.L4
.L5:
	bl	rand
	mov	r1, r0
	ldr	r3, .L11+28
	smull	r2, r3, r1, r3
	asr	r2, r3, #2
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	sub	r2, r1, r3
	and	r3, r2, #255
	add	r3, r3, #1
	strb	r3, [fp, #-141]
	ldrb	r3, [fp, #-141]	@ zero_extendqisi2
	mov	r2, r3
	ldr	r1, .L11+32
	ldr	r0, [fp, #-116]
	bl	fprintf
	ldr	r3, [fp, #-136]
	add	r3, r3, #1
	str	r3, [fp, #-136]
.L4:
	ldr	r2, [fp, #-136]
	ldr	r3, [fp, #-132]
	cmp	r2, r3
	blt	.L5
	ldr	r0, [fp, #-116]
	bl	fclose
	b	.L6
.L3:
	sub	r3, fp, #140
	mov	r0, r3
	bl	wait
	ldr	r0, .L11+36
	bl	puts
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-124]
	ldr	r3, [fp, #-124]
	cmp	r3, #0
	bne	.L7
	ldr	r0, .L11+40
	bl	puts
	sub	r3, fp, #112
	sub	r2, fp, #60
	mov	r1, #0
	str	r1, [sp]
	ldr	r1, .L11+44
	ldr	r0, .L11+48
	bl	execl
	b	.L6
.L7:
	sub	r3, fp, #140
	mov	r0, r3
	bl	wait
	ldr	r0, .L11+52
	bl	puts
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-120]
	ldr	r3, [fp, #-120]
	cmp	r3, #0
	bne	.L8
	ldr	r0, .L11+56
	bl	puts
	mov	r2, #0
	ldr	r1, .L11+60
	ldr	r0, .L11+64
	bl	execl
	b	.L6
.L8:
	sub	r3, fp, #140
	mov	r0, r3
	bl	wait
	ldr	r0, .L11+68
	bl	puts
.L6:
	mov	r3, #0
	ldr	r2, .L11
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L10
	bl	__stack_chk_fail
.L10:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC16
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	715827883
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
