	.file	"880806.c"
	.intel_syntax noprefix
	.text
	.globl	pidsCount
	.bss
	.align 4
	.type	pidsCount, @object
	.size	pidsCount, 4
pidsCount:
	.zero	4
	.globl	pids
	.align 8
	.type	pids, @object
	.size	pids, 8
pids:
	.zero	8
	.section	.rodata
.LC0:
	.string	"process %d in timeout\n"
	.text
	.globl	timeout_handler
	.type	timeout_handler, @function
timeout_handler:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	DWORD PTR -4[rbp], 0
	jmp	.L2
.L4:
	mov	rdx, QWORD PTR pids[rip]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rdx, QWORD PTR pids[rip]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jle	.L3
	mov	rdx, QWORD PTR pids[rip]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	esi, 9
	mov	edi, eax
	call	kill@PLT
.L3:
	add	DWORD PTR -4[rbp], 1
.L2:
	mov	eax, DWORD PTR pidsCount[rip]
	cmp	DWORD PTR -4[rbp], eax
	jl	.L4
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	timeout_handler, .-timeout_handler
	.section	.rodata
	.align 8
.LC1:
	.string	"[Process %d] pid = %d | file = %s\n"
.LC2:
	.string	"grep"
.LC3:
	.string	"exec"
	.text
	.globl	grep
	.type	grep, @function
grep:
.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
	call	fork@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	jne	.L6
	call	getpid@PLT
	mov	esi, eax
	mov	rdx, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR -36[rbp]
	mov	rcx, rdx
	mov	edx, esi
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rdx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	r8d, 0
	mov	rcx, rdx
	mov	rdx, rax
	lea	rsi, .LC2[rip]
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	execlp@PLT
	test	eax, eax
	jns	.L7
	lea	rdi, .LC3[rip]
	call	perror@PLT
.L7:
	mov	edi, -1
	call	_exit@PLT
.L6:
	mov	eax, DWORD PTR -4[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	grep, .-grep
	.section	.rodata
.LC4:
	.string	"Insuficient Arguments!"
.LC5:
	.string	"[process %d] found the word\n"
	.align 8
.LC6:
	.string	"[process %d] word was not found\n"
.LC7:
	.string	"process %d was interrupted\n"
.LC8:
	.string	"killing process %d\n"
	.align 8
.LC9:
	.string	"process %d ended correctly already\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 72
	.cfi_offset 3, -24
	mov	DWORD PTR -68[rbp], edi
	mov	QWORD PTR -80[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -68[rbp], 2
	jg	.L10
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L27
.L10:
	lea	rsi, timeout_handler[rip]
	mov	edi, 14
	call	signal@PLT
	mov	eax, DWORD PTR -68[rbp]
	sub	eax, 2
	mov	DWORD PTR -40[rbp], eax
	mov	eax, DWORD PTR -40[rbp]
	mov	DWORD PTR pidsCount[rip], eax
	mov	eax, DWORD PTR pidsCount[rip]
	cdqe
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR pids[rip], rax
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 16
	mov	QWORD PTR -32[rbp], rax
	mov	DWORD PTR -56[rbp], 0
	jmp	.L12
.L13:
	mov	eax, DWORD PTR -56[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rsi, QWORD PTR pids[rip]
	mov	edx, DWORD PTR -56[rbp]
	movsx	rdx, edx
	sal	rdx, 2
	lea	rbx, [rsi+rdx]
	mov	edx, DWORD PTR -56[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	grep
	mov	DWORD PTR [rbx], eax
	add	DWORD PTR -56[rbp], 1
.L12:
	mov	eax, DWORD PTR -56[rbp]
	cmp	eax, DWORD PTR -40[rbp]
	jl	.L13
	mov	edi, 10
	call	alarm@PLT
	mov	DWORD PTR -52[rbp], 0
	mov	DWORD PTR -48[rbp], -1
	jmp	.L14
.L21:
	mov	eax, DWORD PTR -60[rbp]
	and	eax, 127
	test	eax, eax
	jne	.L15
	mov	eax, DWORD PTR -60[rbp]
	sar	eax, 8
	movzx	eax, al
	test	eax, eax
	je	.L16
	cmp	eax, 1
	je	.L17
	jmp	.L14
.L16:
	mov	eax, DWORD PTR -36[rbp]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -52[rbp], 1
	mov	eax, DWORD PTR -36[rbp]
	mov	DWORD PTR -48[rbp], eax
	jmp	.L14
.L17:
	mov	eax, DWORD PTR -36[rbp]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	jmp	.L14
.L15:
	mov	eax, DWORD PTR -36[rbp]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
.L14:
	cmp	DWORD PTR -52[rbp], 0
	jne	.L20
	lea	rax, -60[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	wait@PLT
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], 0
	jg	.L21
.L20:
	cmp	DWORD PTR -52[rbp], 1
	jne	.L22
	mov	DWORD PTR -44[rbp], 0
	jmp	.L23
.L26:
	mov	rdx, QWORD PTR pids[rip]
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -48[rbp], eax
	je	.L24
	mov	rdx, QWORD PTR pids[rip]
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rdx, QWORD PTR pids[rip]
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	esi, 9
	mov	edi, eax
	call	kill@PLT
	mov	rdx, QWORD PTR pids[rip]
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	lea	rcx, -60[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	edi, eax
	mov	eax, 0
	call	waitpid@PLT
	mov	eax, DWORD PTR -60[rbp]
	and	eax, 127
	test	eax, eax
	je	.L25
	mov	rdx, QWORD PTR pids[rip]
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L24
.L25:
	mov	rdx, QWORD PTR pids[rip]
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
.L24:
	add	DWORD PTR -44[rbp], 1
.L23:
	mov	eax, DWORD PTR -44[rbp]
	cmp	eax, DWORD PTR -40[rbp]
	jl	.L26
.L22:
	mov	rax, QWORD PTR pids[rip]
	mov	rdi, rax
	call	free@PLT
	cmp	DWORD PTR -52[rbp], 0
	sete	al
	movzx	eax, al
.L27:
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	"880806.c"
	.text
	.comm	pidsCount,4,4
	.comm	pids,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"process %d in timeout\012\000"
	.text
	.align	2
	.global	timeout_handler
	.syntax unified
	.arm
	.fpu softvfp
	.type	timeout_handler, %function
timeout_handler:
	@ 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]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L2
.L4:
	ldr	r3, .L5
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L5+4
	bl	printf
	ldr	r3, .L5
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L3
	ldr	r3, .L5
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, #9
	mov	r0, r3
	bl	kill
.L3:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L2:
	ldr	r3, .L5+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L4
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L6:
	.align	2
.L5:
	.word	pids
	.word	.LC0
	.word	pidsCount
	.size	timeout_handler, .-timeout_handler
	.section	.rodata
	.align	2
.LC1:
	.ascii	"[Process %d] pid = %d | file = %s\012\000"
	.align	2
.LC2:
	.ascii	"grep\000"
	.align	2
.LC3:
	.ascii	"exec\000"
	.text
	.align	2
	.global	grep
	.syntax unified
	.arm
	.fpu softvfp
	.type	grep, %function
grep:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L8
	bl	getpid
	mov	r2, r0
	ldr	r3, [fp, #-20]
	ldr	r1, [fp, #-24]
	ldr	r0, .L11
	bl	printf
	mov	r3, #0
	str	r3, [sp]
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-16]
	ldr	r1, .L11+4
	ldr	r0, .L11+4
	bl	execlp
	mov	r3, r0
	cmp	r3, #0
	bge	.L9
	ldr	r0, .L11+8
	bl	perror
.L9:
	mvn	r0, #0
	bl	_exit
.L8:
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.size	grep, .-grep
	.section	.rodata
	.align	2
.LC4:
	.ascii	"Insuficient Arguments!\000"
	.align	2
.LC5:
	.ascii	"[process %d] found the word\012\000"
	.align	2
.LC6:
	.ascii	"[process %d] word was not found\012\000"
	.align	2
.LC7:
	.ascii	"process %d was interrupted\012\000"
	.align	2
.LC8:
	.ascii	"killing process %d\012\000"
	.align	2
.LC9:
	.ascii	"process %d ended correctly already\012\000"
	.align	2
.LC10:
	.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	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #52
	str	r0, [fp, #-56]
	str	r1, [fp, #-60]
	ldr	r3, .L33
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, [fp, #-56]
	cmp	r3, #2
	bgt	.L14
	ldr	r0, .L33+4
	bl	puts
	mov	r3, #1
	b	.L31
.L14:
	ldr	r1, .L33+8
	mov	r0, #14
	bl	signal
	ldr	r3, [fp, #-56]
	sub	r3, r3, #2
	str	r3, [fp, #-28]
	ldr	r2, .L33+12
	ldr	r3, [fp, #-28]
	str	r3, [r2]
	ldr	r3, .L33+12
	ldr	r3, [r3]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L33+16
	str	r2, [r3]
	ldr	r3, [fp, #-60]
	add	r3, r3, #8
	str	r3, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-44]
	b	.L16
.L17:
	ldr	r3, [fp, #-60]
	add	r3, r3, #4
	ldr	r0, [r3]
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r3, .L33+16
	ldr	r2, [r3]
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	add	r4, r2, r3
	ldr	r2, [fp, #-44]
	bl	grep
	mov	r3, r0
	str	r3, [r4]
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	str	r3, [fp, #-44]
.L16:
	ldr	r2, [fp, #-44]
	ldr	r3, [fp, #-28]
	cmp	r2, r3
	blt	.L17
	mov	r0, #10
	bl	alarm
	mov	r3, #0
	str	r3, [fp, #-40]
	mvn	r3, #0
	str	r3, [fp, #-36]
	b	.L18
.L25:
	ldr	r3, [fp, #-48]
	and	r3, r3, #127
	cmp	r3, #0
	bne	.L19
	ldr	r3, [fp, #-48]
	asr	r3, r3, #8
	and	r3, r3, #255
	cmp	r3, #0
	beq	.L20
	cmp	r3, #1
	beq	.L21
	b	.L18
.L20:
	ldr	r1, [fp, #-20]
	ldr	r0, .L33+20
	bl	printf
	mov	r3, #1
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-20]
	str	r3, [fp, #-36]
	b	.L18
.L21:
	ldr	r1, [fp, #-20]
	ldr	r0, .L33+24
	bl	printf
	nop
	b	.L18
.L19:
	ldr	r1, [fp, #-20]
	ldr	r0, .L33+28
	bl	printf
.L18:
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	bne	.L24
	sub	r3, fp, #48
	mov	r0, r3
	bl	wait
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bgt	.L25
.L24:
	ldr	r3, [fp, #-40]
	cmp	r3, #1
	bne	.L26
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L27
.L30:
	ldr	r3, .L33+16
	ldr	r2, [r3]
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-36]
	cmp	r2, r3
	beq	.L28
	ldr	r3, .L33+16
	ldr	r2, [r3]
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L33+32
	bl	printf
	ldr	r3, .L33+16
	ldr	r2, [r3]
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, #9
	mov	r0, r3
	bl	kill
	ldr	r3, .L33+16
	ldr	r2, [r3]
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	sub	r1, fp, #48
	mov	r2, #0
	mov	r0, r3
	bl	waitpid
	ldr	r3, [fp, #-48]
	and	r3, r3, #127
	cmp	r3, #0
	beq	.L29
	ldr	r3, .L33+16
	ldr	r2, [r3]
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L33+28
	bl	printf
	b	.L28
.L29:
	ldr	r3, .L33+16
	ldr	r2, [r3]
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L33+36
	bl	printf
.L28:
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L27:
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-28]
	cmp	r2, r3
	blt	.L30
.L26:
	ldr	r3, .L33+16
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	moveq	r3, #1
	movne	r3, #0
	and	r3, r3, #255
.L31:
	ldr	r2, .L33
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L32
	bl	__stack_chk_fail
.L32:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L34:
	.align	2
.L33:
	.word	.LC10
	.word	.LC4
	.word	timeout_handler
	.word	pidsCount
	.word	pids
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
