// File: /workspace/github_cpp_makefile_star2_O3/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 0xb811
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 0xb527
movq %r14, %rdi
movq %r12, %rsi
callq 0x9d2e
jmp 0xb501
leaq -0xb8(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x9c2c
leaq -0x40(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0xb94d
leaq -0xb8(%rbp), %rdi
callq 0x9cc0
movq -0x40(%rbp), %rdi
cmpq %rdi, -0x38(%rbp)
je 0xb7c4
leaq -0x78(%rbp), %r14
movl $0x1, %r15d
xorl %r12d, %r12d
cmpl $0x1, %r15d
jne 0xb5ce
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 0xc78c
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 0x9d2e
jmp 0xb792
leal -0x2(%r15), %r13d
shlq $0x5, %r13
addq %r13, %rdi
leaq 0x1a7b(%rip), %rsi      # 0xd05b
callq 0x30b0
testl %eax, %eax
je 0xb747
shlq $0x5, %r12
movq -0x40(%rbp), %rdi
addq %r12, %rdi
leaq 0x1a5e(%rip), %rsi      # 0xd05d
callq 0x30b0
testl %eax, %eax
je 0xb79a
movq -0x40(%rbp), %rdi
addq %r13, %rdi
leaq 0x1a43(%rip), %rsi      # 0xd05d
callq 0x30b0
testl %eax, %eax
je 0xb79a
movq -0x40(%rbp), %rdi
addq %r12, %rdi
leaq 0x1a2f(%rip), %rsi      # 0xd064
callq 0x30b0
testl %eax, %eax
je 0xb79a
movq -0x40(%rbp), %rdi
addq %r13, %rdi
leaq 0x1a14(%rip), %rsi      # 0xd064
callq 0x30b0
testl %eax, %eax
je 0xb79a
movq -0x40(%rbp), %rdi
addq %r12, %rdi
leaq 0x19f8(%rip), %rsi      # 0xd063
callq 0x30b0
testl %eax, %eax
je 0xb79a
movq -0x40(%rbp), %rdi
addq %r13, %rdi
leaq 0x19dd(%rip), %rsi      # 0xd063
callq 0x30b0
testl %eax, %eax
je 0xb79a
movq -0x40(%rbp), %rdi
addq %r12, %rdi
leaq 0x19be(%rip), %rsi      # 0xd05f
callq 0x30b0
testl %eax, %eax
je 0xb79a
movq -0x40(%rbp), %rdi
addq %r13, %rdi
leaq 0x19a3(%rip), %rsi      # 0xd05f
callq 0x30b0
testl %eax, %eax
je 0xb79a
movq -0x40(%rbp), %rdi
addq %r12, %rdi
leaq 0x198b(%rip), %rsi      # 0xd062
callq 0x30b0
testl %eax, %eax
je 0xb79a
addq -0x40(%rbp), %r13
movq %r13, %rdi
leaq 0x1970(%rip), %rsi      # 0xd062
callq 0x30b0
testl %eax, %eax
je 0xb79a
movq -0x40(%rbp), %rdi
addq %r12, %rdi
leaq 0x194e(%rip), %rsi      # 0xd05b
callq 0x30b0
testl %eax, %eax
je 0xb7ba
movq -0x40(%rbp), %rdi
addq %r12, %rdi
leaq 0x2dd5(%rip), %rsi      # 0xe4fd
callq 0x30b0
testl %eax, %eax
je 0xb79a
movq 0x8(%rbx), %rdi
addq $-0x18, %rdi
addq -0x40(%rbp), %r12
movq %r12, %rsi
callq 0x9d2e
jmp 0xb79a
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 0xc78c
movq 0x8(%rbx), %rdi
addq $-0x18, %rdi
shlq $0x5, %r12
addq -0x40(%rbp), %r12
movq %r12, %rsi
callq 0x9d2e
movq %r14, %rdi
callq 0x9cc0
movl %r15d, %r12d
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rax
subq %rdi, %rax
sarq $0x5, %rax
incl %r15d
cmpq %r12, %rax
ja 0xb571
jmp 0xb7c4
movq 0x8(%rbx), %rax
movb $0x1, -0x1e(%rax)
jmp 0xb79a
leaq -0x40(%rbp), %rdi
callq 0x9cc0
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0xb7e6
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x32c0
leaq -0xa0(%rbp), %rdi
callq 0x9cc0
movq 0x67af(%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 0xb84b
movq %rax, %r15
leaq -0xb8(%rbp), %rdi
jmp 0xb84f
jmp 0xb856
movq %rax, %r15
jmp 0xb89d
jmp 0xb840
movq %rax, %r15
movq %r14, %rdi
callq 0x9cc0
leaq -0x40(%rbp), %rdi
callq 0x9cc0
jmp 0xb859
movq %rax, %r15
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0xb872
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x32c0
leaq -0xa0(%rbp), %rdi
callq 0x9cc0
movq 0x6723(%rip), %rsi      # 0x11fa8
leaq -0x240(%rbp), %rdi
callq 0x31f0
leaq -0x1c0(%rbp), %rdi
callq 0x30e0
movq %rbx, %rdi
callq 0x9e6a
movq %r15, %rdi
callq 0x3530
nop