// File: /workspace/github_cpp_makefile_star2_O3/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 0x5f91
movq %rdi, %rsi
leaq -0x1e8(%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 -0x50(%rbp), %r12
movq %r12, -0x10(%r12)
movq %rax, -0x8(%r12)
movb $0x0, (%r12)
leaq -0x60(%rbp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3370
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x5e99
movq %r14, %rdi
movq %r15, %rsi
callq 0x9d2e
jmp 0x5e73
movq -0x40(%rbp), %rdi
leaq 0x71b7(%rip), %rsi      # 0xd05b
callq 0x30b0
testl %eax, %eax
je 0x5f95
movq -0x40(%rbp), %rdi
movb $0x1, %bl
cmpq %rdi, -0x38(%rbp)
je 0x5f9f
movl $0x1, %r12d
xorl %r13d, %r13d
xorl %r15d, %r15d
xorl %ebx, %ebx
xorl %r14d, %r14d
shlq $0x5, %r13
addq %r13, %rdi
leaq 0x717d(%rip), %rsi      # 0xd05d
callq 0x30b0
testl %eax, %eax
je 0x5f59
movq -0x40(%rbp), %rdi
addq %r13, %rdi
leaq 0x716d(%rip), %rsi      # 0xd064
callq 0x30b0
testl %eax, %eax
je 0x5f4e
movq -0x40(%rbp), %rdi
addq %r13, %rdi
leaq 0x7155(%rip), %rsi      # 0xd063
callq 0x30b0
testl %eax, %eax
je 0x5f4e
movq -0x40(%rbp), %rdi
addq %r13, %rdi
leaq 0x713a(%rip), %rsi      # 0xd05f
callq 0x30b0
testl %eax, %eax
je 0x5f82
addq -0x40(%rbp), %r13
movq %r13, %rdi
leaq 0x7126(%rip), %rsi      # 0xd062
callq 0x30b0
testl %eax, %eax
sete %al
testb %bl, %al
jne 0x5f89
orb %al, %bl
jmp 0x5f62
testb $0x1, %r14b
movb $0x1, %r14b
je 0x5f62
jmp 0x5f89
testb $0x1, %r15b
movb $0x1, %r15b
jne 0x5f89
movl %r12d, %r13d
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rax
subq %rdi, %rax
sarq $0x5, %rax
incl %r12d
cmpq %r13, %rax
ja 0x5ed2
jmp 0x5f99
testb $0x1, %bl
movb $0x1, %bl
je 0x5f62
xorl %ebx, %ebx
leaq -0x50(%rbp), %r12
jmp 0x5f9f
movb $0x1, %bl
jmp 0x5fdc
xorl %ebx, %ebx
jmp 0x5f9f
leaq -0x50(%rbp), %r12
movb $0x1, %bl
movq -0x60(%rbp), %rdi
cmpq %r12, %rdi
je 0x5fb4
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x32c0
leaq -0x40(%rbp), %rdi
callq 0x9cc0
movq 0xbfe4(%rip), %rsi      # 0x11fa8
leaq -0x1e8(%rbp), %rdi
callq 0x31f0
leaq -0x168(%rbp), %rdi
callq 0x30e0
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 -0x60(%rbp), %rdi
cmpq %r12, %rdi
je 0x6008
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x32c0
leaq -0x40(%rbp), %rdi
callq 0x9cc0
movq 0xbf90(%rip), %rsi      # 0x11fa8
leaq -0x1e8(%rbp), %rdi
callq 0x31f0
leaq -0x168(%rbp), %rdi
callq 0x30e0
movq %rbx, %rdi
callq 0x3530