	.file	"562101.c"
	.intel_syntax noprefix
	.text
	.globl	myargc
	.bss
	.align 4
	.type	myargc, @object
	.size	myargc, 4
myargc:
	.zero	4
	.globl	run_in_bg_flag
	.align 4
	.type	run_in_bg_flag, @object
	.size	run_in_bg_flag, 4
run_in_bg_flag:
	.zero	4
	.globl	rd_output
	.align 4
	.type	rd_output, @object
	.size	rd_output, 4
rd_output:
	.zero	4
	.globl	rd_output_append
	.align 4
	.type	rd_output_append, @object
	.size	rd_output_append, 4
rd_output_append:
	.zero	4
	.globl	rd_input
	.align 4
	.type	rd_input, @object
	.size	rd_input, 4
rd_input:
	.zero	4
	.globl	do_pipe
	.align 4
	.type	do_pipe, @object
	.size	do_pipe, 4
do_pipe:
	.zero	4
	.globl	rd_file
	.align 8
	.type	rd_file, @object
	.size	rd_file, 8
rd_file:
	.zero	8
	.section	.rodata
.LC0:
	.string	"\033[H\033[J"
	.text
	.globl	clear
	.type	clear, @function
clear:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	clear, .-clear
	.section	.rodata
.LC1:
	.string	"HOME"
.LC2:
	.string	"~"
.LC3:
	.string	"%s%s"
.LC4:
	.string	"myShell %s >> "
	.text
	.globl	print_dir
	.type	print_dir, @function
print_dir:
.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, 2080
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdi, .LC1[rip]
	call	getenv@PLT
	mov	QWORD PTR -2080[rbp], rax
	lea	rax, -2064[rbp]
	mov	esi, 1024
	mov	rdi, rax
	call	getcwd@PLT
	mov	rdx, QWORD PTR -2080[rbp]
	lea	rax, -2064[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strstr@PLT
	mov	QWORD PTR -2072[rbp], rax
	cmp	QWORD PTR -2072[rbp], 0
	je	.L3
	lea	rdx, -2064[rbp]
	mov	rax, QWORD PTR -2072[rbp]
	sub	rax, rdx
	mov	rdx, rax
	lea	rcx, -2064[rbp]
	lea	rax, -1040[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	strncpy@PLT
	lea	rdx, -2064[rbp]
	mov	rax, QWORD PTR -2072[rbp]
	sub	rax, rdx
	mov	BYTE PTR -1040[rbp+rax], 0
	mov	rax, QWORD PTR -2080[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, QWORD PTR -2072[rbp]
	add	rdx, rax
	lea	rcx, -2064[rbp]
	mov	rax, QWORD PTR -2072[rbp]
	sub	rax, rcx
	mov	rcx, rax
	lea	rax, -1040[rbp]
	add	rax, rcx
	mov	rcx, rdx
	lea	rdx, .LC2[rip]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	lea	rax, -1040[rbp]
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L6
.L3:
	lea	rax, -2064[rbp]
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
.L6:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	print_dir, .-print_dir
	.section	.rodata
.LC5:
	.string	"Enter a directory for cd"
	.text
	.globl	cd
	.type	cd, @function
cd:
.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	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	jne	.L8
	lea	rdi, .LC5[rip]
	call	puts@PLT
	jmp	.L11
.L8:
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L10
	lea	rdi, .LC1[rip]
	call	getenv@PLT
	mov	rdi, rax
	call	chdir@PLT
	jmp	.L11
.L10:
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	chdir@PLT
.L11:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	cd, .-cd
	.globl	pwd
	.type	pwd, @function
pwd:
.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, 1040
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -1040[rbp]
	mov	esi, 1024
	mov	rdi, rax
	call	getcwd@PLT
	mov	rdi, rax
	call	puts@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	pwd, .-pwd
	.section	.rodata
.LC6:
	.string	" \n\t\r\013\f"
.LC7:
	.string	"tokens allocation error"
.LC8:
	.string	">"
.LC9:
	.string	">>"
.LC10:
	.string	"<"
.LC11:
	.string	"|"
.LC12:
	.string	"&"
	.text
	.globl	parse_buffer
	.type	parse_buffer, @function
parse_buffer:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	edi, 64
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	call	strtok@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L16
	lea	rdi, .LC7[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L23:
	mov	rax, QWORD PTR -16[rbp]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L17
	mov	DWORD PTR rd_output[rip], 1
	jmp	.L18
.L17:
	mov	rax, QWORD PTR -16[rbp]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L19
	mov	DWORD PTR rd_output_append[rip], 1
	jmp	.L18
.L19:
	mov	rax, QWORD PTR -16[rbp]
	lea	rsi, .LC10[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L20
	mov	DWORD PTR rd_input[rip], 1
	jmp	.L18
.L20:
	mov	rax, QWORD PTR -16[rbp]
	lea	rsi, .LC11[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L21
	mov	DWORD PTR do_pipe[rip], 1
	jmp	.L18
.L21:
	mov	rax, QWORD PTR -16[rbp]
	lea	rsi, .LC12[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L18
	mov	DWORD PTR run_in_bg_flag[rip], 1
	jmp	.L22
.L18:
	mov	eax, DWORD PTR myargc[rip]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -8[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR [rdx], rax
	mov	eax, DWORD PTR myargc[rip]
	add	eax, 1
	mov	DWORD PTR myargc[rip], eax
	lea	rsi, .LC6[rip]
	mov	edi, 0
	call	strtok@PLT
	mov	QWORD PTR -16[rbp], rax
.L16:
	cmp	QWORD PTR -16[rbp], 0
	jne	.L23
.L22:
	mov	eax, DWORD PTR myargc[rip]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	QWORD PTR [rax], 0
	mov	rax, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	parse_buffer, .-parse_buffer
	.globl	count_argc
	.type	count_argc, @function
count_argc:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -4[rbp], 0
	jmp	.L26
.L27:
	add	DWORD PTR -4[rbp], 1
.L26:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	jne	.L27
	mov	eax, DWORD PTR -4[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	count_argc, .-count_argc
	.section	.rodata
.LC13:
	.string	"Fork error: fork() < 0\n"
.LC14:
	.string	"Execvp error\n"
	.text
	.globl	exe
	.type	exe, @function
exe:
.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, 64
	mov	QWORD PTR -56[rbp], rdi
	mov	DWORD PTR -60[rbp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	call	fork@PLT
	mov	DWORD PTR -24[rbp], eax
	cmp	DWORD PTR -24[rbp], 0
	jns	.L30
	lea	rdi, .LC13[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L43
.L30:
	cmp	DWORD PTR -24[rbp], 0
	jne	.L32
	mov	eax, DWORD PTR rd_output[rip]
	test	eax, eax
	je	.L33
	mov	DWORD PTR -36[rbp], 0
.L35:
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -56[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L34
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	add	rax, 1
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -56[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR rd_file[rip], rax
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -56[rbp]
	add	rax, rdx
	mov	QWORD PTR [rax], 0
	mov	rax, QWORD PTR rd_file[rip]
	mov	esi, 420
	mov	rdi, rax
	call	creat@PLT
	mov	DWORD PTR -20[rbp], eax
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, 1
	mov	edi, eax
	call	dup2@PLT
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	call	close@PLT
	jmp	.L33
.L34:
	add	DWORD PTR -36[rbp], 1
	jmp	.L35
.L33:
	mov	eax, DWORD PTR rd_output_append[rip]
	test	eax, eax
	je	.L36
	mov	DWORD PTR -32[rbp], 0
.L38:
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -56[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L37
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	add	rax, 1
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -56[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR rd_file[rip], rax
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -56[rbp]
	add	rax, rdx
	mov	QWORD PTR [rax], 0
	mov	rax, QWORD PTR rd_file[rip]
	mov	edx, 420
	mov	esi, 1089
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -16[rbp], eax
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, 1
	mov	edi, eax
	call	dup2@PLT
	mov	eax, DWORD PTR -16[rbp]
	mov	edi, eax
	call	close@PLT
	jmp	.L36
.L37:
	add	DWORD PTR -32[rbp], 1
	jmp	.L38
.L36:
	mov	eax, DWORD PTR rd_input[rip]
	test	eax, eax
	je	.L39
	mov	DWORD PTR -28[rbp], 0
.L41:
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -56[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC10[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L40
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	add	rax, 1
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -56[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR rd_file[rip], rax
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -56[rbp]
	add	rax, rdx
	mov	QWORD PTR [rax], 0
	mov	rax, QWORD PTR rd_file[rip]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, 0
	mov	edi, eax
	call	dup2@PLT
	mov	eax, DWORD PTR -12[rbp]
	mov	edi, eax
	call	close@PLT
	jmp	.L39
.L40:
	add	DWORD PTR -28[rbp], 1
	jmp	.L41
.L39:
	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
	lea	rdi, .LC14[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L43
.L32:
	mov	eax, DWORD PTR run_in_bg_flag[rip]
	test	eax, eax
	jne	.L42
	lea	rcx, -40[rbp]
	mov	eax, DWORD PTR -24[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	edi, eax
	call	waitpid@PLT
.L42:
	mov	eax, 0
.L43:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L44
	call	__stack_chk_fail@PLT
.L44:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	exe, .-exe
	.section	.rodata
.LC15:
	.string	"Pipe error\n"
	.text
	.globl	exe_pipe
	.type	exe_pipe, @function
exe_pipe:
.LFB13:
	.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 -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	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
	test	eax, eax
	jns	.L46
	lea	rdi, .LC15[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L46:
	call	fork@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], 0
	jne	.L47
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, 0
	mov	edi, eax
	call	dup2@PLT
	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	rax, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR -48[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	execvp@PLT
	lea	rdi, .LC14[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L54
.L47:
	cmp	DWORD PTR -20[rbp], 0
	jns	.L49
	lea	rdi, .LC13[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L54
.L49:
	mov	eax, DWORD PTR run_in_bg_flag[rip]
	test	eax, eax
	jne	.L50
	lea	rcx, -24[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	waitpid@PLT
.L50:
	call	fork@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], 0
	jne	.L51
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, 1
	mov	edi, eax
	call	dup2@PLT
	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	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR -40[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	execvp@PLT
	lea	rdi, .LC14[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L54
.L51:
	cmp	DWORD PTR -20[rbp], 0
	jns	.L52
	lea	rdi, .LC13[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L54
.L52:
	mov	eax, DWORD PTR run_in_bg_flag[rip]
	test	eax, eax
	jne	.L53
	lea	rcx, -24[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	waitpid@PLT
.L53:
	mov	eax, DWORD PTR -16[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -12[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
.L54:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L55
	call	__stack_chk_fail@PLT
.L55:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	exe_pipe, .-exe_pipe
	.section	.rodata
.LC16:
	.string	"\n"
.LC17:
	.string	"exit"
	.align 8
.LC18:
	.string	"Too many arguments. (Maximum number of arguments: 4)"
.LC19:
	.string	"cd"
.LC20:
	.string	"pwd"
.LC21:
	.string	"exe_pipe failed\n"
.LC22:
	.string	"exe failed"
	.text
	.globl	main
	.type	main, @function
main:
.LFB14:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 832
	mov	DWORD PTR -820[rbp], edi
	mov	QWORD PTR -832[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, 0
	call	clear
.L76:
	lea	rax, -272[rbp]
	mov	edx, 256
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	DWORD PTR myargc[rip], 0
	mov	DWORD PTR run_in_bg_flag[rip], 0
	mov	DWORD PTR rd_output[rip], 0
	mov	DWORD PTR rd_output_append[rip], 0
	mov	DWORD PTR rd_input[rip], 0
	mov	DWORD PTR do_pipe[rip], 0
	mov	QWORD PTR rd_file[rip], 0
	mov	eax, 0
	call	print_dir
	mov	rdx, QWORD PTR stdin[rip]
	lea	rax, -272[rbp]
	mov	esi, 256
	mov	rdi, rax
	call	fgets@PLT
	lea	rax, -272[rbp]
	lea	rsi, .LC16[rip]
	mov	rdi, rax
	call	strcspn@PLT
	mov	BYTE PTR -272[rbp+rax], 0
	lea	rax, -272[rbp]
	lea	rsi, .LC17[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L57
	mov	edi, 0
	call	exit@PLT
.L57:
	lea	rax, -272[rbp]
	mov	rdi, rax
	call	parse_buffer
	mov	QWORD PTR -792[rbp], rax
	mov	eax, DWORD PTR myargc[rip]
	cmp	eax, 4
	jle	.L58
	mov	eax, DWORD PTR do_pipe[rip]
	test	eax, eax
	jne	.L58
	lea	rdi, .LC18[rip]
	call	puts@PLT
	jmp	.L75
.L58:
	mov	rax, QWORD PTR -792[rbp]
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	je	.L78
	mov	rax, QWORD PTR -792[rbp]
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC19[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L61
	mov	rax, QWORD PTR -792[rbp]
	mov	rdi, rax
	call	cd
	jmp	.L76
.L61:
	mov	rax, QWORD PTR -792[rbp]
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC20[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L63
	mov	eax, 0
	call	pwd
	jmp	.L76
.L63:
	mov	eax, DWORD PTR do_pipe[rip]
	test	eax, eax
	je	.L64
	mov	DWORD PTR -808[rbp], 0
	mov	DWORD PTR -804[rbp], 0
	jmp	.L65
.L67:
	mov	eax, DWORD PTR -804[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -792[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rdx, rax
	lea	rax, .LC11[rip]
	mov	ecx, 2
	mov	rsi, rdx
	mov	rdi, rax
	repz cmpsb
	seta	al
	setb	dl
	sub	eax, edx
	movsx	eax, al
	test	eax, eax
	jne	.L66
	mov	eax, DWORD PTR -804[rbp]
	mov	DWORD PTR -808[rbp], eax
.L66:
	add	DWORD PTR -804[rbp], 1
.L65:
	mov	eax, DWORD PTR myargc[rip]
	cmp	DWORD PTR -804[rbp], eax
	jl	.L67
	mov	DWORD PTR -800[rbp], 0
	jmp	.L68
.L69:
	mov	eax, DWORD PTR -800[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -792[rbp]
	add	rax, rdx
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -800[rbp]
	cdqe
	mov	QWORD PTR -784[rbp+rax*8], rdx
	add	DWORD PTR -800[rbp], 1
.L68:
	mov	eax, DWORD PTR -800[rbp]
	cmp	eax, DWORD PTR -808[rbp]
	jl	.L69
	mov	eax, DWORD PTR -800[rbp]
	cdqe
	mov	QWORD PTR -784[rbp+rax*8], 0
	mov	eax, DWORD PTR -808[rbp]
	add	eax, 1
	mov	DWORD PTR -800[rbp], eax
	mov	DWORD PTR -796[rbp], 0
	jmp	.L70
.L71:
	mov	eax, DWORD PTR -800[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -792[rbp]
	add	rax, rdx
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -796[rbp]
	cdqe
	mov	QWORD PTR -528[rbp+rax*8], rdx
	add	DWORD PTR -800[rbp], 1
	add	DWORD PTR -796[rbp], 1
.L70:
	mov	eax, DWORD PTR myargc[rip]
	cmp	DWORD PTR -800[rbp], eax
	jl	.L71
	mov	eax, DWORD PTR -796[rbp]
	cdqe
	mov	QWORD PTR -528[rbp+rax*8], 0
	cmp	DWORD PTR -800[rbp], 5
	jg	.L72
	cmp	DWORD PTR -796[rbp], 5
	jle	.L73
.L72:
	lea	rdi, .LC18[rip]
	call	puts@PLT
	jmp	.L76
.L73:
	lea	rdx, -528[rbp]
	lea	rax, -784[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	exe_pipe
	test	eax, eax
	je	.L74
	lea	rdi, .LC21[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L74:
	lea	rax, -784[rbp]
	mov	edx, 256
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	lea	rax, -528[rbp]
	mov	edx, 256
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	jmp	.L76
.L64:
	mov	edx, DWORD PTR myargc[rip]
	mov	rax, QWORD PTR -792[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	exe
	test	eax, eax
	je	.L76
	lea	rdi, .LC22[rip]
	call	puts@PLT
	jmp	.L76
.L78:
	nop
.L75:
	jmp	.L76
	.cfi_endproc
.LFE14:
	.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	"562101.c"
	.text
	.comm	myargc,4,4
	.comm	run_in_bg_flag,4,4
	.comm	rd_output,4,4
	.comm	rd_output_append,4,4
	.comm	rd_input,4,4
	.comm	do_pipe,4,4
	.comm	rd_file,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"\033[H\033[J\000"
	.text
	.align	2
	.global	clear
	.syntax unified
	.arm
	.fpu softvfp
	.type	clear, %function
clear:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L2
	bl	printf
	nop
	pop	{fp, pc}
.L3:
	.align	2
.L2:
	.word	.LC0
	.size	clear, .-clear
	.section	.rodata
	.align	2
.LC1:
	.ascii	"HOME\000"
	.align	2
.LC2:
	.ascii	"~\000"
	.align	2
.LC3:
	.ascii	"%s%s\000"
	.align	2
.LC4:
	.ascii	"myShell %s >> \000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	print_dir
	.syntax unified
	.arm
	.fpu softvfp
	.type	print_dir, %function
print_dir:
	@ args = 0, pretend = 0, frame = 2064
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #2064
	sub	sp, sp, #4
	ldr	r3, .L9
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r0, .L9+4
	bl	getenv
	str	r0, [fp, #-2072]
	sub	r3, fp, #2048
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r1, #1024
	mov	r0, r3
	bl	getcwd
	sub	r3, fp, #2048
	sub	r3, r3, #12
	sub	r3, r3, #4
	ldr	r1, [fp, #-2072]
	mov	r0, r3
	bl	strstr
	str	r0, [fp, #-2068]
	ldr	r3, [fp, #-2068]
	cmp	r3, #0
	beq	.L5
	sub	r3, fp, #2048
	sub	r3, r3, #12
	sub	r3, r3, #4
	ldr	r2, [fp, #-2068]
	sub	r3, r2, r3
	mov	r2, r3
	sub	r1, fp, #2048
	sub	r1, r1, #12
	sub	r1, r1, #4
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r0, r3
	bl	strncpy
	sub	r3, fp, #2048
	sub	r3, r3, #12
	sub	r3, r3, #4
	ldr	r2, [fp, #-2068]
	sub	r3, r2, r3
	sub	r2, fp, #12
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3, #-1028]
	sub	r3, fp, #2048
	sub	r3, r3, #12
	sub	r3, r3, #4
	ldr	r2, [fp, #-2068]
	sub	r3, r2, r3
	mov	r2, r3
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	add	r4, r3, r2
	ldr	r0, [fp, #-2072]
	bl	strlen
	mov	r2, r0
	ldr	r3, [fp, #-2068]
	add	r3, r3, r2
	ldr	r2, .L9+8
	ldr	r1, .L9+12
	mov	r0, r4
	bl	sprintf
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, .L9+16
	bl	printf
	b	.L8
.L5:
	sub	r3, fp, #2048
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, .L9+16
	bl	printf
.L8:
	nop
	ldr	r3, .L9
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L7
	bl	__stack_chk_fail
.L7:
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L10:
	.align	2
.L9:
	.word	.LC5
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	print_dir, .-print_dir
	.section	.rodata
	.align	2
.LC6:
	.ascii	"Enter a directory for cd\000"
	.text
	.align	2
	.global	cd
	.syntax unified
	.arm
	.fpu softvfp
	.type	cd, %function
cd:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L12
	ldr	r0, .L16
	bl	puts
	b	.L15
.L12:
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L16+4
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L14
	ldr	r0, .L16+8
	bl	getenv
	mov	r3, r0
	mov	r0, r3
	bl	chdir
	b	.L15
.L14:
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	chdir
.L15:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC6
	.word	.LC2
	.word	.LC1
	.size	cd, .-cd
	.section	.rodata
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	pwd
	.syntax unified
	.arm
	.fpu softvfp
	.type	pwd, %function
pwd:
	@ args = 0, pretend = 0, frame = 1032
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1024
	sub	sp, sp, #8
	ldr	r3, .L20
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, #1024
	mov	r0, r3
	bl	getcwd
	mov	r3, r0
	mov	r0, r3
	bl	puts
	nop
	ldr	r3, .L20
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L19
	bl	__stack_chk_fail
.L19:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC7
	.size	pwd, .-pwd
	.section	.rodata
	.align	2
.LC8:
	.ascii	" \012\011\015\013\014\000"
	.align	2
.LC9:
	.ascii	"tokens allocation error\000"
	.align	2
.LC10:
	.ascii	">\000"
	.align	2
.LC11:
	.ascii	">>\000"
	.align	2
.LC12:
	.ascii	"<\000"
	.align	2
.LC13:
	.ascii	"|\000"
	.align	2
.LC14:
	.ascii	"&\000"
	.text
	.align	2
	.global	parse_buffer
	.syntax unified
	.arm
	.fpu softvfp
	.type	parse_buffer, %function
parse_buffer:
	@ 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	r0, #32
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r1, .L33
	ldr	r0, [fp, #-16]
	bl	strtok
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L24
	ldr	r0, .L33+4
	bl	puts
	mov	r0, #1
	bl	exit
.L31:
	ldr	r1, .L33+8
	ldr	r0, [fp, #-12]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L25
	ldr	r3, .L33+12
	mov	r2, #1
	str	r2, [r3]
	b	.L26
.L25:
	ldr	r1, .L33+16
	ldr	r0, [fp, #-12]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L27
	ldr	r3, .L33+20
	mov	r2, #1
	str	r2, [r3]
	b	.L26
.L27:
	ldr	r1, .L33+24
	ldr	r0, [fp, #-12]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L28
	ldr	r3, .L33+28
	mov	r2, #1
	str	r2, [r3]
	b	.L26
.L28:
	ldr	r1, .L33+32
	ldr	r0, [fp, #-12]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L29
	ldr	r3, .L33+36
	mov	r2, #1
	str	r2, [r3]
	b	.L26
.L29:
	ldr	r1, .L33+40
	ldr	r0, [fp, #-12]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L26
	ldr	r3, .L33+44
	mov	r2, #1
	str	r2, [r3]
	b	.L30
.L26:
	ldr	r3, .L33+48
	ldr	r3, [r3]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	ldr	r2, [fp, #-12]
	str	r2, [r3]
	ldr	r3, .L33+48
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L33+48
	str	r3, [r2]
	ldr	r1, .L33
	mov	r0, #0
	bl	strtok
	str	r0, [fp, #-12]
.L24:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L31
.L30:
	ldr	r3, .L33+48
	ldr	r3, [r3]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L34:
	.align	2
.L33:
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	rd_output
	.word	.LC11
	.word	rd_output_append
	.word	.LC12
	.word	rd_input
	.word	.LC13
	.word	do_pipe
	.word	.LC14
	.word	run_in_bg_flag
	.word	myargc
	.size	parse_buffer, .-parse_buffer
	.align	2
	.global	count_argc
	.syntax unified
	.arm
	.fpu softvfp
	.type	count_argc, %function
count_argc:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #20
	str	r0, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L36
.L37:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L36:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L37
	ldr	r3, [fp, #-8]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	count_argc, .-count_argc
	.section	.rodata
	.align	2
.LC15:
	.ascii	"Fork error: fork() < 0\012\000"
	.align	2
.LC16:
	.ascii	"Execvp error\012\000"
	.align	2
.LC17:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	exe
	.syntax unified
	.arm
	.fpu softvfp
	.type	exe, %function
exe:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	ldr	r3, .L55
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bge	.L40
	ldr	r0, .L55+4
	bl	perror
	mvn	r3, #0
	b	.L53
.L40:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L42
	ldr	r3, .L55+8
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L43
	mov	r3, #0
	str	r3, [fp, #-36]
.L45:
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-48]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r1, .L55+12
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L44
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	lsl	r3, r3, #2
	ldr	r2, [fp, #-48]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, .L55+16
	str	r3, [r2]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-48]
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, .L55+16
	ldr	r3, [r3]
	mov	r1, #420
	mov	r0, r3
	bl	creat
	str	r0, [fp, #-20]
	mov	r1, #1
	ldr	r0, [fp, #-20]
	bl	dup2
	ldr	r0, [fp, #-20]
	bl	close
	b	.L43
.L44:
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
	b	.L45
.L43:
	ldr	r3, .L55+20
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L46
	mov	r3, #0
	str	r3, [fp, #-32]
.L48:
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-48]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r1, .L55+24
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L47
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	lsl	r3, r3, #2
	ldr	r2, [fp, #-48]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, .L55+16
	str	r3, [r2]
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-48]
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, .L55+16
	ldr	r3, [r3]
	mov	r2, #420
	ldr	r1, .L55+28
	mov	r0, r3
	bl	open
	str	r0, [fp, #-16]
	mov	r1, #1
	ldr	r0, [fp, #-16]
	bl	dup2
	ldr	r0, [fp, #-16]
	bl	close
	b	.L46
.L47:
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
	b	.L48
.L46:
	ldr	r3, .L55+32
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L49
	mov	r3, #0
	str	r3, [fp, #-28]
.L51:
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-48]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r1, .L55+36
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L50
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	lsl	r3, r3, #2
	ldr	r2, [fp, #-48]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, .L55+16
	str	r3, [r2]
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-48]
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, .L55+16
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	open
	str	r0, [fp, #-12]
	mov	r1, #0
	ldr	r0, [fp, #-12]
	bl	dup2
	ldr	r0, [fp, #-12]
	bl	close
	b	.L49
.L50:
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
	b	.L51
.L49:
	ldr	r3, [fp, #-48]
	ldr	r3, [r3]
	ldr	r1, [fp, #-48]
	mov	r0, r3
	bl	execvp
	ldr	r0, .L55+40
	bl	perror
	mvn	r3, #0
	b	.L53
.L42:
	ldr	r3, .L55+44
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L52
	sub	r3, fp, #40
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	waitpid
.L52:
	mov	r3, #0
.L53:
	ldr	r2, .L55
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L54
	bl	__stack_chk_fail
.L54:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L56:
	.align	2
.L55:
	.word	.LC17
	.word	.LC15
	.word	rd_output
	.word	.LC10
	.word	rd_file
	.word	rd_output_append
	.word	.LC11
	.word	1089
	.word	rd_input
	.word	.LC12
	.word	.LC16
	.word	run_in_bg_flag
	.size	exe, .-exe
	.section	.rodata
	.align	2
.LC18:
	.ascii	"Pipe error\012\000"
	.align	2
.LC19:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	exe_pipe
	.syntax unified
	.arm
	.fpu softvfp
	.type	exe_pipe, %function
exe_pipe:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	ldr	r3, .L68
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #16
	mov	r0, r3
	bl	pipe
	mov	r3, r0
	cmp	r3, #0
	bge	.L58
	ldr	r0, .L68+4
	bl	perror
	mov	r0, #1
	bl	exit
.L58:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L59
	ldr	r3, [fp, #-16]
	mov	r1, #0
	mov	r0, r3
	bl	dup2
	ldr	r3, [fp, #-12]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-36]
	ldr	r3, [r3]
	ldr	r1, [fp, #-36]
	mov	r0, r3
	bl	execvp
	ldr	r0, .L68+8
	bl	perror
	mvn	r3, #0
	b	.L66
.L59:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bge	.L61
	ldr	r0, .L68+12
	bl	perror
	mvn	r3, #0
	b	.L66
.L61:
	ldr	r3, .L68+16
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L62
	sub	r3, fp, #24
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-20]
	bl	waitpid
.L62:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L63
	ldr	r3, [fp, #-12]
	mov	r1, #1
	mov	r0, r3
	bl	dup2
	ldr	r3, [fp, #-12]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-32]
	ldr	r3, [r3]
	ldr	r1, [fp, #-32]
	mov	r0, r3
	bl	execvp
	ldr	r0, .L68+8
	bl	perror
	mvn	r3, #0
	b	.L66
.L63:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bge	.L64
	ldr	r0, .L68+12
	bl	perror
	mvn	r3, #0
	b	.L66
.L64:
	ldr	r3, .L68+16
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L65
	sub	r3, fp, #24
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-20]
	bl	waitpid
.L65:
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-12]
	mov	r0, r3
	bl	close
	mov	r3, #0
.L66:
	ldr	r2, .L68
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L67
	bl	__stack_chk_fail
.L67:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L69:
	.align	2
.L68:
	.word	.LC19
	.word	.LC18
	.word	.LC16
	.word	.LC15
	.word	run_in_bg_flag
	.size	exe_pipe, .-exe_pipe
	.section	.rodata
	.align	2
.LC20:
	.ascii	"\012\000"
	.align	2
.LC21:
	.ascii	"exit\000"
	.align	2
.LC22:
	.ascii	"Too many arguments. (Maximum number of arguments: 4"
	.ascii	")\000"
	.align	2
.LC23:
	.ascii	"cd\000"
	.align	2
.LC24:
	.ascii	"pwd\000"
	.align	2
.LC25:
	.ascii	"exe_pipe failed\012\000"
	.align	2
.LC26:
	.ascii	"exe failed\000"
	.align	2
.LC27:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 416
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #416
	str	r0, [fp, #-416]
	str	r1, [fp, #-420]
	ldr	r3, .L93
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	bl	clear
.L90:
	sub	r3, fp, #264
	mov	r2, #256
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r3, .L93+4
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, .L93+8
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, .L93+12
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, .L93+16
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, .L93+20
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, .L93+24
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, .L93+28
	mov	r2, #0
	str	r2, [r3]
	bl	print_dir
	ldr	r3, .L93+32
	ldr	r2, [r3]
	sub	r3, fp, #264
	mov	r1, #256
	mov	r0, r3
	bl	fgets
	sub	r3, fp, #264
	ldr	r1, .L93+36
	mov	r0, r3
	bl	strcspn
	mov	r3, r0
	sub	r2, fp, #4
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3, #-260]
	sub	r3, fp, #264
	ldr	r1, .L93+40
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L71
	mov	r0, #0
	bl	exit
.L71:
	sub	r3, fp, #264
	mov	r0, r3
	bl	parse_buffer
	str	r0, [fp, #-396]
	ldr	r3, .L93+4
	ldr	r3, [r3]
	cmp	r3, #4
	ble	.L72
	ldr	r3, .L93+24
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L72
	ldr	r0, .L93+44
	bl	puts
	b	.L89
.L72:
	ldr	r3, [fp, #-396]
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L92
	ldr	r3, [fp, #-396]
	ldr	r3, [r3]
	ldr	r1, .L93+48
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L75
	ldr	r0, [fp, #-396]
	bl	cd
	b	.L90
.L75:
	ldr	r3, [fp, #-396]
	ldr	r3, [r3]
	ldr	r1, .L93+52
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L77
	bl	pwd
	b	.L90
.L77:
	ldr	r3, .L93+24
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L78
	mov	r3, #0
	str	r3, [fp, #-412]
	mov	r3, #0
	str	r3, [fp, #-408]
	b	.L79
.L81:
	ldr	r3, [fp, #-408]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-396]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r1, .L93+56
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L80
	ldr	r3, [fp, #-408]
	str	r3, [fp, #-412]
.L80:
	ldr	r3, [fp, #-408]
	add	r3, r3, #1
	str	r3, [fp, #-408]
.L79:
	ldr	r3, .L93+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-408]
	cmp	r2, r3
	blt	.L81
	mov	r3, #0
	str	r3, [fp, #-404]
	b	.L82
.L83:
	ldr	r3, [fp, #-404]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-396]
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-404]
	lsl	r3, r3, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	str	r2, [r3, #-388]
	ldr	r3, [fp, #-404]
	add	r3, r3, #1
	str	r3, [fp, #-404]
.L82:
	ldr	r2, [fp, #-404]
	ldr	r3, [fp, #-412]
	cmp	r2, r3
	blt	.L83
	ldr	r3, [fp, #-404]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3, #-388]
	ldr	r3, [fp, #-412]
	add	r3, r3, #1
	str	r3, [fp, #-404]
	mov	r3, #0
	str	r3, [fp, #-400]
	b	.L84
.L85:
	ldr	r3, [fp, #-404]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-396]
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-400]
	lsl	r3, r3, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	str	r2, [r3, #-324]
	ldr	r3, [fp, #-404]
	add	r3, r3, #1
	str	r3, [fp, #-404]
	ldr	r3, [fp, #-400]
	add	r3, r3, #1
	str	r3, [fp, #-400]
.L84:
	ldr	r3, .L93+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-404]
	cmp	r2, r3
	blt	.L85
	ldr	r3, [fp, #-400]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3, #-324]
	ldr	r3, [fp, #-404]
	cmp	r3, #5
	bgt	.L86
	ldr	r3, [fp, #-400]
	cmp	r3, #5
	ble	.L87
.L86:
	ldr	r0, .L93+44
	bl	puts
	b	.L90
.L87:
	sub	r2, fp, #328
	sub	r3, fp, #392
	mov	r1, r2
	mov	r0, r3
	bl	exe_pipe
	mov	r3, r0
	cmp	r3, #0
	beq	.L88
	ldr	r0, .L93+60
	bl	perror
	mov	r0, #1
	bl	exit
.L88:
	sub	r3, fp, #392
	mov	r2, #64
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #328
	mov	r2, #64
	mov	r1, #0
	mov	r0, r3
	bl	memset
	b	.L90
.L78:
	ldr	r3, .L93+4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, [fp, #-396]
	bl	exe
	mov	r3, r0
	cmp	r3, #0
	beq	.L90
	ldr	r0, .L93+64
	bl	puts
	b	.L90
.L92:
	nop
.L89:
	b	.L90
.L94:
	.align	2
.L93:
	.word	.LC27
	.word	myargc
	.word	run_in_bg_flag
	.word	rd_output
	.word	rd_output_append
	.word	rd_input
	.word	do_pipe
	.word	rd_file
	.word	stdin
	.word	.LC20
	.word	.LC21
	.word	.LC22
	.word	.LC23
	.word	.LC24
	.word	.LC13
	.word	.LC25
	.word	.LC26
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
