// File: /workspace/github_cpp_makefile_star2_O1/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
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
cmpq $0x0, 0x18(%rsi)
je 0xb889
addq $0x10, %rsi
leaq -0x240(%rbp), %rdi
movl $0x18, %edx
callq 0x3470
xorps %xmm0, %xmm0
leaq -0xa0(%rbp), %r14
movaps %xmm0, (%r14)
xorl %eax, %eax
movq %rax, 0x10(%r14)
leaq -0x50(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb $0x0, (%rcx)
leaq -0x240(%rbp), %r15
leaq -0x60(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x3370
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xb59f
movq %r14, %rdi
movq %r12, %rsi
callq 0x9d80
jmp 0xb579
leaq -0xb8(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x9c82
leaq -0x40(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0xb9c5
leaq -0xb8(%rbp), %rdi
callq 0x9d16
movq -0x40(%rbp), %rdi
cmpq %rdi, -0x38(%rbp)
je 0xb83c
leaq -0x78(%rbp), %r14
movl $0x1, %r15d
xorl %r12d, %r12d
cmpl $0x1, %r15d
jne 0xb646
movq $-0x1, -0x88(%rbp)
movw $0x0, -0x80(%rbp)
movb $0x0, -0x7e(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq $0x0, 0x10(%r14)
movq %rbx, %rdi
leaq -0x88(%rbp), %rsi
callq 0xc772
movq (%rbx), %rax
leaq (%r12,%r12,4), %rcx
leaq (%rax,%rcx,8), %rdi
addq $0x10, %rdi
shlq $0x5, %r12
addq -0x40(%rbp), %r12
movq %r12, %rsi
callq 0x9d80
jmp 0xb80a
leal -0x2(%r15), %r13d
shlq $0x5, %r13
addq %r13, %rdi
leaq 0x1a03(%rip), %rsi      # 0xd05b
callq 0x30b0
testl %eax, %eax
je 0xb7bf
shlq $0x5, %r12
movq -0x40(%rbp), %rdi
addq %r12, %rdi
leaq 0x19e6(%rip), %rsi      # 0xd05d
callq 0x30b0
testl %eax, %eax
je 0xb812
movq -0x40(%rbp), %rdi
addq %r13, %rdi
leaq 0x19cb(%rip), %rsi      # 0xd05d
callq 0x30b0
testl %eax, %eax
je 0xb812
movq -0x40(%rbp), %rdi
addq %r12, %rdi
leaq 0x19b7(%rip), %rsi      # 0xd064
callq 0x30b0
testl %eax, %eax
je 0xb812
movq -0x40(%rbp), %rdi
addq %r13, %rdi
leaq 0x199c(%rip), %rsi      # 0xd064
callq 0x30b0
testl %eax, %eax
je 0xb812
movq -0x40(%rbp), %rdi
addq %r12, %rdi
leaq 0x1980(%rip), %rsi      # 0xd063
callq 0x30b0
testl %eax, %eax
je 0xb812
movq -0x40(%rbp), %rdi
addq %r13, %rdi
leaq 0x1965(%rip), %rsi      # 0xd063
callq 0x30b0
testl %eax, %eax
je 0xb812
movq -0x40(%rbp), %rdi
addq %r12, %rdi
leaq 0x1946(%rip), %rsi      # 0xd05f
callq 0x30b0
testl %eax, %eax
je 0xb812
movq -0x40(%rbp), %rdi
addq %r13, %rdi
leaq 0x192b(%rip), %rsi      # 0xd05f
callq 0x30b0
testl %eax, %eax
je 0xb812
movq -0x40(%rbp), %rdi
addq %r12, %rdi
leaq 0x1913(%rip), %rsi      # 0xd062
callq 0x30b0
testl %eax, %eax
je 0xb812
addq -0x40(%rbp), %r13
movq %r13, %rdi
leaq 0x18f8(%rip), %rsi      # 0xd062
callq 0x30b0
testl %eax, %eax
je 0xb812
movq -0x40(%rbp), %rdi
addq %r12, %rdi
leaq 0x18d6(%rip), %rsi      # 0xd05b
callq 0x30b0
testl %eax, %eax
je 0xb832
movq -0x40(%rbp), %rdi
addq %r12, %rdi
leaq 0x2d5d(%rip), %rsi      # 0xe4fd
callq 0x30b0
testl %eax, %eax
je 0xb812
movq 0x8(%rbx), %rdi
addq $-0x18, %rdi
addq -0x40(%rbp), %r12
movq %r12, %rsi
callq 0x9d80
jmp 0xb812
movq $-0x1, -0x88(%rbp)
movw $0x0, -0x80(%rbp)
movb $0x0, -0x7e(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq $0x0, 0x10(%r14)
movq %rbx, %rdi
leaq -0x88(%rbp), %rsi
callq 0xc772
movq 0x8(%rbx), %rdi
addq $-0x18, %rdi
shlq $0x5, %r12
addq -0x40(%rbp), %r12
movq %r12, %rsi
callq 0x9d80
movq %r14, %rdi
callq 0x9d16
movl %r15d, %r12d
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rax
subq %rdi, %rax
sarq $0x5, %rax
incl %r15d
cmpq %r12, %rax
ja 0xb5e9
jmp 0xb83c
movq 0x8(%rbx), %rax
movb $0x1, -0x1e(%rax)
jmp 0xb812
leaq -0x40(%rbp), %rdi
callq 0x9d16
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0xb85e
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x32c0
leaq -0xa0(%rbp), %rdi
callq 0x9d16
movq 0x6737(%rip), %rsi      # 0x11fa8
leaq -0x240(%rbp), %rdi
callq 0x31f0
leaq -0x1c0(%rbp), %rdi
callq 0x30e0
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 0xb8c3
movq %rax, %r15
leaq -0xb8(%rbp), %rdi
jmp 0xb8c7
jmp 0xb8ce
movq %rax, %r15
jmp 0xb915
jmp 0xb8b8
movq %rax, %r15
movq %r14, %rdi
callq 0x9d16
leaq -0x40(%rbp), %rdi
callq 0x9d16
jmp 0xb8d1
movq %rax, %r15
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0xb8ea
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x32c0
leaq -0xa0(%rbp), %rdi
callq 0x9d16
movq 0x66ab(%rip), %rsi      # 0x11fa8
leaq -0x240(%rbp), %rdi
callq 0x31f0
leaq -0x1c0(%rbp), %rdi
callq 0x30e0
movq %rbx, %rdi
callq 0x9ebc
movq %r15, %rdi
callq 0x3530
nop