	.file	"975790.c"
	.intel_syntax noprefix
	.text
	.globl	error_message
	.data
	.align 16
	.type	error_message, @object
	.size	error_message, 30
error_message:
	.string	"An error has occurred\n"
	.zero	7
	.globl	processes
	.bss
	.align 32
	.type	processes, @object
	.size	processes, 80
processes:
	.zero	80
	.globl	curr_process_index
	.align 4
	.type	curr_process_index, @object
	.size	curr_process_index, 4
curr_process_index:
	.zero	4
	.section	.rodata
.LC0:
	.string	" \n\t"
	.text
	.globl	pipefunc
	.type	pipefunc, @function
pipefunc:
.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	QWORD PTR -56[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -16[rbp]
	mov	rdi, rax
	call	pipe@PLT
	call	fork@PLT
	mov	DWORD PTR -40[rbp], eax
	cmp	DWORD PTR -40[rbp], 0
	jne	.L2
	mov	eax, DWORD PTR -16[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, 1
	mov	edi, eax
	call	dup2@PLT
	mov	rax, QWORD PTR -56[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR -56[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	execvp@PLT
	test	eax, eax
	je	.L3
	lea	rdi, error_message[rip]
	call	strlen@PLT
	mov	rdx, rax
	lea	rsi, error_message[rip]
	mov	edi, 2
	call	write@PLT
	call	getpid@PLT
	mov	esi, 2
	mov	edi, eax
	call	kill@PLT
.L3:
	mov	edi, 0
	call	exit@PLT
.L2:
	call	fork@PLT
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], 0
	jne	.L4
	mov	edi, 512
	call	malloc@PLT
	mov	QWORD PTR -32[rbp], rax
	mov	DWORD PTR -44[rbp], 0
	jmp	.L5
.L8:
	mov	edi, 128
	call	malloc@PLT
	mov	QWORD PTR -24[rbp], rax
	lea	rsi, .LC0[rip]
	mov	edi, 0
	call	strtok@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L6
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR [rdx], rax
	jmp	.L7
.L6:
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR [rdx], rax
	add	DWORD PTR -44[rbp], 1
.L5:
	cmp	DWORD PTR -44[rbp], 255
	jle	.L8
.L7:
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	jne	.L9
	lea	rdi, error_message[rip]
	call	strlen@PLT
	mov	rdx, rax
	lea	rsi, error_message[rip]
	mov	edi, 2
	call	write@PLT
	call	getpid@PLT
	mov	esi, 2
	mov	edi, eax
	call	kill@PLT
.L9:
	mov	eax, DWORD PTR -12[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, 0
	mov	edi, eax
	call	dup2@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
	test	eax, eax
	je	.L10
	lea	rdi, error_message[rip]
	call	strlen@PLT
	mov	rdx, rax
	lea	rsi, error_message[rip]
	mov	edi, 2
	call	write@PLT
	call	getpid@PLT
	mov	esi, 2
	mov	edi, eax
	call	kill@PLT
.L10:
	mov	edi, 0
	call	exit@PLT
.L4:
	mov	eax, DWORD PTR -12[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -16[rbp]
	mov	edi, eax
	call	close@PLT
	mov	edx, 0
	mov	esi, 0
	mov	edi, -1
	call	waitpid@PLT
	mov	eax, DWORD PTR -40[rbp]
	mov	edx, 1
	mov	esi, 0
	mov	edi, eax
	call	waitpid@PLT
	test	eax, eax
	jne	.L11
	mov	eax, DWORD PTR -40[rbp]
	mov	esi, 9
	mov	edi, eax
	call	kill@PLT
.L11:
	mov	edx, 0
	mov	esi, 0
	mov	edi, -1
	call	waitpid@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	pipefunc, .-pipefunc
	.section	.rodata
.LC1:
	.string	"HOME"
	.text
	.globl	cdfunc
	.type	cdfunc, @function
cdfunc:
.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, 16
	lea	rsi, .LC0[rip]
	mov	edi, 0
	call	strtok@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	jne	.L14
	lea	rdi, .LC1[rip]
	call	getenv@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	chdir@PLT
	jmp	.L18
.L14:
	mov	rax, QWORD PTR -16[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 47
	jne	.L16
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	chdir@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	chdir@PLT
	cmp	eax, -1
	jne	.L18
	lea	rdi, error_message[rip]
	call	strlen@PLT
	mov	rdx, rax
	lea	rsi, error_message[rip]
	mov	edi, 2
	call	write@PLT
	jmp	.L18
.L16:
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	WORD PTR [rax], 12078
	mov	BYTE PTR 2[rax], 0
	mov	rdx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcat@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	chdir@PLT
	cmp	eax, -1
	jne	.L17
	lea	rdi, error_message[rip]
	call	strlen@PLT
	mov	rdx, rax
	lea	rsi, error_message[rip]
	mov	edi, 2
	call	write@PLT
.L17:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
.L18:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	cdfunc, .-cdfunc
	.globl	pwdfunc
	.type	pwdfunc, @function
pwdfunc:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	edi, 124
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	lea	rsi, .LC0[rip]
	mov	edi, 0
	call	strtok@PLT
	test	rax, rax
	je	.L20
	lea	rdi, error_message[rip]
	call	strlen@PLT
	mov	rdx, rax
	lea	rsi, error_message[rip]
	mov	edi, 2
	call	write@PLT
	jmp	.L19
.L20:
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, 124
	mov	rdi, rax
	call	getcwd@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	puts@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	pwdfunc, .-pwdfunc
	.section	.rodata
.LC2:
	.string	" \n"
.LC3:
	.string	">"
.LC4:
	.string	"<"
.LC5:
	.string	"|"
.LC6:
	.string	"&"
	.text
	.globl	execfunc
	.type	execfunc, @function
execfunc:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 80
	mov	QWORD PTR -72[rbp], rdi
	mov	DWORD PTR -56[rbp], 0
	mov	DWORD PTR -52[rbp], 0
	mov	DWORD PTR -48[rbp], 0
	mov	DWORD PTR -44[rbp], 0
	mov	edi, 128
	call	malloc@PLT
	mov	QWORD PTR -32[rbp], rax
	mov	edi, 128
	call	malloc@PLT
	mov	QWORD PTR -24[rbp], rax
	mov	edi, 512
	call	malloc@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	rdx, QWORD PTR -72[rbp]
	mov	QWORD PTR [rax], rdx
	mov	DWORD PTR -60[rbp], 1
	jmp	.L23
.L34:
	mov	edi, 128
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	lea	rsi, .LC2[rip]
	mov	edi, 0
	call	strtok@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L24
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -16[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR [rdx], rax
	jmp	.L25
.L24:
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L26
	mov	DWORD PTR -56[rbp], 1
	lea	rsi, .LC0[rip]
	mov	edi, 0
	call	strtok@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L27
	lea	rdi, error_message[rip]
	call	strlen@PLT
	mov	rdx, rax
	lea	rsi, error_message[rip]
	mov	edi, 2
	call	write@PLT
	jmp	.L22
.L26:
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L29
	mov	DWORD PTR -52[rbp], 1
	lea	rsi, .LC0[rip]
	mov	edi, 0
	call	strtok@PLT
	mov	QWORD PTR -32[rbp], rax
	cmp	QWORD PTR -32[rbp], 0
	jne	.L27
	lea	rdi, error_message[rip]
	call	strlen@PLT
	mov	rdx, rax
	lea	rsi, error_message[rip]
	mov	edi, 2
	call	write@PLT
	jmp	.L22
.L29:
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L30
	mov	DWORD PTR -48[rbp], 1
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rdx
	mov	QWORD PTR [rax], 0
	jmp	.L25
.L30:
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L31
	mov	DWORD PTR -44[rbp], 1
	jmp	.L27
.L31:
	cmp	DWORD PTR -52[rbp], 1
	je	.L32
	cmp	DWORD PTR -56[rbp], 1
	jne	.L33
.L32:
	lea	rdi, error_message[rip]
	call	strlen@PLT
	mov	rdx, rax
	lea	rsi, error_message[rip]
	mov	edi, 2
	call	write@PLT
	jmp	.L22
.L33:
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -16[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR [rdx], rax
.L27:
	add	DWORD PTR -60[rbp], 1
.L23:
	cmp	DWORD PTR -60[rbp], 255
	jle	.L34
.L25:
	cmp	DWORD PTR -48[rbp], 1
	jne	.L35
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	pipefunc
	jmp	.L22
.L35:
	call	fork@PLT
	mov	DWORD PTR -40[rbp], eax
	cmp	DWORD PTR -40[rbp], 0
	jne	.L36
	cmp	DWORD PTR -56[rbp], 1
	jne	.L37
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, 384
	mov	esi, 577
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -36[rbp], eax
	mov	eax, DWORD PTR -36[rbp]
	mov	esi, 1
	mov	edi, eax
	call	dup2@PLT
	mov	eax, DWORD PTR -36[rbp]
	mov	edi, eax
	call	close@PLT
.L37:
	cmp	DWORD PTR -52[rbp], 1
	jne	.L38
	mov	rax, QWORD PTR -32[rbp]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], -1
	jne	.L39
	lea	rdi, error_message[rip]
	call	strlen@PLT
	mov	rdx, rax
	lea	rsi, error_message[rip]
	mov	edi, 2
	call	write@PLT
	mov	edi, 0
	call	exit@PLT
.L39:
	mov	eax, DWORD PTR -36[rbp]
	mov	esi, 0
	mov	edi, eax
	call	dup2@PLT
	mov	eax, DWORD PTR -36[rbp]
	mov	edi, eax
	call	close@PLT
.L38:
	mov	rdx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -72[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	execvp@PLT
	test	eax, eax
	je	.L40
	lea	rdi, error_message[rip]
	call	strlen@PLT
	mov	rdx, rax
	lea	rsi, error_message[rip]
	mov	edi, 2
	call	write@PLT
	call	getpid@PLT
	mov	esi, 2
	mov	edi, eax
	call	kill@PLT
.L40:
	cmp	DWORD PTR -44[rbp], 0
	jne	.L22
	mov	edi, 0
	call	exit@PLT
.L36:
	cmp	DWORD PTR -44[rbp], 0
	jne	.L41
	mov	eax, DWORD PTR -40[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	waitpid@PLT
	jmp	.L22
.L41:
	mov	eax, DWORD PTR curr_process_index[rip]
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rdx, processes[rip]
	mov	eax, DWORD PTR -40[rbp]
	mov	DWORD PTR [rcx+rdx], eax
	mov	eax, DWORD PTR curr_process_index[rip]
	add	eax, 1
	mov	DWORD PTR curr_process_index[rip], eax
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	execfunc, .-execfunc
	.globl	exitfunc
	.type	exitfunc, @function
exitfunc:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	DWORD PTR -4[rbp], 0
	jmp	.L43
.L44:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, processes[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	esi, 9
	mov	edi, eax
	call	kill@PLT
	add	DWORD PTR -4[rbp], 1
.L43:
	mov	eax, DWORD PTR curr_process_index[rip]
	cmp	DWORD PTR -4[rbp], eax
	jl	.L44
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE10:
	.size	exitfunc, .-exitfunc
	.globl	cleanup
	.type	cleanup, @function
cleanup:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	DWORD PTR -8[rbp], 0
	jmp	.L46
.L50:
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, processes[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	edx, 1
	mov	esi, 0
	mov	edi, eax
	call	waitpid@PLT
	test	eax, eax
	je	.L47
	mov	eax, DWORD PTR -8[rbp]
	add	eax, 1
	mov	DWORD PTR -4[rbp], eax
	jmp	.L48
.L49:
	mov	eax, DWORD PTR -4[rbp]
	lea	ecx, -1[rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, processes[rip]
	mov	eax, DWORD PTR [rdx+rax]
	movsx	rdx, ecx
	lea	rcx, 0[0+rdx*4]
	lea	rdx, processes[rip]
	mov	DWORD PTR [rcx+rdx], eax
	add	DWORD PTR -4[rbp], 1
.L48:
	mov	eax, DWORD PTR curr_process_index[rip]
	cmp	DWORD PTR -4[rbp], eax
	jl	.L49
	mov	eax, DWORD PTR curr_process_index[rip]
	sub	eax, 1
	mov	DWORD PTR curr_process_index[rip], eax
.L47:
	add	DWORD PTR -8[rbp], 1
.L46:
	mov	eax, DWORD PTR curr_process_index[rip]
	cmp	DWORD PTR -8[rbp], eax
	jl	.L50
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	cleanup, .-cleanup
	.section	.rodata
.LC7:
	.string	"mysh (%d)> "
.LC8:
	.string	"exit"
.LC9:
	.string	"cd"
.LC10:
	.string	"pwd"
	.text
	.globl	main
	.type	main, @function
main:
.LFB12:
	.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	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	cmp	DWORD PTR -36[rbp], 1
	jle	.L52
	lea	rdi, error_message[rip]
	call	strlen@PLT
	mov	rdx, rax
	lea	rsi, error_message[rip]
	mov	edi, 2
	call	write@PLT
	mov	edi, 1
	call	exit@PLT
.L52:
	mov	DWORD PTR -20[rbp], 1
.L60:
	mov	edi, 1000
	call	malloc@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	mov	rdx, QWORD PTR stdin[rip]
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, 1000
	mov	rdi, rax
	call	fgets@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	strlen@PLT
	cmp	rax, 129
	jbe	.L53
	lea	rdi, error_message[rip]
	call	strlen@PLT
	mov	rdx, rax
	lea	rsi, error_message[rip]
	mov	edi, 2
	call	write@PLT
	add	DWORD PTR -20[rbp], 1
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	free@PLT
	jmp	.L54
.L53:
	mov	rax, QWORD PTR -16[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	strtok@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	je	.L61
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L56
	mov	eax, 0
	call	exitfunc
	jmp	.L57
.L56:
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L58
	mov	eax, 0
	call	cdfunc
	jmp	.L57
.L58:
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC10[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L59
	mov	eax, 0
	call	pwdfunc
	jmp	.L57
.L59:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	execfunc
.L57:
	mov	eax, 0
	call	cleanup
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	free@PLT
	add	DWORD PTR -20[rbp], 1
	jmp	.L60
.L61:
	nop
.L54:
	jmp	.L60
	.cfi_endproc
.LFE12:
	.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	"975790.c"
	.text
	.global	error_message
	.data
	.align	2
	.type	error_message, %object
	.size	error_message, 30
error_message:
	.ascii	"An error has occurred\012\000"
	.space	7
	.comm	processes,80,4
	.global	curr_process_index
	.bss
	.align	2
	.type	curr_process_index, %object
	.size	curr_process_index, 4
curr_process_index:
	.space	4
	.section	.rodata
	.align	2
.LC0:
	.ascii	" \012\011\000"
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	pipefunc
	.syntax unified
	.arm
	.fpu softvfp
	.type	pipefunc, %function
pipefunc:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-40]
	ldr	r3, .L13
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #16
	mov	r0, r3
	bl	pipe
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L2
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-12]
	mov	r1, #1
	mov	r0, r3
	bl	dup2
	ldr	r3, [fp, #-40]
	ldr	r3, [r3]
	ldr	r1, [fp, #-40]
	mov	r0, r3
	bl	execvp
	mov	r3, r0
	cmp	r3, #0
	beq	.L3
	ldr	r0, .L13+4
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L13+4
	mov	r0, #2
	bl	write
	bl	getpid
	mov	r3, r0
	mov	r1, #2
	mov	r0, r3
	bl	kill
.L3:
	mov	r0, #0
	bl	exit
.L2:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L4
	mov	r0, #256
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L5
.L8:
	mov	r0, #128
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r1, .L13+8
	mov	r0, #0
	bl	strtok
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L6
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r2, [fp, #-20]
	str	r2, [r3]
	b	.L7
.L6:
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r2, [fp, #-20]
	str	r2, [r3]
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L5:
	ldr	r3, [fp, #-36]
	cmp	r3, #255
	ble	.L8
.L7:
	ldr	r3, [fp, #-24]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L9
	ldr	r0, .L13+4
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L13+4
	mov	r0, #2
	bl	write
	bl	getpid
	mov	r3, r0
	mov	r1, #2
	mov	r0, r3
	bl	kill
.L9:
	ldr	r3, [fp, #-12]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-16]
	mov	r1, #0
	mov	r0, r3
	bl	dup2
	ldr	r3, [fp, #-24]
	ldr	r3, [r3]
	ldr	r1, [fp, #-24]
	mov	r0, r3
	bl	execvp
	mov	r3, r0
	cmp	r3, #0
	beq	.L10
	ldr	r0, .L13+4
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L13+4
	mov	r0, #2
	bl	write
	bl	getpid
	mov	r3, r0
	mov	r1, #2
	mov	r0, r3
	bl	kill
.L10:
	mov	r0, #0
	bl	exit
.L4:
	ldr	r3, [fp, #-12]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	close
	mov	r2, #0
	mov	r1, #0
	mvn	r0, #0
	bl	waitpid
	mov	r2, #1
	mov	r1, #0
	ldr	r0, [fp, #-32]
	bl	waitpid
	mov	r3, r0
	cmp	r3, #0
	bne	.L11
	mov	r1, #9
	ldr	r0, [fp, #-32]
	bl	kill
.L11:
	mov	r2, #0
	mov	r1, #0
	mvn	r0, #0
	bl	waitpid
	nop
	ldr	r3, .L13
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L12
	bl	__stack_chk_fail
.L12:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L14:
	.align	2
.L13:
	.word	.LC1
	.word	error_message
	.word	.LC0
	.size	pipefunc, .-pipefunc
	.section	.rodata
	.align	2
.LC2:
	.ascii	"HOME\000"
	.align	2
.LC3:
	.ascii	"./\000"
	.text
	.align	2
	.global	cdfunc
	.syntax unified
	.arm
	.fpu softvfp
	.type	cdfunc, %function
cdfunc:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	ldr	r1, .L21
	mov	r0, #0
	bl	strtok
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L16
	ldr	r0, .L21+4
	bl	getenv
	str	r0, [fp, #-12]
	ldr	r0, [fp, #-12]
	bl	chdir
	b	.L20
.L16:
	ldr	r3, [fp, #-12]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #47
	bne	.L18
	ldr	r0, [fp, #-12]
	bl	chdir
	ldr	r0, [fp, #-12]
	bl	chdir
	mov	r3, r0
	cmn	r3, #1
	bne	.L20
	ldr	r0, .L21+8
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L21+8
	mov	r0, #2
	bl	write
	b	.L20
.L18:
	ldr	r0, [fp, #-12]
	bl	strlen
	mov	r3, r0
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r0, [fp, #-8]
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-8]
	add	r3, r3, r2
	ldr	r2, .L21+12
	mov	r0, r3
	mov	r1, r2
	mov	r3, #3
	mov	r2, r3
	bl	memcpy
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-8]
	bl	strcat
	ldr	r0, [fp, #-8]
	bl	chdir
	mov	r3, r0
	cmn	r3, #1
	bne	.L19
	ldr	r0, .L21+8
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L21+8
	mov	r0, #2
	bl	write
.L19:
	ldr	r0, [fp, #-8]
	bl	free
.L20:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L22:
	.align	2
.L21:
	.word	.LC0
	.word	.LC2
	.word	error_message
	.word	.LC3
	.size	cdfunc, .-cdfunc
	.align	2
	.global	pwdfunc
	.syntax unified
	.arm
	.fpu softvfp
	.type	pwdfunc, %function
pwdfunc:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	mov	r0, #124
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r1, .L26
	mov	r0, #0
	bl	strtok
	mov	r3, r0
	cmp	r3, #0
	beq	.L24
	ldr	r0, .L26+4
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L26+4
	mov	r0, #2
	bl	write
	b	.L23
.L24:
	mov	r1, #124
	ldr	r0, [fp, #-8]
	bl	getcwd
	ldr	r0, [fp, #-8]
	bl	puts
	ldr	r0, [fp, #-8]
	bl	free
.L23:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L27:
	.align	2
.L26:
	.word	.LC0
	.word	error_message
	.size	pwdfunc, .-pwdfunc
	.section	.rodata
	.align	2
.LC4:
	.ascii	" \012\000"
	.align	2
.LC5:
	.ascii	">\000"
	.align	2
.LC6:
	.ascii	"<\000"
	.align	2
.LC7:
	.ascii	"|\000"
	.align	2
.LC8:
	.ascii	"&\000"
	.text
	.align	2
	.global	execfunc
	.syntax unified
	.arm
	.fpu softvfp
	.type	execfunc, %function
execfunc:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #56
	str	r0, [fp, #-56]
	mov	r3, #0
	str	r3, [fp, #-44]
	mov	r3, #0
	str	r3, [fp, #-40]
	mov	r3, #0
	str	r3, [fp, #-36]
	mov	r3, #0
	str	r3, [fp, #-32]
	mov	r0, #128
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-28]
	mov	r0, #128
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-24]
	mov	r0, #256
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-56]
	str	r2, [r3]
	mov	r3, #1
	str	r3, [fp, #-48]
	b	.L29
.L40:
	mov	r0, #128
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r1, .L48
	mov	r0, #0
	bl	strtok
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L30
	ldr	r3, [fp, #-48]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r2, [fp, #-16]
	str	r2, [r3]
	b	.L31
.L30:
	ldr	r1, .L48+4
	ldr	r0, [fp, #-16]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L32
	mov	r3, #1
	str	r3, [fp, #-44]
	ldr	r1, .L48+8
	mov	r0, #0
	bl	strtok
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L33
	ldr	r0, .L48+12
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L48+12
	mov	r0, #2
	bl	write
	b	.L28
.L32:
	ldr	r1, .L48+16
	ldr	r0, [fp, #-16]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L35
	mov	r3, #1
	str	r3, [fp, #-40]
	ldr	r1, .L48+8
	mov	r0, #0
	bl	strtok
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L33
	ldr	r0, .L48+12
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L48+12
	mov	r0, #2
	bl	write
	b	.L28
.L35:
	ldr	r1, .L48+20
	ldr	r0, [fp, #-16]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L36
	mov	r3, #1
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-48]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3]
	b	.L31
.L36:
	ldr	r1, .L48+24
	ldr	r0, [fp, #-16]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L37
	mov	r3, #1
	str	r3, [fp, #-32]
	b	.L33
.L37:
	ldr	r3, [fp, #-40]
	cmp	r3, #1
	beq	.L38
	ldr	r3, [fp, #-44]
	cmp	r3, #1
	bne	.L39
.L38:
	ldr	r0, .L48+12
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L48+12
	mov	r0, #2
	bl	write
	b	.L28
.L39:
	ldr	r3, [fp, #-48]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r2, [fp, #-16]
	str	r2, [r3]
.L33:
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	str	r3, [fp, #-48]
.L29:
	ldr	r3, [fp, #-48]
	cmp	r3, #255
	ble	.L40
.L31:
	ldr	r3, [fp, #-36]
	cmp	r3, #1
	bne	.L41
	ldr	r0, [fp, #-20]
	bl	pipefunc
	b	.L28
.L41:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L42
	ldr	r3, [fp, #-44]
	cmp	r3, #1
	bne	.L43
	mov	r2, #384
	ldr	r1, .L48+28
	ldr	r0, [fp, #-24]
	bl	open
	str	r0, [fp, #-8]
	mov	r1, #1
	ldr	r0, [fp, #-8]
	bl	dup2
	ldr	r0, [fp, #-8]
	bl	close
.L43:
	ldr	r3, [fp, #-40]
	cmp	r3, #1
	bne	.L44
	mov	r1, #0
	ldr	r0, [fp, #-28]
	bl	open
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L45
	ldr	r0, .L48+12
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L48+12
	mov	r0, #2
	bl	write
	mov	r0, #0
	bl	exit
.L45:
	mov	r1, #0
	ldr	r0, [fp, #-8]
	bl	dup2
	ldr	r0, [fp, #-8]
	bl	close
.L44:
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-56]
	bl	execvp
	mov	r3, r0
	cmp	r3, #0
	beq	.L46
	ldr	r0, .L48+12
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L48+12
	mov	r0, #2
	bl	write
	bl	getpid
	mov	r3, r0
	mov	r1, #2
	mov	r0, r3
	bl	kill
.L46:
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L28
	mov	r0, #0
	bl	exit
.L42:
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L47
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-12]
	bl	waitpid
	b	.L28
.L47:
	ldr	r3, .L48+32
	ldr	r3, [r3]
	ldr	r1, .L48+36
	ldr	r2, [fp, #-12]
	str	r2, [r1, r3, lsl #2]
	ldr	r3, .L48+32
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L48+32
	str	r3, [r2]
.L28:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L49:
	.align	2
.L48:
	.word	.LC4
	.word	.LC5
	.word	.LC0
	.word	error_message
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	577
	.word	curr_process_index
	.word	processes
	.size	execfunc, .-execfunc
	.align	2
	.global	exitfunc
	.syntax unified
	.arm
	.fpu softvfp
	.type	exitfunc, %function
exitfunc:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L51
.L52:
	ldr	r2, .L53
	ldr	r3, [fp, #-8]
	ldr	r3, [r2, r3, lsl #2]
	mov	r1, #9
	mov	r0, r3
	bl	kill
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L51:
	ldr	r3, .L53+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L52
	mov	r0, #0
	bl	exit
.L54:
	.align	2
.L53:
	.word	processes
	.word	curr_process_index
	.size	exitfunc, .-exitfunc
	.align	2
	.global	cleanup
	.syntax unified
	.arm
	.fpu softvfp
	.type	cleanup, %function
cleanup:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L56
.L60:
	ldr	r2, .L61
	ldr	r3, [fp, #-12]
	ldr	r3, [r2, r3, lsl #2]
	mov	r2, #1
	mov	r1, #0
	mov	r0, r3
	bl	waitpid
	mov	r3, r0
	cmp	r3, #0
	beq	.L57
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-8]
	b	.L58
.L59:
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	ldr	r1, .L61
	ldr	r2, [fp, #-8]
	ldr	r2, [r1, r2, lsl #2]
	ldr	r1, .L61
	str	r2, [r1, r3, lsl #2]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L58:
	ldr	r3, .L61+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L59
	ldr	r3, .L61+4
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, .L61+4
	str	r3, [r2]
.L57:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L56:
	ldr	r3, .L61+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	blt	.L60
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L62:
	.align	2
.L61:
	.word	processes
	.word	curr_process_index
	.size	cleanup, .-cleanup
	.section	.rodata
	.align	2
.LC9:
	.ascii	"mysh (%d)> \000"
	.align	2
.LC10:
	.ascii	"exit\000"
	.align	2
.LC11:
	.ascii	"cd\000"
	.align	2
.LC12:
	.ascii	"pwd\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	ldr	r3, [fp, #-24]
	cmp	r3, #1
	ble	.L64
	ldr	r0, .L74
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L74
	mov	r0, #2
	bl	write
	mov	r0, #1
	bl	exit
.L64:
	mov	r3, #1
	str	r3, [fp, #-16]
.L72:
	mov	r0, #1000
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r1, [fp, #-16]
	ldr	r0, .L74+4
	bl	printf
	ldr	r3, .L74+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	ldr	r3, .L74+12
	ldr	r3, [r3]
	mov	r2, r3
	mov	r1, #1000
	ldr	r0, [fp, #-12]
	bl	fgets
	ldr	r0, [fp, #-12]
	bl	strlen
	mov	r3, r0
	cmp	r3, #129
	bls	.L65
	ldr	r0, .L74
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L74
	mov	r0, #2
	bl	write
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	ldr	r0, [fp, #-12]
	bl	free
	b	.L66
.L65:
	ldr	r1, .L74+16
	ldr	r0, [fp, #-12]
	bl	strtok
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L73
	ldr	r1, .L74+20
	ldr	r0, [fp, #-8]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L68
	bl	exitfunc
	b	.L69
.L68:
	ldr	r1, .L74+24
	ldr	r0, [fp, #-8]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L70
	bl	cdfunc
	b	.L69
.L70:
	ldr	r1, .L74+28
	ldr	r0, [fp, #-8]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L71
	bl	pwdfunc
	b	.L69
.L71:
	ldr	r0, [fp, #-8]
	bl	execfunc
.L69:
	bl	cleanup
	ldr	r0, [fp, #-12]
	bl	free
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	b	.L72
.L73:
	nop
.L66:
	b	.L72
.L75:
	.align	2
.L74:
	.word	error_message
	.word	.LC9
	.word	stdout
	.word	stdin
	.word	.LC0
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
