	.file	"43888076.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"Usage: %s <commands.txt> <flag>\n\n"
	.align 8
.LC1:
	.string	"Flag can be 0 (use system) or 1 (use exec*)\n"
.LC2:
	.string	"r"
	.align 8
.LC3:
	.string	"Error while opening %s. Exiting\n"
	.align 8
.LC4:
	.string	"Incorrect flag,run the program with no arguments for help\n"
.LC5:
	.string	" "
.LC6:
	.string	"Exec error: %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
	push	rbx
	sub	rsp, 104
	.cfi_offset 3, -24
	mov	DWORD PTR -100[rbp], edi
	mov	QWORD PTR -112[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -76[rbp], 100
	cmp	DWORD PTR -100[rbp], 2
	jg	.L2
	mov	rax, QWORD PTR -112[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stdout[rip]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rcx, rax
	mov	edx, 44
	mov	esi, 1
	lea	rdi, .LC1[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	rax, QWORD PTR -112[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -48[rbp], rax
	cmp	QWORD PTR -48[rbp], 0
	jne	.L3
	mov	rax, QWORD PTR -112[rbp]
	add	rax, 8
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stdout[rip]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	rax, QWORD PTR -112[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -72[rbp], eax
	cmp	DWORD PTR -72[rbp], 0
	js	.L4
	cmp	DWORD PTR -72[rbp], 1
	jle	.L5
.L4:
	mov	rax, QWORD PTR stdout[rip]
	mov	rcx, rax
	mov	edx, 58
	mov	esi, 1
	lea	rdi, .LC4[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	mov	edi, 2048
	call	malloc@PLT
	mov	QWORD PTR -40[rbp], rax
	mov	eax, DWORD PTR -76[rbp]
	cdqe
	sal	rax, 3
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -64[rbp], rax
	mov	DWORD PTR -88[rbp], 0
	jmp	.L6
.L7:
	mov	eax, DWORD PTR -88[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -64[rbp]
	lea	rbx, [rdx+rax]
	mov	edi, 2048
	call	malloc@PLT
	mov	QWORD PTR [rbx], rax
	add	DWORD PTR -88[rbp], 1
.L6:
	mov	eax, DWORD PTR -88[rbp]
	cmp	eax, DWORD PTR -76[rbp]
	jl	.L7
	mov	DWORD PTR -80[rbp], 0
	jmp	.L8
.L11:
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR -68[rbp], eax
	mov	eax, DWORD PTR -68[rbp]
	sub	eax, 5
	movsx	rdx, eax
	mov	eax, DWORD PTR -80[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -64[rbp]
	add	rax, rcx
	mov	rax, QWORD PTR [rax]
	mov	rcx, QWORD PTR -40[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	strncpy@PLT
	add	DWORD PTR -80[rbp], 1
	mov	eax, DWORD PTR -80[rbp]
	cmp	eax, DWORD PTR -76[rbp]
	jl	.L8
	sal	DWORD PTR -76[rbp]
	mov	eax, DWORD PTR -76[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -64[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	realloc@PLT
	mov	QWORD PTR -64[rbp], rax
	mov	eax, DWORD PTR -80[rbp]
	mov	DWORD PTR -88[rbp], eax
	jmp	.L9
.L10:
	mov	eax, DWORD PTR -88[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -64[rbp]
	lea	rbx, [rdx+rax]
	mov	edi, 2048
	call	malloc@PLT
	mov	QWORD PTR [rbx], rax
	add	DWORD PTR -88[rbp], 1
.L9:
	mov	eax, DWORD PTR -88[rbp]
	cmp	eax, DWORD PTR -76[rbp]
	jl	.L10
.L8:
	mov	rdx, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	esi, 2047
	mov	rdi, rax
	call	fgets@PLT
	test	rax, rax
	jne	.L11
	cmp	DWORD PTR -72[rbp], 0
	jne	.L12
	mov	DWORD PTR -88[rbp], 0
	jmp	.L13
.L14:
	mov	eax, DWORD PTR -88[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -64[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	system@PLT
	add	DWORD PTR -88[rbp], 1
.L13:
	mov	eax, DWORD PTR -88[rbp]
	cmp	eax, DWORD PTR -80[rbp]
	jl	.L14
	jmp	.L15
.L12:
	cmp	DWORD PTR -72[rbp], 1
	jne	.L15
	mov	edi, 16384
	call	malloc@PLT
	mov	QWORD PTR -32[rbp], rax
	mov	DWORD PTR -88[rbp], 0
	jmp	.L16
.L21:
	mov	DWORD PTR -84[rbp], 0
	mov	eax, DWORD PTR -88[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -64[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	call	strtok@PLT
	mov	QWORD PTR -56[rbp], rax
	jmp	.L17
.L18:
	mov	eax, DWORD PTR -84[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -56[rbp]
	mov	QWORD PTR [rdx], rax
	lea	rsi, .LC5[rip]
	mov	edi, 0
	call	strtok@PLT
	mov	QWORD PTR -56[rbp], rax
	add	DWORD PTR -84[rbp], 1
.L17:
	cmp	QWORD PTR -56[rbp], 0
	jne	.L18
	mov	eax, DWORD PTR -84[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	QWORD PTR [rax], 0
	call	fork@PLT
	test	eax, eax
	je	.L19
	lea	rax, -92[rbp]
	mov	rdi, rax
	call	wait@PLT
	jmp	.L26
.L19:
	mov	edi, 3
	call	sleep@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR -32[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	execvp@PLT
	call	__errno_location@PLT
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR stdout[rip]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 0
	call	exit@PLT
.L26:
	add	DWORD PTR -88[rbp], 1
.L16:
	mov	eax, DWORD PTR -88[rbp]
	cmp	eax, DWORD PTR -80[rbp]
	jl	.L21
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	free@PLT
.L15:
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	DWORD PTR -88[rbp], 0
	jmp	.L22
.L23:
	mov	eax, DWORD PTR -88[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -64[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	free@PLT
	add	DWORD PTR -88[rbp], 1
.L22:
	mov	eax, DWORD PTR -88[rbp]
	cmp	eax, DWORD PTR -76[rbp]
	jl	.L23
	mov	rax, QWORD PTR -64[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	eax, 0
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	mov	rbx, QWORD PTR -8[rbp]
	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	"43888076.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: %s <commands.txt> <flag>\012\012\000"
	.align	2
.LC1:
	.ascii	"Flag can be 0 (use system) or 1 (use exec*)\012\000"
	.align	2
.LC2:
	.ascii	"r\000"
	.align	2
.LC3:
	.ascii	"Error while opening %s. Exiting\012\000"
	.align	2
.LC4:
	.ascii	"Incorrect flag,run the program with no arguments fo"
	.ascii	"r help\012\000"
	.align	2
.LC5:
	.ascii	" \000"
	.align	2
.LC6:
	.ascii	"Exec error: %d\012\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 = 64
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #68
	str	r0, [fp, #-72]
	str	r1, [fp, #-76]
	ldr	r3, .L27
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #100
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-72]
	cmp	r3, #2
	bgt	.L2
	ldr	r3, .L27+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-76]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L27+8
	bl	fprintf
	ldr	r3, .L27+4
	ldr	r3, [r3]
	mov	r2, #44
	mov	r1, #1
	ldr	r0, .L27+12
	bl	fwrite
	mov	r0, #1
	bl	exit
.L2:
	ldr	r3, [fp, #-76]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L27+16
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	bne	.L3
	ldr	r3, .L27+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-76]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L27+20
	bl	fprintf
	mov	r0, #1
	bl	exit
.L3:
	ldr	r3, [fp, #-76]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	blt	.L4
	ldr	r3, [fp, #-32]
	cmp	r3, #1
	ble	.L5
.L4:
	ldr	r3, .L27+4
	ldr	r3, [r3]
	mov	r2, #58
	mov	r1, #1
	ldr	r0, .L27+24
	bl	fwrite
	mov	r0, #1
	bl	exit
.L5:
	mov	r0, #2048
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-60]
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L6
.L7:
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-60]
	add	r4, r2, r3
	mov	r0, #2048
	bl	malloc
	mov	r3, r0
	str	r3, [r4]
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L6:
	ldr	r2, [fp, #-52]
	ldr	r3, [fp, #-40]
	cmp	r2, r3
	blt	.L7
	mov	r3, #0
	str	r3, [fp, #-44]
	b	.L8
.L11:
	ldr	r0, [fp, #-28]
	bl	strlen
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-60]
	add	r3, r2, r3
	ldr	r0, [r3]
	ldr	r3, [fp, #-20]
	sub	r3, r3, #5
	mov	r2, r3
	ldr	r1, [fp, #-28]
	bl	strncpy
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	str	r3, [fp, #-44]
	ldr	r2, [fp, #-44]
	ldr	r3, [fp, #-40]
	cmp	r2, r3
	blt	.L8
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #1
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-40]
	mov	r1, r3
	ldr	r0, [fp, #-60]
	bl	realloc
	str	r0, [fp, #-60]
	ldr	r3, [fp, #-44]
	str	r3, [fp, #-52]
	b	.L9
.L10:
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-60]
	add	r4, r2, r3
	mov	r0, #2048
	bl	malloc
	mov	r3, r0
	str	r3, [r4]
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L9:
	ldr	r2, [fp, #-52]
	ldr	r3, [fp, #-40]
	cmp	r2, r3
	blt	.L10
.L8:
	ldr	r2, [fp, #-36]
	ldr	r1, .L27+28
	ldr	r0, [fp, #-28]
	bl	fgets
	mov	r3, r0
	cmp	r3, #0
	bne	.L11
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L12
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L13
.L14:
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-60]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	system
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L13:
	ldr	r2, [fp, #-52]
	ldr	r3, [fp, #-44]
	cmp	r2, r3
	blt	.L14
	b	.L15
.L12:
	ldr	r3, [fp, #-32]
	cmp	r3, #1
	bne	.L15
	mov	r0, #8192
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L16
.L21:
	mov	r3, #0
	str	r3, [fp, #-48]
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-60]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r1, .L27+32
	mov	r0, r3
	bl	strtok
	str	r0, [fp, #-56]
	b	.L17
.L18:
	ldr	r3, [fp, #-48]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r2, [fp, #-56]
	str	r2, [r3]
	ldr	r1, .L27+32
	mov	r0, #0
	bl	strtok
	str	r0, [fp, #-56]
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	str	r3, [fp, #-48]
.L17:
	ldr	r3, [fp, #-56]
	cmp	r3, #0
	bne	.L18
	ldr	r3, [fp, #-48]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3]
	bl	fork
	mov	r3, r0
	cmp	r3, #0
	beq	.L19
	sub	r3, fp, #64
	mov	r0, r3
	bl	wait
	b	.L26
.L19:
	mov	r0, #3
	bl	sleep
	ldr	r3, [fp, #-24]
	ldr	r3, [r3]
	ldr	r1, [fp, #-24]
	mov	r0, r3
	bl	execvp
	ldr	r3, .L27+4
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L27+36
	mov	r0, r4
	bl	fprintf
	mov	r0, #0
	bl	exit
.L26:
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L16:
	ldr	r2, [fp, #-52]
	ldr	r3, [fp, #-44]
	cmp	r2, r3
	blt	.L21
	ldr	r0, [fp, #-24]
	bl	free
.L15:
	ldr	r0, [fp, #-28]
	bl	free
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L22
.L23:
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-60]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L22:
	ldr	r2, [fp, #-52]
	ldr	r3, [fp, #-40]
	cmp	r2, r3
	blt	.L23
	ldr	r0, [fp, #-60]
	bl	free
	mov	r3, #0
	ldr	r2, .L27
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L25
	bl	__stack_chk_fail
.L25:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L28:
	.align	2
.L27:
	.word	.LC7
	.word	stdout
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	2047
	.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
