// File: /workspace/github_cpp_makefile_star2_O1/brandoncanaday[P]1730sh/1730sh.cpp
// Function: isValidInput(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool isValidInput(string input) {
  if(input.length() == 0) return true;
  bool redirect_in_flag = false;
  bool redirect_out_flag = false;
  bool redirect_err_flag = false;
  stringstream ss(input);
  vector<string> argv;
  string arg;
  while(ss >> arg) {
    argv.push_back(arg);
  } // while
  // can not begin input with a pipe
  if(argv[0] == "|") return false;
  // only allowed to have one redirect of each kind (STDIN, STDOUT, STDERR)
  for(unsigned int i = 0; i < argv.size(); i++) {
    if(argv[i] == "<") {
      if(!redirect_in_flag) { 
	redirect_in_flag = true; 
      } else {
	return false;
      } // if/else
    } else if(argv[i] == ">" || argv[i] == ">>") {
      if(!redirect_out_flag) { 
	redirect_out_flag = true; 
      } else {
	return false;
      } // if/else
    } else if(argv[i] == "e>" || argv[i] == "e>>") {
      if(!redirect_err_flag) { 
	redirect_err_flag = true; 
      } else {
	return false;
      } // if/else
    } // if/else
  } // for  
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
cmpq $0x0, 0x8(%rdi)
je 0x5f8a
movq %rdi, %rsi
leaq -0x1f0(%rbp), %rbx
movq %rbx, %rdi
movl $0x18, %edx
callq 0x3470
xorl %eax, %eax
leaq -0x40(%rbp), %r14
movq %rax, 0x10(%r14)
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
leaq -0x58(%rbp), %r12
movq %r12, -0x10(%r12)
movq %rax, -0x8(%r12)
movb $0x0, (%r12)
leaq -0x68(%rbp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3370
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x5e92
movq %r14, %rdi
movq %r15, %rsi
callq 0x9d80
jmp 0x5e6c
movq -0x40(%rbp), %rdi
leaq 0x71be(%rip), %rsi      # 0xd05b
callq 0x30b0
testl %eax, %eax
je 0x5f8e
movq -0x40(%rbp), %rdi
cmpq %rdi, -0x38(%rbp)
sete %bl
je 0x5f90
movl $0x1, %r12d
xorl %r13d, %r13d
xorl %r15d, %r15d
movq $0x0, -0x48(%rbp)
xorl %r14d, %r14d
shlq $0x5, %r13
addq %r13, %rdi
leaq 0x717d(%rip), %rsi      # 0xd05d
callq 0x30b0
testl %eax, %eax
je 0x5f5e
movq -0x40(%rbp), %rdi
addq %r13, %rdi
leaq 0x716d(%rip), %rsi      # 0xd064
callq 0x30b0
testl %eax, %eax
je 0x5f53
movq -0x40(%rbp), %rdi
addq %r13, %rdi
leaq 0x7155(%rip), %rsi      # 0xd063
callq 0x30b0
testl %eax, %eax
je 0x5f53
movq -0x40(%rbp), %rdi
addq %r13, %rdi
leaq 0x713a(%rip), %rsi      # 0xd05f
callq 0x30b0
testl %eax, %eax
je 0x5f45
addq -0x40(%rbp), %r13
movq %r13, %rdi
leaq 0x7126(%rip), %rsi      # 0xd062
callq 0x30b0
testl %eax, %eax
jne 0x5f67
testb $0x1, -0x48(%rbp)
movb $0x1, %al
movq %rax, -0x48(%rbp)
je 0x5f67
jmp 0x5f90
testb $0x1, %r14b
movb $0x1, %r14b
je 0x5f67
jmp 0x5f90
testb $0x1, %r15b
movb $0x1, %r15b
jne 0x5f90
movl %r12d, %r13d
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rax
subq %rdi, %rax
sarq $0x5, %rax
incl %r12d
cmpq %r13, %rax
setbe %bl
ja 0x5ed2
jmp 0x5f90
movb $0x1, %bl
jmp 0x5fd1
xorl %ebx, %ebx
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x5fa9
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x32c0
leaq -0x40(%rbp), %rdi
callq 0x9d16
movq 0xbfef(%rip), %rsi      # 0x11fa8
leaq -0x1f0(%rbp), %rdi
callq 0x31f0
leaq -0x170(%rbp), %rdi
callq 0x30e0
andb $0x1, %bl
movl %ebx, %eax
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0x6000
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x32c0
leaq -0x40(%rbp), %rdi
callq 0x9d16
movq 0xbf98(%rip), %rsi      # 0x11fa8
leaq -0x1f0(%rbp), %rdi
callq 0x31f0
leaq -0x170(%rbp), %rdi
callq 0x30e0
movq %rbx, %rdi
callq 0x3530