LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/brandoncanaday[P]1730sh/1730sh.cpp
// Function: hasEvenQuotes(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool hasEvenQuotes(string input) {
  int count = 0;
  for(unsigned int i = 0; i < input.length(); i++) {
    if(i == 0) {
      if(input[i] == '"') count++;
    } else {
      if(input[i] == '"' && input[i-1] != '\\') count++;
    } // if/else
  } // for
  if(count % 2 == 0) { 
    return true;
  } else {
    return false;
  } // if/else
}

// Assembly:
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x608d
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rdx
xorl %ecx, %ecx
movl $0x1, %esi
movq %rdx, %rdi
movb (%rdi), %r8b
cmpl $0x1, %esi
jne 0x605f
xorl %r9d, %r9d
cmpb $0x22, %r8b
sete %r9b
jmp 0x6075
cmpb $0x22, %r8b
jne 0x6078
leal -0x2(%rsi), %r8d
xorl %r9d, %r9d
cmpb $0x5c, (%rdx,%r8)
setne %r9b
addl %r9d, %ecx
movl %esi, %r8d
incq %rdi
incl %esi
cmpq %r8, %rax
ja 0x604a
testb $0x1, %cl
sete %al
popq %rbp
retq
movb $0x1, %al
retq
// File: /workspace/github_cpp_makefile_star2_O1/brandoncanaday[P]1730sh/1730sh.cpp
// Function: makePipes(int)
int** makePipes(int numPipes) {
  int** pipes = nullptr;
  if(numPipes != 0) {
    pipes = new int * [numPipes];
    for(int i = 0; i < numPipes; i++) {
      pipes[i] = new int[2];
    } // for
  } // if
  return pipes;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testl %edi, %edi
je 0x60e0
movl %edi, %r14d
movslq %edi, %rax
shlq $0x3, %rax
testl %edi, %edi
movq $-0x1, %rdi
cmovnsq %rax, %rdi
callq 0x3030
movq %rax, %rbx
testl %r14d, %r14d
jle 0x60e2
movl %r14d, %r14d
xorl %r15d, %r15d
movl $0x8, %edi
callq 0x3030
movq %rax, (%rbx,%r15,8)
incq %r15
cmpq %r15, %r14
jne 0x60c8
jmp 0x60e2
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/brandoncanaday[P]1730sh/1730sh.cpp
// Function: isBuiltIn(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool isBuiltIn(string & command) {
  bool isBuiltIn = false;
  if(command == "cd") {
    isBuiltIn = true;
  } else if(command == "exit") {
    isBuiltIn = true;
  } else if(command == "help") {
    isBuiltIn = true;
  } else if(command == "bg") {
    isBuiltIn = true;
  } else if(command == "fg") {
    isBuiltIn = true;
  } else if(command == "export") {
    isBuiltIn = true;
  } else if(command == "jobs") {
    isBuiltIn = true;
  } else if(command == "kill") {
    isBuiltIn = true;
  } // if/else
  return isBuiltIn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0x79c9(%rip), %rsi      # 0xe144
callq 0x30b0
movb $0x1, %bl
testl %eax, %eax
je 0x6810
leaq 0x79b6(%rip), %rsi      # 0xe147
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x6810
leaq 0x7a0f(%rip), %rsi      # 0xe1b3
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x6810
leaq 0x7995(%rip), %rsi      # 0xe14c
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x6810
leaq 0x7985(%rip), %rsi      # 0xe14f
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x6810
leaq 0x7975(%rip), %rsi      # 0xe152
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x6810
leaq 0x81a4(%rip), %rsi      # 0xe994
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x6810
leaq 0x7956(%rip), %rsi      # 0xe159
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
sete %bl
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/brandoncanaday[P]1730sh/1730sh.cpp
// Function: do_redirects(int, int, int)
void do_redirects(int STDIN, int STDOUT, int STDERR) {
  if(STDIN >= 0) {
    if(dup2(STDIN, STDIN_FILENO) == -1) nope_out("dup2");
  } // if
  if(STDOUT >= 0) {
    if(dup2(STDOUT, STDOUT_FILENO) == -1) nope_out("dup2");
  } // if
  if(STDERR >= 0) {
    if(dup2(STDERR, STDERR_FILENO) == -1) nope_out("dup2");
  } // if
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %edx, %ebx
movl %esi, %r14d
testl %edi, %edi
js 0x6837
xorl %esi, %esi
callq 0x3270
cmpl $-0x1, %eax
je 0x686c
testl %r14d, %r14d
js 0x684e
movl %r14d, %edi
movl $0x1, %esi
callq 0x3270
cmpl $-0x1, %eax
je 0x6875
testl %ebx, %ebx
js 0x6863
movl %ebx, %edi
movl $0x2, %esi
callq 0x3270
cmpl $-0x1, %eax
je 0x687e
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x374c
leaq -0x30(%rbp), %rdi
callq 0x3719
leaq -0x30(%rbp), %rdi
callq 0x36e6
// File: /workspace/github_cpp_makefile_star2_O1/brandoncanaday[P]1730sh/1730sh.cpp
// Function: close_redirects(int, int, int)
void close_redirects(int STDIN, int STDOUT, int STDERR) {
  if(STDIN != STDIN_FILENO) {
    if(close(STDIN) == -1) nope_out("close");
  } // if
  if(STDOUT != STDOUT_FILENO) {
    if(close(STDOUT) == -1) nope_out("close");
  } // if
  if(STDERR != STDERR_FILENO) {
    if(close(STDERR) == -1) nope_out("close");
  } // if
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %edx, %ebx
movl %esi, %r14d
testl %edi, %edi
je 0x68a5
callq 0x3580
cmpl $-0x1, %eax
je 0x68d2
cmpl $0x1, %r14d
je 0x68b8
movl %r14d, %edi
callq 0x3580
cmpl $-0x1, %eax
je 0x68db
cmpl $0x2, %ebx
je 0x68c9
movl %ebx, %edi
callq 0x3580
cmpl $-0x1, %eax
je 0x68e4
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x377f
leaq -0x30(%rbp), %rdi
callq 0x37b2
leaq -0x30(%rbp), %rdi
callq 0x37e5
// File: /workspace/github_cpp_makefile_star2_O1/brandoncanaday[P]1730sh/1730sh.cpp
// Function: child_signals()
void child_signals() {
  if(signal(SIGINT, SIG_DFL) == SIG_ERR) nope_out("signal");
  if(signal(SIGQUIT, SIG_DFL) == SIG_ERR) nope_out("signal");
  if(signal(SIGTSTP, SIG_DFL) == SIG_ERR) nope_out("signal");
  if(signal(SIGTTIN, SIG_DFL) == SIG_ERR) nope_out("signal");
  if(signal(SIGTTOU, SIG_DFL) == SIG_ERR) nope_out("signal");
  if(signal(SIGCHLD, SIG_DFL) == SIG_ERR) nope_out("signal");
  if(signal(SIGPIPE, SIG_DFL) == SIG_ERR) nope_out("signal");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x2, %edi
xorl %esi, %esi
callq 0x3320
cmpq $-0x1, %rax
je 0x6b66
movl $0x3, %edi
xorl %esi, %esi
callq 0x3320
cmpq $-0x1, %rax
je 0x6b6f
movl $0x14, %edi
xorl %esi, %esi
callq 0x3320
cmpq $-0x1, %rax
je 0x6b78
movl $0x15, %edi
xorl %esi, %esi
callq 0x3320
cmpq $-0x1, %rax
je 0x6b81
movl $0x16, %edi
xorl %esi, %esi
callq 0x3320
cmpq $-0x1, %rax
je 0x6b8a
movl $0x11, %edi
xorl %esi, %esi
callq 0x3320
cmpq $-0x1, %rax
je 0x6b93
movl $0xd, %edi
xorl %esi, %esi
callq 0x3320
cmpq $-0x1, %rax
je 0x6b9c
addq $0x20, %rsp
popq %rbp
retq
leaq -0x20(%rbp), %rdi
callq 0x394a
leaq -0x20(%rbp), %rdi
callq 0x3917
leaq -0x20(%rbp), %rdi
callq 0x38e4
leaq -0x20(%rbp), %rdi
callq 0x38b1
leaq -0x20(%rbp), %rdi
callq 0x387e
leaq -0x20(%rbp), %rdi
callq 0x384b
leaq -0x20(%rbp), %rdi
callq 0x3818
// File: /workspace/github_cpp_makefile_star2_O1/brandoncanaday[P]1730sh/1730sh.cpp
// Function: nice_exec(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, int**, int)
void nice_exec(vector<string> strargs, int** pipes, int numPipes) {
  vector<char *> cstrargs = mk_cstrvec(strargs);
  execvp(cstrargs.at(0), &cstrargs.at(0));
  // only makes it here if execvp fails
  cout << "1730sh: " << cstrargs.at(0) << ": command not found" << endl;
  // close pipes
  for(int i = 0; i < numPipes; i++) {
    close_pipe(pipes[i],false);
  } // for
  // delete dynamically-allocated members of current_jobs vector<Input*>
  for(unsigned int i = 0, s = current_jobs.size(); i < s; i++) {
    if(current_jobs[i] != nullptr) { delete current_jobs[i]; current_jobs[i] = nullptr; } // if
  } // for
  // delete dynamically-allocated pipes
  deletePipes(pipes,numPipes);
  dl_cstrvec(cstrargs);
  exit(EXIT_FAILURE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %rsi
leaq -0x40(%rbp), %r15
movq %r15, %rdi
callq 0x6e83
movq (%r15), %rsi
cmpq %rsi, 0x8(%r15)
jne 0x6be5
leaq 0x7eca(%rip), %rdi      # 0xeaa4
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x3440
movq (%rsi), %rdi
callq 0x3200
movq 0xb3dc(%rip), %r15      # 0x11fd0
leaq 0x646b(%rip), %rsi      # 0xd066
movl $0x8, %edx
movq %r15, %rdi
callq 0x3300
movq -0x40(%rbp), %rax
cmpq %rax, -0x38(%rbp)
je 0x6bd3
movq (%rax), %r12
testq %r12, %r12
jne 0x6c34
movq (%r15), %rax
movq -0x18(%rax), %rax
leaq (%r15,%rax), %rdi
movl 0x20(%r15,%rax), %esi
orl $0x1, %esi
callq 0x3500
jmp 0x6c4e
movq %r12, %rdi
callq 0x3130
movq 0xb38d(%rip), %rdi      # 0x11fd0
movq %r12, %rsi
movq %rax, %rdx
callq 0x3300
movq 0xb37b(%rip), %rdi      # 0x11fd0
leaq 0x6413(%rip), %rsi      # 0xd06f
movl $0x13, %edx
callq 0x3300
movq 0xb363(%rip), %rdi      # 0x11fd0
callq 0x3140
testl %ebx, %ebx
jle 0x6c9a
movl %ebx, %r15d
xorl %r12d, %r12d
movq (%r14,%r12,8), %r13
movl (%r13), %edi
callq 0x3580
movl 0x4(%r13), %edi
callq 0x3580
incq %r12
cmpq %r12, %r15
jne 0x6c7c
movq 0xb677(%rip), %rax      # 0x12318
subq 0xb668(%rip), %rax      # 0x12310
shrq $0x3, %rax
testl %eax, %eax
je 0x6cf2
movl %eax, %r12d
xorl %r13d, %r13d
movq 0xb653(%rip), %rax      # 0x12310
movq (%rax,%r13,8), %r15
testq %r15, %r15
je 0x6cea
movq %r15, %rdi
callq 0x9bc0
movl $0xe8, %esi
movq %r15, %rdi
callq 0x32c0
movq 0xb62e(%rip), %rax      # 0x12310
movq $0x0, (%rax,%r13,8)
incq %r13
cmpq %r13, %r12
jne 0x6cb6
movq %r14, %rdi
movl %ebx, %esi
callq 0x6d83
leaq -0x40(%rbp), %rdi
callq 0x6fcf
movl $0x1, %edi
callq 0x3330
jmp 0x6d11
movq %rax, %rbx
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x6d29
movq -0x30(%rbp), %rsi
subq %rdi, %rsi
callq 0x32c0
movq %rbx, %rdi
callq 0x3530
// File: /workspace/github_cpp_makefile_star2_O1/brandoncanaday[P]1730sh/1730sh.cpp
// Function: close_pipe(int*, bool)
void close_pipe(int pipefd[2], bool exit_on_failure) {
  if(close(pipefd[0]) == -1) {
    if(exit_on_failure) { nope_out("close"); } // if
  } // if
  if(close(pipefd[1]) == -1) {
    if(exit_on_failure) { nope_out("close"); } // if
  } // if
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %esi, %ebx
movq %rdi, %r14
xorb $0x1, %bl
movl (%rdi), %edi
callq 0x3580
cmpl $-0x1, %eax
setne %al
orb %bl, %al
je 0x6d71
movl 0x4(%r14), %edi
callq 0x3580
cmpl $-0x1, %eax
setne %al
orb %bl, %al
je 0x6d7a
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x39b0
leaq -0x30(%rbp), %rdi
callq 0x397d
// File: /workspace/github_cpp_makefile_star2_O1/brandoncanaday[P]1730sh/1730sh.cpp
// Function: deletePipes(int**, int)
void deletePipes(int** pipes, int numPipes) {
  if(pipes != nullptr) {
    for(int i = 0; i < numPipes; i++) {
      delete[] pipes[i];
    } // for
    delete[] pipes;
  } // if
}

// Assembly:
testq %rdi, %rdi
je 0x6dc7
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
jle 0x6db5
movl %esi, %r14d
xorl %r15d, %r15d
movq (%rbx,%r15,8), %rdi
testq %rdi, %rdi
je 0x6dad
callq 0x3380
incq %r15
cmpq %r15, %r14
jne 0x6d9f
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3380
retq
// File: /workspace/github_cpp_makefile_star2_O1/brandoncanaday[P]1730sh/1730sh.cpp
// Function: put_job_in_foreground(Input*, bool)
void put_job_in_foreground(Input * job, bool cont) {
  if(job != nullptr) {
    // makes JID the foreground pgrp of the terminal
    if(tcsetpgrp(shell_terminal, job->getJID()) == -1) { nope_out("tcsetpgrp"); } 
    // Send the job a continue signal, if necessary
    if(cont) {
      if(kill(-job->getJID(), SIGCONT) < 0) {
	nope_out("kill(SIGCONT)");
      } // if
    } // if
    // wait for job to finish
    wait_for_job(job); 
    // makes the shell the foreground pgrp again
    if(tcsetpgrp(shell_terminal, shell_pgid) == -1) { nope_out("tcsetpgrp"); }
  } // if
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
testq %rdi, %rdi
je 0x6e25
movl %esi, %r14d
movq %rdi, %rbx
movl 0xb524(%rip), %edi      # 0x12308
movl (%rbx), %esi
callq 0x33c0
cmpl $-0x1, %eax
je 0x6e2e
testb %r14b, %r14b
je 0x6e07
xorl %edi, %edi
subl (%rbx), %edi
movl $0x12, %esi
callq 0x33d0
testl %eax, %eax
js 0x6e40
movq %rbx, %rdi
callq 0x7118
movl 0xb4f3(%rip), %edi      # 0x12308
movl 0xb4f1(%rip), %esi      # 0x1230c
callq 0x33c0
cmpl $-0x1, %eax
je 0x6e37
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x3a49
leaq -0x30(%rbp), %rdi
callq 0x39e3
leaq -0x30(%rbp), %rdi
callq 0x3a16
// File: /workspace/github_cpp_makefile_star2_O1/brandoncanaday[P]1730sh/1730sh.cpp
// Function: put_job_in_background(Input*, bool)
void put_job_in_background(Input * job, bool cont) {
  if(job != nullptr) {
    if(cont) {
      if(kill(-job->getJID(), SIGCONT) < 0) {
	nope_out("kill(SIGCONT)");  
      } // if
    } // if
  } // if
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
xorb $0x1, %sil
testq %rdi, %rdi
sete %al
orb %sil, %al
jne 0x6e74
xorl %eax, %eax
subl (%rdi), %eax
movl %eax, %edi
movl $0x12, %esi
callq 0x33d0
testl %eax, %eax
js 0x6e7a
addq $0x20, %rsp
popq %rbp
retq
leaq -0x20(%rbp), %rdi
callq 0x3a7c
// File: /workspace/github_cpp_makefile_star2_O1/brandoncanaday[P]1730sh/1730sh.cpp
// Function: mk_cstrvec(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
vector<char *> mk_cstrvec(vector<string> & strvec) {
  vector<char *> cstrvec;
  for (unsigned int i = 0, s = strvec.size(); i < s; i++) {
    cstrvec.push_back(new char [strvec.at(i).size() + 1]);
    strcpy(cstrvec.at(i), strvec.at(i).c_str());
  } // for
  cstrvec.push_back(nullptr);
  return cstrvec;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x8(%rsi), %r13
subq (%rsi), %r13
shrq $0x5, %r13
testl %r13d, %r13d
je 0x6f4a
movq %rsi, %r14
xorl %r12d, %r12d
xorl %r15d, %r15d
movq (%r14), %rax
movq 0x8(%r14), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %r15, %rdx
jbe 0x6f99
movq 0x8(%rax,%r12), %rdi
incq %rdi
callq 0x3030
movq %rax, -0x30(%rbp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x6efb
movq %rax, (%rsi)
addq $0x8, 0x8(%rbx)
jmp 0x6f07
movq %rbx, %rdi
leaq -0x30(%rbp), %rdx
callq 0xa524
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r15, %rdx
jbe 0x6f88
movq (%r14), %rcx
movq 0x8(%r14), %rdx
subq %rcx, %rdx
sarq $0x5, %rdx
cmpq %r15, %rdx
jbe 0x6f88
movq (%rax,%r15,8), %rdi
movq (%rcx,%r12), %rsi
callq 0x3280
incq %r15
addq $0x20, %r12
cmpl %r15d, %r13d
jne 0x6ebf
movq $0x0, -0x30(%rbp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x6f6a
movq $0x0, (%rsi)
addq $0x8, 0x8(%rbx)
jmp 0x6f76
leaq -0x30(%rbp), %rdx
movq %rbx, %rdi
callq 0xa524
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7b15(%rip), %rdi      # 0xeaa4
movq %r15, %rsi
xorl %eax, %eax
callq 0x3440
leaq 0x7b04(%rip), %rdi      # 0xeaa4
movq %r15, %rsi
xorl %eax, %eax
callq 0x3440
jmp 0x6fb0
jmp 0x6fb0
jmp 0x6fb0
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x6fc7
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x32c0
movq %r14, %rdi
callq 0x3530
// File: /workspace/github_cpp_makefile_star2_O1/brandoncanaday[P]1730sh/1730sh.cpp
// Function: delete_from_current_jobs(Input*)
void delete_from_current_jobs(Input * job) {
  if(job != nullptr) {
    for(unsigned int i = 0, s = current_jobs.size(); i < s; i++) {
      if(current_jobs[i] != nullptr) {
	if(job->getJID() == current_jobs[i]->getJID()) { 
	  delete job; 
	  current_jobs[i] = nullptr; 
	  break;
	} // if
      } // if
    } // for
  } // if
}

// Assembly:
testq %rdi, %rdi
je 0x73e8
movq 0xaf92(%rip), %rcx      # 0x12318
movq 0xaf83(%rip), %rax      # 0x12310
subq %rax, %rcx
shrq $0x3, %rcx
testl %ecx, %ecx
je 0x73e8
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl %ecx, %ecx
xorl %r14d, %r14d
movq (%rax,%r14,8), %rdx
testq %rdx, %rdx
je 0x73b6
movl (%rbx), %esi
cmpl (%rdx), %esi
je 0x73c0
incq %r14
cmpq %r14, %rcx
jne 0x73a7
jmp 0x73e4
movq %rbx, %rdi
callq 0x9bc0
movl $0xe8, %esi
movq %rbx, %rdi
callq 0x32c0
movq 0xaf34(%rip), %rax      # 0x12310
movq $0x0, (%rax,%r14,8)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/brandoncanaday[P]1730sh/Input.cpp
// Function: Input::setShellInput(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Input::setShellInput(string input) {
  const char * ws = " \t"; // chars to trim
  input = input.erase(input.find_last_not_of(ws) + 1); // trims end 
  input = input.erase(0, input.find_first_not_of(ws)); // trims beginning  
  this->shellInput = input;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x3efa(%rip), %rsi      # 0xeb10
movl $0x2, %ecx
movq %rbx, %rdi
movq $-0x1, %rdx
callq 0x3480
incq %rax
movq 0x8(%rbx), %rcx
cmpq %rax, %rcx
jb 0xac8d
movq %rax, 0x8(%rbx)
movq (%rbx), %rcx
movb $0x0, (%rcx,%rax)
movq %rbx, %rdi
movq %rbx, %rsi
callq 0x3180
leaq 0x3ebd(%rip), %rsi      # 0xeb10
movl $0x2, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x34f0
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x3080
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3180
addq $0x10, %r14
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x3180
leaq 0x3ece(%rip), %rdi      # 0xeb62
leaq 0x3eb3(%rip), %rsi      # 0xeb4e
movq %rax, %rdx
xorl %eax, %eax
callq 0x3440
nop
// File: /workspace/github_cpp_makefile_star2_O1/brandoncanaday[P]1730sh/Input.cpp
// Function: Input::setSTDIN()
void Input::setSTDIN() {
  string fd = "STDIN_FILENO";
  stringstream ss(this->shellInput);
  vector<string> argv;
  string arg;
  while(ss >> arg) {
    argv.push_back(arg);
  } // while
  vector<string> processed_argv = processArgv(argv);
  for(unsigned int i = 0; i < processed_argv.size(); i++) {
    if(i > 0) {
      if(processed_argv[i-1] == "<") {
	fd = processed_argv[i];
	break;
      } // if
    } // if 
  } // for
  this->fd_STDIN = fd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rdi, %rbx
leaq -0x50(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x23a5(%rip), %rsi      # 0xd089
leaq 0x23aa(%rip), %rdx      # 0xd095
leaq -0x60(%rbp), %rdi
callq 0xa038
leaq 0x10(%rbx), %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 -0x70(%rbp), %r13
movq %r13, -0x10(%r13)
movq %rax, -0x8(%r13)
movb $0x0, (%r13)
leaq -0x240(%rbp), %r15
leaq -0x80(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x3370
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xad5f
movq %r14, %rdi
movq %r12, %rsi
callq 0x9d80
jmp 0xad39
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 0xadf6
movl $0x1, %r12d
xorl %r14d, %r14d
leaq 0x22b5(%rip), %r15      # 0xd05d
cmpl $0x1, %r12d
je 0xadc6
leal -0x2(%r12), %eax
shlq $0x5, %rax
addq %rax, %rdi
movq %r15, %rsi
callq 0x30b0
testl %eax, %eax
je 0xade2
movl %r12d, %r14d
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rax
subq %rdi, %rax
sarq $0x5, %rax
incl %r12d
cmpq %r14, %rax
ja 0xada8
jmp 0xadf6
shlq $0x5, %r14
addq -0x40(%rbp), %r14
leaq -0x60(%rbp), %rdi
movq %r14, %rsi
callq 0x3180
addq $0x48, %rbx
leaq -0x60(%rbp), %rsi
movq %rbx, %rdi
callq 0x3180
leaq -0x40(%rbp), %rdi
callq 0x9d16
movq -0x80(%rbp), %rdi
cmpq %r13, %rdi
je 0xae24
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x32c0
leaq -0xa0(%rbp), %rdi
callq 0x9d16
movq 0x7171(%rip), %rsi      # 0x11fa8
leaq -0x240(%rbp), %rdi
callq 0x31f0
leaq -0x1c0(%rbp), %rdi
callq 0x30e0
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0xae68
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x32c0
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xae7c
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
jmp 0xae8f
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x9d16
jmp 0xaea0
jmp 0xae9d
movq %rax, %rbx
jmp 0xaee0
movq %rax, %rbx
movq -0x80(%rbp), %rdi
cmpq %r13, %rdi
je 0xaeb5
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x32c0
leaq -0xa0(%rbp), %rdi
callq 0x9d16
movq 0x70e0(%rip), %rsi      # 0x11fa8
leaq -0x240(%rbp), %rdi
callq 0x31f0
leaq -0x1c0(%rbp), %rdi
callq 0x30e0
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0xaef9
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x32c0
movq %rbx, %rdi
callq 0x3530
nop
// File: /workspace/github_cpp_makefile_star2_O1/brandoncanaday[P]1730sh/Input.cpp
// Function: Input::setJID(int)
void Input::setJID(pid_t pgid) {
  this->JID = pgid;
  for(int i = 0, s = processes.size(); i < s; i++) {
    processes[i].PGID = pgid;
  } // for
}

// Assembly:
movl %esi, (%rdi)
movq 0x30(%rdi), %rax
movq 0x38(%rdi), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x3333333333333333, %rcx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rdx, %rcx
testl %ecx, %ecx
jle 0xc0cf
pushq %rbp
movq %rsp, %rbp
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
addq $0x4, %rax
movl %esi, (%rax)
addq $0x28, %rax
decq %rcx
jne 0xc0c3
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/brandoncanaday[P]1730sh/Input.cpp
// Function: Input::getNumPipes() const
const int Input::getNumPipes() const {
  int pipes = 0;
  for(unsigned int i = 0; i < processes.size(); i++) {
    if(processes[i].hasPipe) { // if not the last process in input
      pipes++;
    } // if
  } // for
  return pipes;
}

// Assembly:
movq 0x30(%rdi), %rcx
movq 0x38(%rdi), %rax
subq %rcx, %rax
je 0xc112
pushq %rbp
movq %rsp, %rbp
sarq $0x3, %rax
movabsq $-0x3333333333333333, %rdx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rax, %rdx
addq $0xa, %rcx
xorl %eax, %eax
movl $0x1, %esi
movzbl (%rcx), %edi
addl %edi, %eax
movl %esi, %edi
addq $0x28, %rcx
incl %esi
cmpq %rdi, %rdx
ja 0xc0fe
popq %rbp
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/brandoncanaday[P]1730sh/Input.cpp
// Function: Input::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Input& Input::operator=(string input) {
  setShellInput(input); 
  set_foreground();
  setSTDIN();
  setSTDOUT();
  setSTDERR();
  this->processes = inputToProcesses();
  return *this;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq -0x38(%rbp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x9f9e
movq %rbx, %rdi
movq %r14, %rsi
callq 0xac02
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0xc237
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x32c0
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
cmpb $0x26, -0x1(%rax,%rcx)
setne 0x4(%rbx)
movq %rbx, %rdi
callq 0xacbe
movq %rbx, %rdi
callq 0xaf02
movq %rbx, %rdi
callq 0xb202
leaq -0x68(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0xb506
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x30(%rbx), %rax
movups 0x38(%rbx), %xmm0
movq (%r14), %rcx
movq %rcx, 0x30(%rbx)
movq 0x8(%r14), %rcx
movq %rcx, 0x38(%rbx)
movq 0x10(%r14), %rcx
movq %rcx, 0x40(%rbx)
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
movq 0x10(%rdi), %rsi
movq %rax, (%rdi)
movups %xmm0, 0x8(%rdi)
movq %rcx, (%r14)
movq %rdx, 0x8(%r14)
movq %rsi, 0x10(%r14)
callq 0x9ebc
movq %r14, %rdi
callq 0x9ebc
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0xc2f0
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x32c0
movq %rbx, %rdi
callq 0x3530
// File: /workspace/github_cpp_makefile_star2_O1/brandoncanaday[P]1730sh/Input.cpp
// Function: operator<<(std::ostream&, Input&)
ostream& operator<<(ostream& output, Input& rhs) { 
  output << "JID = " << rhs.getJID() << ", In foreground? " << rhs.isForeground() << endl;
  for(unsigned int i = 0, s = rhs.getProcesses().size(); i < s; i++) {
    output << "Process " << i << " (PID/PGID = " << rhs.getProcesses()[i].PID << "/" << rhs.getProcesses()[i].PGID << ") argv: ";
    for(unsigned int j = 0; j < rhs.getProcesses()[i].args.size(); j++) {
      output << rhs.getProcesses()[i].args[j] << " ";
    } // for
    if(i != s-1) { output << endl; } // if not last iter
  } // for
  return output;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x27fd(%rip), %rsi      # 0xeb13
movl $0x6, %edx
callq 0x3300
movl (%r14), %esi
movq %rbx, %rdi
callq 0x3510
movq %rax, %r15
leaq 0x27e5(%rip), %rsi      # 0xeb1a
movl $0x11, %edx
movq %rax, %rdi
callq 0x3300
movzbl 0x4(%r14), %esi
movq %r15, %rdi
callq 0x34b0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
movq 0x38(%r14), %rcx
subq 0x30(%r14), %rcx
sarq $0x3, %rcx
movabsq $-0x3333333333333333, %rax # imm = 0xCCCCCCCCCCCCCCCD
imulq %rcx, %rax
testl %eax, %eax
je 0xc4e7
leal -0x1(%rax), %ecx
movq %rcx, -0x40(%rbp)
movl %eax, %eax
movq %rax, -0x38(%rbp)
xorl %r15d, %r15d
movl $0x8, %edx
movq %rbx, %rdi
leaq 0x2772(%rip), %rsi      # 0xeb2c
callq 0x3300
movq %rbx, %rdi
movq %r15, %rsi
callq 0x31a0
movq %rax, %r13
movl $0xd, %edx
movq %rax, %rdi
leaq 0x2759(%rip), %rsi      # 0xeb35
callq 0x3300
movq 0x30(%r14), %rax
movq %r15, -0x30(%rbp)
leaq (,%r15,8), %rcx
leaq (%rcx,%rcx,4), %r12
movl (%rax,%r12), %esi
movq %r13, %rdi
callq 0x3510
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
leaq 0x24e1(%rip), %rsi      # 0xe8f4
callq 0x3300
movq 0x30(%r14), %rax
movl 0x4(%rax,%r12), %esi
movq %r13, %rdi
callq 0x3510
movl $0x8, %edx
movq %rax, %rdi
leaq 0x270b(%rip), %rsi      # 0xeb43
callq 0x3300
movq 0x30(%r14), %rcx
movq 0x10(%rcx,%r12), %rax
cmpq %rax, 0x18(%rcx,%r12)
leaq 0x12d0(%rip), %r15      # 0xd722
je 0xc4a9
movl $0x1, %r13d
movq -0x30(%rbp), %rcx
leaq (%rcx,%rcx,4), %r12
xorl %ecx, %ecx
shlq $0x5, %rcx
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
movq %rbx, %rdi
callq 0x3300
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x3300
movl %r13d, %ecx
movq 0x30(%r14), %rdx
movq 0x10(%rdx,%r12,8), %rax
movq 0x18(%rdx,%r12,8), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
incl %r13d
cmpq %rcx, %rdx
ja 0xc464
movq -0x30(%rbp), %r15
cmpq -0x40(%rbp), %r15
je 0xc4da
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
incq %r15
cmpq -0x38(%rbp), %r15
jne 0xc3ab
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/brandoncanaday[P]1730sh/Input.cpp
// Function: trim(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string trim(string input) {
  string s = input;
  const char * ws = " \t"; // chars to trim
  s = s.erase(s.find_last_not_of(ws) + 1); // trims end 
  s = s.erase(0, s.find_first_not_of(ws)); // trims beginning  
  return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
movq %rax, %rsi
callq 0x9f9e
leaq 0x25ea(%rip), %rsi      # 0xeb10
movl $0x2, %ecx
movq %rbx, %rdi
movq $-0x1, %rdx
callq 0x3480
incq %rax
movq 0x8(%rbx), %rcx
cmpq %rax, %rcx
jb 0xc598
movq %rax, 0x8(%rbx)
movq (%rbx), %rcx
movb $0x0, (%rcx,%rax)
movq %rbx, %rdi
movq %rbx, %rsi
callq 0x3180
leaq 0x25ad(%rip), %rsi      # 0xeb10
movl $0x2, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x34f0
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x3080
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3180
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x25c3(%rip), %rdi      # 0xeb62
leaq 0x25a8(%rip), %rsi      # 0xeb4e
movq %rax, %rdx
xorl %eax, %eax
callq 0x3440
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0xc5c6
movq (%r15), %rsi
incq %rsi
callq 0x32c0
movq %r14, %rdi
callq 0x3530
// File: /workspace/github_cpp_makefile_star2_O1/brandoncanaday[P]1730sh/Input.cpp
// Function: sanitize(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string sanitize(string input, string charsToRemove) {
  const string unwanted = charsToRemove ;
  std::string sanitized_str = "";
  for(char c : input) {
    if(unwanted.find(c) == string::npos) {
      sanitized_str += c;
    } // if
  } // for
  return sanitized_str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x48(%rbp), %rax
movq %rax, -0x10(%rax)
movq (%rdx), %rsi
movq 0x8(%rdx), %rdx
addq %rsi, %rdx
leaq -0x58(%rbp), %rdi
callq 0x9f9e
leaq 0x10(%rbx), %rax
movq %rax, -0x38(%rbp)
movq %rax, (%rbx)
leaq 0x2500(%rip), %rdx      # 0xeb12
movq %rbx, -0x30(%rbp)
movq %rbx, %rdi
movq %rdx, %rsi
callq 0xa038
movq 0x8(%r14), %r12
testq %r12, %r12
je 0xc660
movq (%r14), %r13
xorl %ebx, %ebx
leaq -0x58(%rbp), %r14
movsbl (%r13,%rbx), %r15d
movq %r14, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x3390
cmpq $-0x1, %rax
jne 0xc658
movq -0x30(%rbp), %rdi
movl %r15d, %esi
callq 0x3250
incq %rbx
cmpq %rbx, %r12
jne 0xc633
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0xc679
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x32c0
movq -0x30(%rbp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0xc6b0
movq %rax, %r14
movq -0x30(%rbp), %rax
movq (%rax), %rdi
cmpq -0x38(%rbp), %rdi
je 0xc6b0
movq -0x38(%rbp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x32c0
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0xc6c9
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x32c0
movq %r14, %rdi
callq 0x3530
// File: /workspace/github_cpp_makefile_star2_O1/brandoncanaday[P]1730sh/Input.cpp
// Function: hasQuotes(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool hasQuotes(string input) {
  for(unsigned int i = 0; i < input.length(); i++) {
    if(i == 0) {
      if(input[i] == '"') return true;
    } else {
      if(input[i] == '"' && input[i-1] != '\\') return true;
    } // if/else
  } // for
  return false;
}

// Assembly:
movq 0x8(%rdi), %rcx
testq %rcx, %rcx
setne %al
je 0xc718
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rdx
movl $0x1, %esi
xorl %edi, %edi
movb (%rdx,%rdi), %dil
cmpl $0x1, %esi
jne 0xc6fc
cmpb $0x22, %dil
jne 0xc70b
jmp 0xc717
cmpb $0x22, %dil
jne 0xc70b
leal -0x2(%rsi), %edi
cmpb $0x5c, (%rdx,%rdi)
jne 0xc717
movl %esi, %edi
incl %esi
cmpq %rdi, %rcx
seta %al
ja 0xc6eb
popq %rbp
andb $0x1, %al
retq
// File: /workspace/github_cpp_makefile_star2_O1/brandoncanaday[P]1730sh/Input.cpp
// Function: pos_of_first_quote(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
unsigned int pos_of_first_quote(string input) {
  int pos = 0;
  for(unsigned int i = 0; i < input.length(); i++) {
    if(i == 0) {
      if(input[i] == '"') {
	pos = i; 
	break;
      } // if
    } else {
      if(input[i] == '"' && input[i-1] != '\\') {
	pos = i;
	break;
      } // if
    } // if/else
  } // for
  return pos;
}

// Assembly:
movq 0x8(%rdi), %rcx
testq %rcx, %rcx
je 0xc767
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rsi
xorl %edx, %edx
xorl %edi, %edi
movb (%rsi,%rdi), %dil
testl %edx, %edx
je 0xc750
cmpb $0x22, %dil
jne 0xc746
leal -0x1(%rdx), %eax
cmpb $0x5c, (%rsi,%rax)
jne 0xc76e
leal 0x1(%rdx), %edi
cmpq %rdi, %rcx
ja 0xc763
jmp 0xc76a
xorl %eax, %eax
cmpb $0x22, %dil
je 0xc770
movl $0x1, %edi
cmpq $0x1, %rcx
je 0xc770
incl %edx
jmp 0xc72f
xorl %eax, %eax
retq
xorl %eax, %eax
jmp 0xc770
movl %edx, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/luisremis[P]SDFS/main.cpp
// Function: main
int main (int argc, char* argv[])
{
    srand (time(NULL));

    system("rm files/*");
    system("clear");

    std::cout << std::endl << "CS425 - MP3: Distributed File System" ;
    std::cout << std::endl << std::endl;

    logFile.open("log.log");
    logFile << "Inicializing! " << std::endl;

    int port = atoi(argv[1]);
    bool isIntroducer = atoi(argv[2]);

    Membership m(isIntroducer, port);
    FileSystem fs (port + 21, m);

    std::thread cinListening(listeningCin, &m, &fs);
    cinListening.join();

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x6d8, %rsp            # imm = 0x6D8
movq %rsi, %rbx
xorl %edi, %edi
callq 0x4340
movl %eax, %edi
callq 0x4370
leaq 0xde43(%rip), %rdi      # 0x132dd
callq 0x4300
leaq 0xdd9b(%rip), %rdi      # 0x13241
callq 0x4300
movq 0x13b0e(%rip), %r14     # 0x18fc0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4380
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4260
leaq 0xde08(%rip), %rsi      # 0x132e8
movl $0x24, %edx
movq %rax, %rdi
callq 0x43f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4380
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4260
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4380
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4260
leaq 0x13e43(%rip), %r14     # 0x19388
leaq 0xddc1(%rip), %rsi      # 0x1330d
movq %r14, %rdi
movl $0x10, %edx
callq 0x4060
leaq 0xddb5(%rip), %rsi      # 0x13315
movl $0xe, %edx
movq %r14, %rdi
callq 0x43f0
movq 0x13e14(%rip), %rax     # 0x19388
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4380
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4260
movq 0x8(%rbx), %rdi
callq 0x4520
movl %eax, %r15d
movq 0x10(%rbx), %rdi
callq 0x4520
xorl %esi, %esi
testl %eax, %eax
setne %sil
leaq -0x6f0(%rbp), %rbx
movq %rbx, %rdi
movl %r15d, %edx
callq 0x57d4
addl $0x15, %r15d
leaq -0x328(%rbp), %r14
movq %r14, %rdi
movl %r15d, %esi
movq %rbx, %rdx
callq 0xb34c
leaq -0x30(%rbp), %rdx
movq %rbx, (%rdx)
leaq -0x28(%rbp), %rcx
movq %r14, (%rcx)
leaq -0xc49(%rip), %rsi      # 0x49ac
leaq -0x20(%rbp), %rdi
callq 0x566a
leaq -0x20(%rbp), %rdi
callq 0x45e0
cmpq $0x0, -0x20(%rbp)
jne 0x563d
leaq -0x328(%rbp), %rdi
callq 0xbb16
leaq -0x6f0(%rbp), %rdi
callq 0x73ec
xorl %eax, %eax
addq $0x6d8, %rsp            # imm = 0x6D8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x0, -0x20(%rbp)
je 0x5642
callq 0x4110
movq %rax, %rbx
leaq -0x328(%rbp), %rdi
callq 0xbb16
jmp 0x5656
movq %rax, %rbx
leaq -0x6f0(%rbp), %rdi
callq 0x73ec
movq %rbx, %rdi
callq 0x4630
// File: /workspace/github_cpp_makefile_star2_O1/luisremis[P]SDFS/Membership.cpp
// Function: Membership::join()
void Membership::join()
{
	bool joined = firstJoin();
    while( !isIntroducer && !joined)
    {   //introducer will firstJoin() once. Other node will keep firstJoin() until it enter the group.
        joined = firstJoin();
        //usleep( 1000*1000 );
    }


    MemberUpdateMsg msg( MSG_JOIN_FINISH , members[0]);
    pushMsgToFileSysQueue(msg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xa0, %rsp
movq %rdi, %rbx
callq 0x7592
testb %al, %al
jne 0x5ee8
cmpb $0x0, 0x2cc(%rbx)
jne 0x5ee8
movq %rbx, %rdi
jmp 0x5ed1
movq 0x258(%rbx), %r12
leaq -0x38(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq -0x48(%rbp), %r14
movq %r14, %rdi
callq 0x570a
movq 0x20(%r12), %rax
movq %rax, 0x20(%r14)
leaq -0xb8(%rbp), %rdi
movl $0x8, %esi
movq %r14, %rdx
callq 0x9fcc
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x5f3a
callq 0x4360
leaq -0x80(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0xa030
leaq -0x80(%rbp), %rsi
movq %rbx, %rdi
callq 0x7aee
leaq -0x68(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5f68
callq 0x4360
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5f7d
callq 0x4360
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x68(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5fa7
callq 0x4360
jmp 0x5fa7
movq %rax, %rbx
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5fbc
callq 0x4360
movq %rbx, %rdi
callq 0x4630
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
jne 0x5fb7
jmp 0x5fbc
// File: /workspace/github_cpp_makefile_star2_O1/luisremis[P]SDFS/Membership.cpp
// Function: Membership::~Membership()
Membership::~Membership()
{
	//Kill threads
	killListeningThread = true;
	killDetectingThread = true;

	listening.join();
	detecting.join();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movw $0x101, 0x350(%rdi)     # imm = 0x101
leaq 0x338(%rdi), %r14
movq %r14, %rdi
callq 0x45e0
leaq 0x340(%rbx), %r15
movq %r15, %rdi
callq 0x45e0
leaq 0x398(%rbx), %rdi
callq 0x4660
leaq 0x358(%rbx), %rdi
callq 0xa2be
cmpq $0x0, 0x348(%rbx)
jne 0x74fa
cmpq $0x0, (%r15)
jne 0x74fa
cmpq $0x0, (%r14)
jne 0x74fa
movq 0x2f8(%rbx), %rdi
testq %rdi, %rdi
je 0x746b
callq 0x4360
movq 0x2d8(%rbx), %rdi
leaq 0x2e8(%rbx), %rax
cmpq %rax, %rdi
je 0x7483
callq 0x4360
movq 0x270(%rbx), %rdi
leaq 0x280(%rbx), %rax
cmpq %rax, %rdi
je 0x749b
callq 0x4360
leaq 0x258(%rbx), %rdi
callq 0xa33e
leaq 0x218(%rbx), %rdi
callq 0xa33e
leaq 0x200(%rbx), %rdi
callq 0xa38c
movq 0x11af2(%rip), %rax     # 0x18fb8
movq (%rax), %rcx
movq 0x18(%rax), %rax
movq %rcx, (%rbx)
movq -0x18(%rcx), %rcx
movq %rax, (%rbx,%rcx)
leaq 0x8(%rbx), %rdi
callq 0x42f0
addq $0xf8, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4160
callq 0x4110
movq %rax, %r15
leaq 0x398(%rbx), %rdi
callq 0x4660
leaq 0x358(%rbx), %rdi
callq 0xa2be
leaq 0x348(%rbx), %rdi
callq 0xa2ae
leaq 0x340(%rbx), %rdi
callq 0xa2ae
movq %r14, %rdi
callq 0xa2ae
leaq 0x2f8(%rbx), %rdi
callq 0xa30e
leaq 0x2d8(%rbx), %rdi
callq 0x41c0
leaq 0x270(%rbx), %rdi
callq 0xa322
leaq 0x258(%rbx), %rdi
callq 0xa33e
leaq 0x218(%rbx), %rdi
callq 0xa33e
leaq 0x200(%rbx), %rdi
callq 0xa38c
movq %rbx, %rdi
callq 0x46c8
movq %r15, %rdi
callq 0x4440
// File: /workspace/github_cpp_makefile_star2_O1/luisremis[P]SDFS/Membership.cpp
// Function: Membership::pushMsgToFileSysQueue(MemberUpdateMsg)
void Membership::pushMsgToFileSysQueue(MemberUpdateMsg msg){
    std::unique_lock<std::mutex> locker( fileSysMsgQueueLock );

    this->fileSysMsgQueue.push_back(msg);

    this->fileSysMsgQueueCV.notify_all();
    usleep(5000);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x370(%rdi), %rax
leaq -0x28(%rbp), %r15
movq %rax, (%r15)
movb $0x0, 0x8(%r15)
movq %r15, %rdi
callq 0xaf5e
movb $0x1, 0x8(%r15)
leaq 0x358(%rbx), %rdi
movq %r14, %rsi
callq 0xa622
addq $0x398, %rbx            # imm = 0x398
movq %rbx, %rdi
callq 0x45d0
movl $0x1388, %edi           # imm = 0x1388
callq 0x4490
leaq -0x28(%rbp), %rdi
callq 0xa65e
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x28(%rbp), %rdi
callq 0xa65e
movq %rbx, %rdi
callq 0x4630
nop
// File: /workspace/github_cpp_makefile_star2_O1/luisremis[P]SDFS/Membership.cpp
// Function: Membership::leave()
void Membership::leave()
{
    membersLock.lock();
    Message msg;
    msg.type = MSG_LEAVE;
    msg.TTL = 1; // Just in case
    ipString2Char4(members.at(0).ip_str, msg.carrierAdd);
    msg.timeStamp = members.at(0).timeStamp;
    membersLock.unlock();
    spreadMessage(msg); // this method wants the lock!
    
    while(members.size()!=0){
        failMember(members[0].ip_str, members[0].timeStamp);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %rdi, %rbx
leaq 0x230(%rdi), %r14
movq %r14, %rdi
callq 0x44d0
testl %eax, %eax
jne 0x7ca2
movl $0x7, -0x38(%rbp)
movb $0x1, -0x28(%rbp)
movq 0x258(%rbx), %rax
movq 0x260(%rbx), %rcx
subq %rax, %rcx
je 0x7ca9
leaq -0x68(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x78(%rbp), %r15
movq %r15, %rdi
callq 0x570a
leaq -0x33(%rbp), %rsi
movq %r15, %rdi
callq 0x1114c
movq -0x78(%rbp), %rdi
cmpq %r12, %rdi
je 0x7bf6
callq 0x4360
movq 0x258(%rbx), %rcx
movq 0x260(%rbx), %rax
subq %rcx, %rax
je 0x7cbd
movl 0x20(%rcx), %eax
movl %eax, -0x2c(%rbp)
movq %r14, %rdi
callq 0x42a0
movl -0x28(%rbp), %eax
movl %eax, 0x10(%rsp)
movups -0x38(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7d06
movq 0x258(%rbx), %rax
cmpq %rax, 0x260(%rbx)
je 0x7c95
leaq -0x48(%rbp), %r15
leaq -0x58(%rbp), %r14
movq %r15, -0x58(%rbp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x570a
movq 0x258(%rbx), %rax
movl 0x20(%rax), %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8040
movq -0x58(%rbp), %rdi
cmpq %r15, %rdi
je 0x7c85
callq 0x4360
movq 0x258(%rbx), %rax
cmpq %rax, 0x260(%rbx)
jne 0x7c4c
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x4240
sarq $0x3, %rcx
movabsq $-0x3333333333333333, %rdx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rcx, %rdx
jmp 0x7ccf
sarq $0x3, %rax
movabsq $-0x3333333333333333, %rdx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rax, %rdx
leaq 0xbc9f(%rip), %rdi      # 0x13975
xorl %esi, %esi
xorl %eax, %eax
callq 0x44e0
movq %rax, %rbx
movq -0x78(%rbp), %rdi
cmpq %r12, %rdi
jne 0x7cf9
jmp 0x7cfe
movq %rax, %rbx
movq -0x58(%rbp), %rdi
cmpq %r15, %rdi
je 0x7cfe
callq 0x4360
movq %rbx, %rdi
callq 0x4630
// File: /workspace/github_cpp_makefile_star2_O1/luisremis[P]SDFS/Membership.cpp
// Function: Membership::failMember(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
int Membership::failMember(std::string ip_str, int timeStamp){

    membersLock.lock();

    bool exist = false;
    int position = 0;

    for(int i=0; i<members.size(); i++){
        if( members[i].ip_str.compare( ip_str )==0 && members[i].timeStamp == timeStamp ){
            exist = true;
            position = i;
            break;
        }
    }
    
    if(exist){
        MemberUpdateMsg msg(MSG_LEAVE, members[position]);
        pushMsgToFileSysQueue(msg);

        members.erase( members.begin()+position );
    }
    
    membersLock.unlock();

    checkLeader();

    return !exist;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movl %edx, -0x34(%rbp)
movq %rsi, %r13
movq %rdi, %rbx
leaq 0x230(%rdi), %r14
movq %r14, %rdi
callq 0x44d0
testl %eax, %eax
jne 0x81e1
movq %r14, -0x40(%rbp)
leaq 0x258(%rbx), %rax
movq %rax, -0x30(%rbp)
movq 0x258(%rbx), %rdi
cmpq %rdi, 0x260(%rbx)
sete %r14b
je 0x80f0
xorl %r12d, %r12d
xorl %r15d, %r15d
addq %r12, %rdi
movq %r13, %rsi
callq 0x4050
testl %eax, %eax
jne 0x80bd
movq -0x30(%rbp), %rax
movq (%rax), %rax
movl -0x34(%rbp), %ecx
cmpl %ecx, 0x20(%rax,%r12)
je 0x80f3
incq %r15
movq 0x258(%rbx), %rdi
movq 0x260(%rbx), %rax
subq %rdi, %rax
sarq $0x3, %rax
movabsq $-0x3333333333333333, %rcx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rcx, %rax
addq $0x28, %r12
cmpq %r15, %rax
setbe %r14b
ja 0x809d
xorl %r15d, %r15d
testb $0x1, %r14b
jne 0x81b7
movq -0x30(%rbp), %rax
movq (%rax), %r13
leaq (%r15,%r15,4), %r12
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
movq (%r13,%r12,8), %rsi
movq 0x8(%r13,%r12,8), %rdx
addq %rsi, %rdx
leaq -0x68(%rbp), %r15
movq %r15, %rdi
callq 0x570a
movq 0x20(%r13,%r12,8), %rax
movq %rax, 0x20(%r15)
leaq -0xd8(%rbp), %rdi
movl $0x7, %esi
movq %r15, %rdx
callq 0x9fcc
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x8158
callq 0x4360
leaq -0xa0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0xa030
leaq -0xa0(%rbp), %rsi
movq %rbx, %rdi
callq 0x7aee
leaq -0x88(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x818f
callq 0x4360
shlq $0x3, %r12
movq -0x30(%rbp), %rdi
addq (%rdi), %r12
movq %r12, %rsi
callq 0xad4c
leaq -0xc0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x81b7
callq 0x4360
movq -0x40(%rbp), %rdi
callq 0x42a0
movq %rbx, %rdi
callq 0x9276
movzbl %r14b, %eax
andl $0x1, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x4240
jmp 0x8204
movq %rax, %rbx
leaq -0x88(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8207
callq 0x4360
jmp 0x8207
movq %rax, %rbx
leaq -0xc0(%rbp), %rax
movq -0x10(%rax), %rdi
jmp 0x821f
movq %rax, %rbx
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x8229
callq 0x4360
movq %rbx, %rdi
callq 0x4630
nop
// File: /workspace/github_cpp_makefile_star2_O1/luisremis[P]SDFS/Membership.cpp
// Function: Membership::broadcastJoin(Message, int)
int Membership::broadcastJoin(Message income, int i)
{
	income.TTL = 0;
	int connectionToServer;
    //TCP connect to members of introducer
    logFile<<"broadcastJoin: Introducer trying to broadcast join to "<<members[i].ip_str << std::endl;
    int ret = connect_to_server(members[i].ip_str.c_str(), port + 1, &connectionToServer);
    if(ret!=0){
        logFile<<"broadcastJoin: cannot connect to "<<members[i].ip_str << std::endl;
        return 1;
    }
    else{
    	ret = write(connectionToServer, &income, sizeof(Message) );
    	close(connectionToServer);
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %esi, %r14d
movq %rdi, %rbx
movb $0x0, 0x20(%rbp)
leaq 0xadd8(%rip), %rsi      # 0x134fe
movl $0x36, %edx
callq 0x43f0
movslq %r14d, %r15
movq 0x258(%rbx), %rax
leaq (,%r15,8), %rcx
leaq (%rcx,%rcx,4), %r12
movq (%rax,%r12), %rsi
movq 0x8(%rax,%r12), %rdx
movq %rbx, %rdi
callq 0x43f0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4380
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4260
movq 0x258(%rbx), %rax
movq (%rax,%r12), %rdi
movl 0x298(%rbx), %esi
incl %esi
leaq -0x24(%rbp), %rdx
callq 0x1179a
testl %eax, %eax
je 0x8802
leaq 0xad8d(%rip), %rsi      # 0x13535
movl $0x21, %edx
movq %rbx, %rdi
callq 0x43f0
movq 0x258(%rbx), %rax
leaq (%r15,%r15,4), %rcx
movq (%rax,%rcx,8), %rsi
movq 0x8(%rax,%rcx,8), %rdx
movq %rbx, %rdi
callq 0x43f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4380
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4260
movl $0x1, %eax
jmp 0x881d
leaq 0x10(%rbp), %rsi
movl -0x24(%rbp), %edi
movl $0x14, %edx
callq 0x4170
movl -0x24(%rbp), %edi
callq 0x46b0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq