// File: /workspace/github_cpp_makefile_star2_O2/brandoncanaday[P]1730sh/Input.cpp
// Function: Input::inputToProcesses()
vector<Process> Input::inputToProcesses() { 
  vector<Process> p_vector;
  // if empty
  if(this->shellInput.length() == 0) { return p_vector; } // if
  // splits up original shell input
  stringstream ss(this->shellInput);
  vector<string> argv;
  string a;
  while(ss >> a) { 
    argv.push_back(a);
  } // while
  // deals with double-quotes
  vector<string> processed_argv = processArgv(argv);
  // finally, add trimmed, concatenated/processed, and sanitized args to p_vector
  for(unsigned int i = 0; i < processed_argv.size(); i++) {
    if(i == 0) { 
      Process p;
      p_vector.push_back(p); // create a new Process
      p_vector[i].args.push_back(processed_argv[i]); // push the name of the process to be the first argument of the Process vector<string>
    } else if(processed_argv[i-1] == "|") { 
      Process p;
      p_vector.push_back(p); // create a new Process
      p_vector.back().args.push_back(processed_argv[i]); // push the name of the process to be the first argument of the Process vector<string>	
    } else { 
      if(processed_argv[i] != "<" && processed_argv[i-1] != "<" &&
	 processed_argv[i] != ">" && processed_argv[i-1] != ">" &&
	 processed_argv[i] != ">>" && processed_argv[i-1] != ">>" &&
	 processed_argv[i] != "e>" && processed_argv[i-1] != "e>" &&
	 processed_argv[i] != "e>>" && processed_argv[i-1] != "e>>") {
	if(processed_argv[i] == "|") {
	  p_vector.back().hasPipe = true;
	} else if(processed_argv[i] != "&") {
	  p_vector.back().args.push_back(processed_argv[i]); // push the process arguments to the Process vector<string>
	} // if/else
      } // if
    } // if/else
  } // for
  return p_vector;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rdi, %rbx
andq $0x0, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
cmpq $0x0, 0x18(%rsi)
je 0x919f
addq $0x10, %rsi
leaq -0x240(%rbp), %rdi
pushq $0x18
popq %rdx
callq 0x3430
xorps %xmm0, %xmm0
leaq -0x80(%rbp), %r14
andq $0x0, 0x10(%r14)
leaq -0xa8(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movaps %xmm0, (%r14)
movb $0x0, (%rax)
leaq -0x240(%rbp), %r15
leaq -0xb8(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x3330
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x8f11
movq %r14, %rdi
movq %r12, %rsi
callq 0x7776
jmp 0x8eeb
leaq -0x98(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x76d2
leaq -0x40(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x928b
leaq -0x98(%rbp), %rdi
callq 0x7726
leaq -0x58(%rbp), %r14
xorl %r13d, %r13d
movl %r13d, %r13d
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rax
subq %rdi, %rax
sarq $0x5, %rax
cmpq %r13, %rax
jbe 0x9175
testq %r13, %r13
je 0x8fc3
leal -0x1(%r13), %r12d
shlq $0x5, %r12
addq %r12, %rdi
leaq 0x10e5(%rip), %rsi      # 0xa05b
callq 0x7653
testb %al, %al
je 0x9018
orq $-0x1, -0x68(%rbp)
andw $0x0, -0x60(%rbp)
movb $0x0, -0x5e(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
andq $0x0, 0x10(%r14)
movq %rbx, %rdi
leaq -0x68(%rbp), %rsi
callq 0x9b3a
movq 0x8(%rbx), %rdi
addq $-0x18, %rdi
movq %r13, %rsi
shlq $0x5, %rsi
addq -0x40(%rbp), %rsi
callq 0x7776
jmp 0x9008
orq $-0x1, -0x68(%rbp)
andw $0x0, -0x60(%rbp)
movb $0x0, -0x5e(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
andq $0x0, 0x10(%r14)
movq %rbx, %rdi
leaq -0x68(%rbp), %rsi
callq 0x9b3a
movq (%rbx), %rax
imulq $0x28, %r13, %rcx
leaq (%rax,%rcx), %rdi
addq $0x10, %rdi
movq %r13, %rsi
shlq $0x5, %rsi
addq -0x40(%rbp), %rsi
callq 0x7776
movq %r14, %rdi
callq 0x7726
incl %r13d
jmp 0x8f44
movq %r13, %r15
shlq $0x5, %r15
movq -0x40(%rbp), %rdi
addq %r15, %rdi
leaq 0x1030(%rip), %rsi      # 0xa05d
callq 0x77f5
testb %al, %al
je 0x9010
movq -0x40(%rbp), %rdi
addq %r12, %rdi
leaq 0x1019(%rip), %rsi      # 0xa05d
callq 0x77f5
testb %al, %al
je 0x9010
movq -0x40(%rbp), %rdi
addq %r15, %rdi
leaq 0x1009(%rip), %rsi      # 0xa064
callq 0x77f5
testb %al, %al
je 0x9010
movq -0x40(%rbp), %rdi
addq %r12, %rdi
leaq 0xff2(%rip), %rsi       # 0xa064
callq 0x77f5
testb %al, %al
je 0x9010
movq -0x40(%rbp), %rdi
addq %r15, %rdi
leaq 0xfda(%rip), %rsi       # 0xa063
callq 0x77f5
testb %al, %al
je 0x9010
movq -0x40(%rbp), %rdi
addq %r12, %rdi
leaq 0xfbf(%rip), %rsi       # 0xa063
callq 0x77f5
testb %al, %al
je 0x9010
movq -0x40(%rbp), %rdi
addq %r15, %rdi
leaq 0xfa0(%rip), %rsi       # 0xa05f
callq 0x77f5
testb %al, %al
je 0x9010
movq -0x40(%rbp), %rdi
addq %r12, %rdi
leaq 0xf85(%rip), %rsi       # 0xa05f
callq 0x77f5
testb %al, %al
je 0x9010
movq -0x40(%rbp), %rdi
addq %r15, %rdi
leaq 0xf6d(%rip), %rsi       # 0xa062
callq 0x77f5
testb %al, %al
je 0x9010
addq -0x40(%rbp), %r12
movq %r12, %rdi
leaq 0xf52(%rip), %rsi       # 0xa062
callq 0x77f5
testb %al, %al
je 0x9010
movq -0x40(%rbp), %rdi
addq %r15, %rdi
leaq 0xf30(%rip), %rsi       # 0xa05b
callq 0x7653
testb %al, %al
je 0x9141
movq 0x8(%rbx), %rax
movb $0x1, -0x1e(%rax)
jmp 0x9010
movq -0x40(%rbp), %rdi
addq %r15, %rdi
leaq 0x23ae(%rip), %rsi      # 0xb4fd
callq 0x77f5
testb %al, %al
je 0x9010
movq 0x8(%rbx), %rdi
addq $-0x18, %rdi
addq -0x40(%rbp), %r15
movq %r15, %rsi
callq 0x7776
jmp 0x9010
leaq -0x40(%rbp), %rdi
callq 0x7726
leaq -0xb8(%rbp), %rdi
callq 0x3120
leaq -0x80(%rbp), %rdi
callq 0x7726
leaq -0x240(%rbp), %rdi
callq 0x31e0
movq %rbx, %rax
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
jmp 0x91d9
movq %rax, %r15
leaq -0x98(%rbp), %rdi
jmp 0x91dd
jmp 0x91e4
movq %rax, %r15
jmp 0x9208
jmp 0x91ce
movq %rax, %r15
movq %r14, %rdi
callq 0x7726
leaq -0x40(%rbp), %rdi
callq 0x7726
jmp 0x91e7
movq %rax, %r15
leaq -0xb8(%rbp), %rdi
callq 0x3120
leaq -0x80(%rbp), %rdi
callq 0x7726
leaq -0x240(%rbp), %rdi
callq 0x31e0
movq %rbx, %rdi
callq 0x7966
movq %r15, %rdi
callq 0x34b0