LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/CoinXu[P]reviser-compiler/src/compiler/descriptor.cpp
// Function: bool reviser::compiler::VectorIncludeItem<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>(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>>>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const*)
bool VectorIncludeItem(vector<T>* v, const T* item) {
    for (auto it: *v) {
      if (it == *item) {
        return true;
      }
    }
    return false;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq (%rdi), %r13
movq 0x8(%rdi), %r14
cmpq %r14, %r13
je 0x333e0
movq %rsi, %rbx
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq -0x48(%rbp), %rdi
callq 0x290da
movq -0x40(%rbp), %rdx
cmpq 0x8(%rbx), %rdx
jne 0x333b0
movq -0x48(%rbp), %r12
testq %rdx, %rdx
je 0x333b9
movq (%rbx), %rsi
movq %r12, %rdi
callq 0x24360
testl %eax, %eax
sete %r15b
jmp 0x333bc
movq -0x48(%rbp), %r12
xorl %r15d, %r15d
jmp 0x333bc
movb $0x1, %r15b
leaq -0x38(%rbp), %rax
cmpq %rax, %r12
je 0x333cd
movq %r12, %rdi
callq 0x24320
addq $0x20, %r13
cmpq %r14, %r13
sete %al
orb %r15b, %al
cmpb $0x1, %al
jne 0x3336e
jmp 0x333e3
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CoinXu[P]reviser-compiler/src/io/path.cpp
// Function: reviser::io::join(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
string join(const string& a, const string& b) {
    string temp_a = a;
    string temp_b = b;
    if (temp_a.back() != separator) {
      temp_a += separator;
    }

    if (temp_b.front() != separator) {
      temp_b = separator + temp_b;
    }

    return normalize(temp_a + temp_b);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rdx, %r14
movq %rdi, %rbx
leaq -0x50(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0x290da
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0x40(%rbp), %rdi
callq 0x290da
movq -0x60(%rbp), %rax
movq -0x58(%rbp), %rcx
cmpb $0x2f, -0x1(%rax,%rcx)
je 0x3414c
leaq -0x60(%rbp), %rdi
movl $0x2f, %esi
callq 0x242e0
movq -0x40(%rbp), %rax
cmpb $0x2f, (%rax)
je 0x34188
leaq -0x80(%rbp), %rdi
leaq -0x40(%rbp), %rdx
movl $0x2f, %esi
callq 0x344c6
leaq -0x40(%rbp), %rdi
leaq -0x80(%rbp), %r14
movq %r14, %rsi
callq 0x24420
movq (%r14), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x34188
callq 0x24320
leaq -0x80(%rbp), %rdi
leaq -0x60(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x34543
leaq -0x80(%rbp), %rsi
movq %rbx, %rdi
callq 0x3422a
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x341b7
callq 0x24320
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x341c5
callq 0x24320
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0x341d3
callq 0x24320
movq %rbx, %rax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x341fe
jmp 0x341fe
movq %rax, %rbx
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x34201
callq 0x24320
jmp 0x34201
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x34214
callq 0x24320
jmp 0x34214
movq %rax, %rbx
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0x34222
callq 0x24320
movq %rbx, %rdi
callq 0x245f0
// File: /workspace/github_cpp_makefile_star2_O3/CoinXu[P]reviser-compiler/src/io/path.cpp
// Function: reviser::io::normalize(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
string normalize(const string& path) {
    string result = path;
    size_t index = 0;
    while (index < result.length()) {
      if (result[index] == separator && result[index + 1] == separator) {
        result.erase(index, 1);
        continue;
      }
      index++;
    }

    if (result.back() == separator) {
      result.erase(result.length() - 1, 1);
    }

    return result;
  }

// 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 0x290da
xorl %r14d, %r14d
movq (%rbx), %rax
movq 0x8(%rbx), %rsi
cmpq %rsi, %r14
jae 0x34285
cmpb $0x2f, (%rax,%r14)
jne 0x34280
cmpb $0x2f, 0x1(%rax,%r14)
jne 0x34280
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x240a0
jmp 0x34253
incq %r14
jmp 0x34253
cmpb $0x2f, -0x1(%rax,%rsi)
jne 0x3429c
decq %rsi
movl $0x1, %edx
movq %rbx, %rdi
callq 0x240a0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x342ac
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x342bc
callq 0x24320
movq %r14, %rdi
callq 0x245f0
// File: /workspace/github_cpp_makefile_star2_O3/CoinXu[P]reviser-compiler/src/io/path.cpp
// Function: reviser::io::mkdir_parents(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)
bool mkdir_parents(const string& path, int mode) {
    int size = 0;
    string current;
    while (size < path.size()) {
      current.push_back(path[size++]);
      if (current.back() == separator) {
        if (!is_dir(current)) {
          if (mkdir(current.c_str(), mode) == -1) {
            return false;
          }
        }
      }
    }

    return true;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
cmpq $0x0, 0x8(%rdi)
je 0x3447d
movl %esi, %ebx
movq %rdi, %r14
xorl %r13d, %r13d
leaq -0x48(%rbp), %r15
leaq -0xd8(%rbp), %r12
movq (%r14), %rax
movsbl (%rax,%r13), %esi
movq %r15, %rdi
callq 0x242e0
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rax
cmpb $0x2f, -0x1(%rdi,%rax)
jne 0x34470
testq %rax, %rax
je 0x34464
movq %r12, %rsi
callq 0x24300
cmpl $-0x1, %eax
je 0x34460
movl -0xc0(%rbp), %eax
movl $0x4000, %ecx           # imm = 0x4000
andl %ecx, %eax
jne 0x34470
movq -0x48(%rbp), %rdi
movl %ebx, %esi
callq 0x241b0
cmpl $-0x1, %eax
je 0x34481
incq %r13
cmpq %r13, 0x8(%r14)
ja 0x34420
movb $0x1, %bl
jmp 0x34483
movb $0x1, %bl
jmp 0x34495
xorl %ebx, %ebx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x34495
callq 0x24320
movl %ebx, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x344be
callq 0x24320
movq %rbx, %rdi
callq 0x245f0
// File: /workspace/github_cpp_makefile_star2_O3/CoinXu[P]reviser-compiler/src/io/printer_file.cpp
// Function: reviser::io::PrinterFile::PrinterFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
PrinterFile::PrinterFile(std::string path): path(path) {
    mkdir_parents(path);
    stream.open(path, std::ios::out | std::ios::trunc);
    if (!stream.is_open()) {
      throw std::runtime_error("not found file in path [" + path + "]");
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r12
movq %rdi, %r15
leaq 0x1d7e2(%rip), %rax     # 0x5fc70
movq %rax, (%rdi)
leaq 0x8(%rdi), %rbx
movq %rbx, %rdi
callq 0x245c0
leaq 0x208(%r15), %r14
leaq 0x218(%r15), %r13
movq %r13, 0x208(%r15)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x290da
movq %r12, %rdi
movl $0x1ed, %esi            # imm = 0x1ED
callq 0x343df
movq %rbx, %rdi
movq %r12, %rsi
movl $0x30, %edx
callq 0x241c0
addq $0x78, %r15
movq %r15, %rdi
callq 0x240b0
testb %al, %al
je 0x42502
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x241e0
movq %rax, %r15
leaq 0xe433(%rip), %rsi      # 0x50949
leaq -0x70(%rbp), %rdi
movq %r12, %rdx
callq 0x2b4b3
leaq 0xe4f9(%rip), %rsi      # 0x50a22
leaq -0x70(%rbp), %rdi
callq 0x24650
leaq -0x40(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x42555
movups (%rcx), %xmm0
leaq -0x40(%rbp), %rdx
movups %xmm0, (%rdx)
jmp 0x42560
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
movq 0x8(%rax), %rdx
leaq -0x50(%rbp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %al
movl %eax, -0x2c(%rbp)
movq %r15, %rdi
callq 0x24570
movl $0x0, -0x2c(%rbp)
movq 0x1da5a(%rip), %rsi     # 0x5fff0
movq 0x1d9f3(%rip), %rdx     # 0x5ff90
movq %r15, %rdi
callq 0x245d0
movq %rax, %r12
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x425ba
callq 0x24320
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x425cc
callq 0x24320
cmpb $0x0, -0x2c(%rbp)
jne 0x425ee
jmp 0x42600
movq %rax, %r12
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x425ee
callq 0x24320
jmp 0x425ee
movq %rax, %r12
movq %r15, %rdi
callq 0x242a0
jmp 0x42600
movq %rax, %r12
jmp 0x4260d
movq %rax, %r12
movq (%r14), %rdi
cmpq %r13, %rdi
je 0x4260d
callq 0x24320
movq %rbx, %rdi
callq 0x24500
movq %r12, %rdi
callq 0x245f0
nop
// File: /workspace/github_cpp_makefile_star2_O3/CoinXu[P]reviser-compiler/src/compiler/javascript/javascript_common.h
// Function: reviser::javascript::JavaScriptCommon::Indent[abi:cxx11](int)
const static string Indent(int level) {
      string s;
      for (int i = 0; i < level * IndentSize; i++) {
        s = s + " ";
      }
      return s;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, -0x30(%rbp)
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
testl %esi, %esi
jle 0x42f7c
addl %esi, %esi
leaq -0x40(%rbp), %r13
cmpl $0x2, %esi
movl $0x1, %r12d
cmovgel %esi, %r12d
leaq -0x50(%rbp), %r14
leaq 0xc949(%rip), %r15      # 0x4f886
movq %r13, -0x50(%rbp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x290da
movq %r14, %rdi
movq %r15, %rsi
callq 0x24650
movq %rbx, %rdi
movq %r14, %rsi
callq 0x24420
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x42f77
callq 0x24320
decl %r12d
jne 0x42f3d
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x42fa4
movq %rax, %r14
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x42fa4
callq 0x24320
movq (%rbx), %rdi
cmpq -0x30(%rbp), %rdi
je 0x42fb2
callq 0x24320
movq %r14, %rdi
callq 0x245f0
nop
// File: /workspace/github_cpp_makefile_star2_O3/CoinXu[P]reviser-compiler/src/compiler/javascript/javascript_common.h
// Function: reviser::javascript::JavaScriptCommon::JoinVector(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>>>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
const static string JoinVector(vector<string> v, string separator) {
      string result;

      for (vector<string>::const_iterator it = begin(v); it != end(v); it++) {
        result += *it;
        if (next(it) != end(v)) {
          result += separator;
        }
      }

      return result;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x10(%rdi), %r12
movq %r12, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
movq (%rsi), %r13
cmpq 0x8(%rsi), %r13
je 0x43bdc
movq %rdx, %r14
movq %rsi, %r15
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq %rbx, %rdi
callq 0x240f0
addq $0x20, %r13
cmpq 0x8(%r15), %r13
je 0x43bdc
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x240f0
cmpq 0x8(%r15), %r13
jne 0x43bad
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r12, %rdi
je 0x43bfe
callq 0x24320
movq %r14, %rdi
callq 0x245f0
// File: /workspace/github_cpp_makefile_star2_O3/CoinXu[P]reviser-compiler/src/compiler/javascript/javascript_common.h
// Function: reviser::javascript::JavaScriptCommon::FindReviserSyntaxDefinitionByDataType(reviser::compiler::DataType)
const static vector<ReviserSyntaxDefinition> FindReviserSyntaxDefinitionByDataType(DataType type) {
      vector<ReviserSyntaxDefinition> defs;

      if (JavaScriptDataTypeReviserMap.find(type) == JavaScriptDataTypeReviserMap.end()) {
        return defs;
      }

      for (ReviserType t : JavaScriptDataTypeReviserMap.at(type)) {
        if (ReviserMethodMap.find(t) != ReviserMethodMap.end()) {
          defs.push_back(ReviserMethodMap.at(t));
        }
      }

      return defs;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, -0x30(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x1b7f9(%rip), %rcx     # 0x60ca8
testq %rcx, %rcx
je 0x45565
leaq 0x1b7e1(%rip), %rax     # 0x60ca0
xorl %edx, %edx
cmpl %esi, 0x20(%rcx)
setl %dl
cmovgeq %rcx, %rax
movq 0x10(%rcx,%rdx,8), %rcx
testq %rcx, %rcx
jne 0x454bf
leaq 0x1b7c4(%rip), %rcx     # 0x60ca0
cmpq %rcx, %rax
je 0x45565
cmpl %esi, 0x20(%rax)
jg 0x45565
leaq 0x1b7a7(%rip), %rdi     # 0x60c98
leaq -0x30(%rbp), %rsi
callq 0x45744
movq (%rax), %r12
movq 0x8(%rax), %r13
cmpq %r13, %r12
je 0x45565
leaq 0x1b5e3(%rip), %r14     # 0x60af0
leaq 0x8(%r14), %r15
movl (%r12), %eax
movl %eax, -0x2c(%rbp)
movq 0x10(%r14), %rcx
testq %rcx, %rcx
je 0x4555c
movq %r15, %rdx
xorl %esi, %esi
cmpl %eax, 0x20(%rcx)
setl %sil
cmovgeq %rcx, %rdx
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0x45524
cmpq %r15, %rdx
je 0x4555c
cmpl 0x20(%rdx), %eax
jl 0x4555c
movq %r14, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x457c6
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4578e
addq $0x4, %r12
cmpq %r13, %r12
jne 0x45511
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x45579
movq %rax, %r14
movq %rbx, %rdi
callq 0x4560c
movq %r14, %rdi
callq 0x245f0
// File: /workspace/github_cpp_makefile_star2_O3/CoinXu[P]reviser-compiler/src/compiler/javascript/javascript_common.h
// Function: reviser::javascript::JavaScriptCommon::DecoraterDefinition[abi:cxx11](reviser::compiler::ReviserSyntaxDefinition, std::vector<reviser::compiler::DecoraterArg, std::allocator<reviser::compiler::DecoraterArg>>*)
const static string DecoraterDefinition(ReviserSyntaxDefinition def, vector<DecoraterArg>* args = nullptr) {
      switch (def.type) {
        case SYNTAX_FUNCTION:
          return def.name;

        case SYNTAX_CALLABLE:
          return DecoraterSyntaxCallable(def, args);

        default:
          return "";
      }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movl 0x20(%rsi), %eax
testl %eax, %eax
je 0x482cd
cmpl $0x1, %eax
jne 0x48334
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x290da
jmp 0x4834d
movq %rdx, %r14
leaq -0x58(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq -0x68(%rbp), %r12
movq %r12, %rdi
callq 0x290da
movl 0x20(%r15), %eax
movl %eax, 0x20(%r12)
leaq -0x40(%rbp), %rdi
addq $0x28, %r15
movq %r15, %rsi
callq 0x31fca
leaq -0x68(%rbp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x4845a
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x48324
callq 0x24320
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x4834d
callq 0x24320
jmp 0x4834d
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x8812(%rip), %rdx      # 0x50b54
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x29178
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x31e5e
jmp 0x4837e
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x4837e
callq 0x24320
movq %rbx, %rdi
callq 0x245f0
// File: /workspace/github_cpp_makefile_star2_O3/CoinXu[P]reviser-compiler/src/compiler/typescript/typescript_common.h
// Function: reviser::typescript::TypeScriptCommon::FindReviserSyntaxDefinitionByDataType(reviser::compiler::DataType)
const static vector<ReviserSyntaxDefinition> FindReviserSyntaxDefinitionByDataType(DataType type) {
      vector<ReviserSyntaxDefinition> defs;

      if (TypeScriptDataTypeReviserMap.find(type) == TypeScriptDataTypeReviserMap.end()) {
        return defs;
      }

      for (ReviserType t : TypeScriptDataTypeReviserMap.at(type)) {
        if (ReviserMethodMap.find(t) != ReviserMethodMap.end()) {
          defs.push_back(ReviserMethodMap.at(t));
        }
      }

      return defs;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, -0x30(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x1503d(%rip), %rcx     # 0x60e08
testq %rcx, %rcx
je 0x4be81
leaq 0x15025(%rip), %rax     # 0x60e00
xorl %edx, %edx
cmpl %esi, 0x20(%rcx)
setl %dl
cmovgeq %rcx, %rax
movq 0x10(%rcx,%rdx,8), %rcx
testq %rcx, %rcx
jne 0x4bddb
leaq 0x15008(%rip), %rcx     # 0x60e00
cmpq %rcx, %rax
je 0x4be81
cmpl %esi, 0x20(%rax)
jg 0x4be81
leaq 0x14feb(%rip), %rdi     # 0x60df8
leaq -0x30(%rbp), %rsi
callq 0x45744
movq (%rax), %r12
movq 0x8(%rax), %r13
cmpq %r13, %r12
je 0x4be81
leaq 0x14cc7(%rip), %r14     # 0x60af0
leaq 0x8(%r14), %r15
movl (%r12), %eax
movl %eax, -0x2c(%rbp)
movq 0x10(%r14), %rcx
testq %rcx, %rcx
je 0x4be78
movq %r15, %rdx
xorl %esi, %esi
cmpl %eax, 0x20(%rcx)
setl %sil
cmovgeq %rcx, %rdx
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0x4be40
cmpq %r15, %rdx
je 0x4be78
cmpl 0x20(%rdx), %eax
jl 0x4be78
movq %r14, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x457c6
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4578e
addq $0x4, %r12
cmpq %r13, %r12
jne 0x4be2d
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4be95
movq %rax, %r14
movq %rbx, %rdi
callq 0x4560c
movq %r14, %rdi
callq 0x245f0
// File: /workspace/github_cpp_makefile_star2_O3/overfl0[P]iojack/iojack.cpp
// Function: setSignalHandlers()
void setSignalHandlers()
{
    struct sigaction sa;
    memset(&sa, 0, sizeof(struct sigaction));

    sa.sa_handler = signal_sigint;
    sa.sa_flags = SA_RESTART;

    sigaction(SIGINT, &sa, NULL);
}

// Assembly:
pushq %rbx
subq $0xa0, %rsp
leaq 0x10(%rsp), %rbx
movl $0x90, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x20d0
leaq -0x129(%rip), %rax      # 0x273c
movq %rax, -0x8(%rbx)
movl $0x10000000, 0x80(%rbx) # imm = 0x10000000
leaq 0x8(%rsp), %rsi
movl $0x2, %edi
xorl %edx, %edx
callq 0x2200
addq $0xa0, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/overfl0[P]iojack/iojack.cpp
// Function: stdinPoll(void*)
void *stdinPoll(void *inBuf)
{
    buffer *inputBuffer = (buffer *)inBuf;
    initTerminal();
    while(!wantToExit)
    {
        int c = getTerminalChar();
        if(c != -1)
        {
            // Lock the buffer and read as much data as you can (useful with
            // special sequences of more than one character)
            inputBuffer->lock();
            do
            {
                inputBuffer->add(c);
                c = getTerminalChar();
            }
            while(c != -1);
            inputBuffer->unlock();

            // TODO: Clean up this mess! Possibly move to a separate function
            // Wake up reading processes
            foreach(processes, it)
            {
                if(it->second->inSyscall && it->second->fakingSyscall == -1)
                {
                    //TODO: if possible, check if the syscall is sys_read
                    it->second->sigstopToRestartSyscall = 1;
                    int retval = kill(it->second->pid, SIGSTOP);
                    if(retval)
                    {
                        printf("Error while sending SIGSTOP to %d\n", it->second->pid);
                        perror("Error");
                    }
                }
            }
        }
        //thread_sleep(10);
        struct timespec waitTime;
        waitTime.tv_sec = 0;
        waitTime.tv_nsec = 100000000; // 0.1 sec
        nanosleep(&waitTime, NULL);
    }
    uninitTerminal();

    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x3a38
cmpl $0x0, 0x8914(%rip)      # 0xb1bc
jne 0x2964
movq %rsp, %r14
leaq 0x8910(%rip), %r12      # 0xb1c8
callq 0x3a54
cmpl $-0x1, %eax
je 0x293c
movl %eax, %ebp
movq %rbx, %rdi
callq 0x3c62
movsbl %bpl, %esi
movq %rbx, %rdi
callq 0x3c76
callq 0x3a54
movl %eax, %ebp
cmpl $-0x1, %eax
jne 0x28cc
movq %rbx, %rdi
callq 0x3c6c
movq 0x88e5(%rip), %r15      # 0xb1d8
cmpq %r12, %r15
je 0x293c
movq 0x28(%r15), %rax
cmpl $0x0, 0x4(%rax)
je 0x291f
cmpl $-0x1, 0x8(%rax)
jne 0x291f
movl $0x1, 0x10(%rax)
movl (%rax), %edi
movl $0x13, %esi
callq 0x2250
testl %eax, %eax
jne 0x2931
movq %r15, %rdi
callq 0x20f0
movq %rax, %r15
cmpq %r12, %rax
jne 0x28f8
jmp 0x293c
leaq 0x28(%r15), %rdi
callq 0x235e
jmp 0x291f
movq $0x0, (%rsp)
movq $0x5f5e100, 0x8(%rsp)   # imm = 0x5F5E100
movq %r14, %rdi
xorl %esi, %esi
callq 0x2090
cmpl $0x0, 0x885e(%rip)      # 0xb1bc
je 0x28b8
callq 0x3a44
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/overfl0[P]iojack/iojack.cpp
// Function: tmpDump(processInfo*, user_regs_struct*)
void tmpDump(processInfo *pi, user_regs_struct *regs)
{
    unsigned long arr[2];
    arr[0] = pi->getValue(regs->rip - sizeof(long));
    arr[1] = pi->getValue(regs->rip);

    printf("%lX: ", regs->rip - sizeof(long));
    for(unsigned int i = 1; i <= sizeof(long) * 2; i++)
    {
        printf("\\x%02X", ((unsigned char *)arr)[i-1]);
        if(i % 2 == 0) printf(" ");
    }
    printf("\n");
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x80(%rsi), %rsi
addq $-0x8, %rsi
callq 0x4254
movq %rax, (%rsp)
movq 0x80(%rbx), %rsi
movq %r14, %rdi
callq 0x4254
movq %rax, 0x8(%rsp)
movq 0x80(%rbx), %rsi
addq $-0x8, %rsi
leaq 0x36a1(%rip), %rdi      # 0x6060
xorl %eax, %eax
callq 0x2040
movl $0x1, %r14d
leaq 0x3693(%rip), %rbx      # 0x6066
movzbl -0x1(%rsp,%r14), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2040
testb $0x1, %r14b
jne 0x29f3
movl $0x20, %edi
callq 0x2230
incq %r14
cmpq $0x11, %r14
jne 0x29d3
movl $0xa, %edi
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x2230
// File: /workspace/github_cpp_makefile_star2_O3/overfl0[P]iojack/buffer.cpp
// Function: buffer::lockedGet()
unsigned char buffer::lockedGet()
{
    lock();
    unsigned char retval = get();
    unlock();
return retval;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x50(%rdi), %r14
movq %r14, %rdi
callq 0x2270
movq 0x10(%rbx), %rax
movb (%rax), %bpl
movq %rbx, %rdi
callq 0x4208
movq %r14, %rdi
callq 0x2100
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/overfl0[P]iojack/processes.cpp
// Function: processInfo::getValue(unsigned long)
unsigned long processInfo::getValue(unsigned long addr)
{
    unsigned long retval = ptrace(PTRACE_PEEKDATA, pid, addr, 0);
    if(retval == (unsigned long)-1 && errno != 0)
    {
        perror("ptrace read");
        printf("errno: %d\n", errno);
    }
    //throw "Exception!!!";
    return retval;
}

// Assembly:
pushq %rbx
movq %rsi, %rdx
movl (%rdi), %esi
movl $0x2, %edi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x2140
movq %rax, %rbx
cmpq $-0x1, %rax
jne 0x427b
callq 0x2030
cmpl $0x0, (%rax)
jne 0x4280
movq %rbx, %rax
popq %rbx
retq
movq %rax, %rdi
callq 0x2427
jmp 0x427b
// File: /workspace/github_cpp_makefile_star2_O3/overfl0[P]iojack/processes.cpp
// Function: processInfo::writeLong(unsigned long, unsigned long)
long processInfo::writeLong(unsigned long addr, unsigned long value)
{
    long retval = ptrace(PTRACE_POKEDATA, pid, addr, value);
    if(retval == -1)
    {
        char tmp[100];
        sprintf(tmp, "ptrace write at addr 0x%lx", addr);
        perror(tmp);
    }
    else
        dprintf("Write OK!\n");
    return retval;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x70, %rsp
movq %rdx, %rcx
movq %rsi, %rbx
movl (%rdi), %esi
movl $0x5, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2140
movq %rax, %r14
cmpq $-0x1, %rax
je 0x42c0
movq %r14, %rax
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3698(%rip), %rsi      # 0x795f
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2060
movq %r15, %rdi
callq 0x2130
jmp 0x42b3
nop
// File: /workspace/github_cpp_makefile_star2_O3/overfl0[P]iojack/processes.cpp
// Function: processInfo::readMemcpy(void*, unsigned long, unsigned int)
void processInfo::readMemcpy(void *dest, unsigned long remoteAddr, unsigned int n)
{
    unsigned long *udest = (unsigned long *)dest;
    dprintf("readMemcpy(dest=%lx, remoteAddr=%lx, uint n=%u\n", (unsigned long)dest, remoteAddr, n);
    for(; n >= sizeof(unsigned long); n -= sizeof(unsigned long))
    {
        //dprintf("%u\n", n);
        unsigned long retval = ptrace(PTRACE_PEEKDATA, pid, remoteAddr, 0);
        if(retval == (unsigned long)-1 && errno != 0)
        {
            perror("readMemcpy - ptrace read");
            return;
        }

        *udest++ = retval;
        remoteAddr += sizeof(unsigned long);
    }

    if(n > 0)
    {
        unsigned long retval = ptrace(PTRACE_PEEKDATA, pid, remoteAddr, 0);
        if(retval == (unsigned long)-1 && errno != 0)
        {
            perror("readMemcpy - ptrace read2");
            return;
        }

        char *c = (char *)&retval;
        for(unsigned int i = 0; i < n; i++)
        {
            //dprintf("%d\n", i);
            ((char *)udest)[i] = c[i];
        }
    }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
cmpl $0x8, %ecx
jb 0x436c
movl (%r15), %esi
movl $0x2, %edi
movq %r14, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x2140
movq %rax, %r12
cmpq $-0x1, %rax
jne 0x4359
callq 0x2030
cmpl $0x0, (%rax)
jne 0x43c7
movq %r12, (%rbx)
addq $0x8, %rbx
addq $0x8, %r14
addl $-0x8, %ebp
cmpl $0x7, %ebp
ja 0x4332
testl %ebp, %ebp
je 0x43ac
movl (%r15), %esi
movl $0x2, %edi
movq %r14, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x2140
movq %rax, 0x8(%rsp)
cmpq $-0x1, %rax
jne 0x4399
callq 0x2030
cmpl $0x0, (%rax)
jne 0x43b9
movl %ebp, %eax
xorl %ecx, %ecx
movb 0x8(%rsp,%rcx), %dl
movb %dl, (%rbx,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0x439d
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x35d3(%rip), %rdi      # 0x7993
callq 0x2130
jmp 0x43ac
leaq 0x35ac(%rip), %rdi      # 0x797a
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2130
nop
// File: /workspace/github_cpp_makefile_star2_O3/overfl0[P]iojack/processes.cpp
// Function: processInfo::writeMemcpy(unsigned long, void*, unsigned int)
void processInfo::writeMemcpy(unsigned long remoteAddr, void *src, unsigned int n)
{
    unsigned long *usrc = (unsigned long *)src;
    dprintf("writeMemcpy(remoteAddr=%lx, src=%lx, uint n=%u\n", remoteAddr, (unsigned long)src, n);

    for(; n >= sizeof(unsigned long); n -= sizeof(unsigned long))
    {
        long retval = ptrace(PTRACE_POKEDATA, pid, remoteAddr, *usrc);
        if(retval == -1)
        {
            perror("writeMemcpy - ptrace write 1");
            return;
        }

        usrc++;
        remoteAddr += sizeof(unsigned long);
    }

    if(n > 0)
    {
        // Read the whole ulong into memory
        unsigned long remoteData = ptrace(PTRACE_PEEKDATA, pid, remoteAddr, 0);
        if(remoteData == (unsigned long)-1 && errno != 0)
        {
            perror("writeMemcpy - ptrace read");
            return;
        }

        // Modify only the requested bits
        char *c = (char *)&remoteData;
        for(unsigned int i = 0; i < n; i++)
        {
            //dprintf("%d\n", i);
            c[i] = ((char *)usrc)[i];
        }

        // Write it back
        long retval = ptrace(PTRACE_POKEDATA, pid, remoteAddr, remoteData);
        if(retval == -1)
        {
            perror("writeMemcpy - ptrace write 2");
            return;
        }
    }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
cmpl $0x8, %ecx
jb 0x4422
movl (%r15), %esi
movq (%r14), %rcx
movl $0x5, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2140
cmpq $-0x1, %rax
je 0x4491
addq $0x8, %r14
addq $0x8, %rbx
addl $-0x8, %ebp
cmpl $0x7, %ebp
ja 0x43f7
testl %ebp, %ebp
je 0x447d
movl (%r15), %esi
movl $0x2, %edi
movq %rbx, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x2140
movq %rax, (%rsp)
cmpq $-0x1, %rax
jne 0x444e
callq 0x2030
cmpl $0x0, (%rax)
jne 0x44a7
movl %ebp, %eax
xorl %ecx, %ecx
movb (%r14,%rcx), %dl
movb %dl, (%rsp,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0x4452
movl (%r15), %esi
movq (%rsp), %rcx
movl $0x5, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2140
cmpq $-0x1, %rax
je 0x4488
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3555(%rip), %rdi      # 0x79e4
jmp 0x44ae
leaq 0x3515(%rip), %rdi      # 0x79ad
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2130
leaq 0x351c(%rip), %rdi      # 0x79ca
callq 0x2130
jmp 0x447d
nop
// File: /workspace/github_cpp_makefile_star2_O3/overfl0[P]iojack/processes.cpp
// Function: processInfo::readStrncpy(char*, unsigned long, unsigned int)
char *processInfo::readStrncpy(char *dest, unsigned long remoteAddr, unsigned int n)
{
    unsigned int i = 0;
    while(i < n)
    {
        //printf("Reading at %lx...\n", remoteAddr + i);
        unsigned long retval = ptrace(PTRACE_PEEKDATA, pid, remoteAddr + i, 0);
        if(retval == (unsigned long)-1 && errno != 0)
        {
            perror("readMemcpy - ptrace read");
            goto end; //FIXME: throw an exception or sumtin'
        }

        for(unsigned int j = 0; j < sizeof(unsigned long); j++, i++)
        {
            if(i >= n)
                goto end;

            *dest = ((char *)&retval)[j];
            if(*dest++ == '\0')
                goto end;
        }
    }

    end:
    for(;i < n; i++)
        *dest++ = '\0';

    return dest;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebx
movq %rsi, %r12
testl %ecx, %ecx
je 0x4542
movq %rdx, %rcx
movq %rdi, %r15
xorl %ebp, %ebp
movq %rdx, 0x8(%rsp)
movq %r12, %r13
movl (%r15), %esi
movl %ebp, %edx
addq %rcx, %rdx
movl $0x2, %edi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x2140
movq %rax, 0x10(%rsp)
cmpq $-0x1, %rax
jne 0x450c
callq 0x2030
cmpl $0x0, (%rax)
jne 0x4595
leaq 0x8(%rbp), %r14
xorl %eax, %eax
leal (%rax,%rbp), %ecx
cmpl %ebx, %ecx
jae 0x4547
movb 0x10(%rsp,%rax), %cl
movb %cl, (%r13,%rax)
testb %cl, %cl
je 0x4558
incq %rax
cmpq $0x8, %rax
jne 0x4512
leaq (%rax,%r13), %r12
movq %r14, %rbp
cmpl %ebx, %r14d
movq 0x8(%rsp), %rcx
jb 0x44da
jmp 0x4550
xorl %r14d, %r14d
jmp 0x4564
cmpl %ebx, %ebp
movl %ebx, %r14d
cmoval %ebp, %r14d
addq %rax, %r13
movq %r13, %r12
jmp 0x4564
addl %eax, %ebp
leaq (%rax,%r13), %r12
incq %r12
movl %ebp, %r14d
cmpl %ebx, %r14d
jae 0x4583
notl %r14d
addl %ebx, %r14d
leaq 0x1(%r14), %rdx
movq %r12, %rdi
xorl %esi, %esi
callq 0x20d0
addq %r14, %r12
incq %r12
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x33de(%rip), %rdi      # 0x797a
callq 0x2130
movq %r13, %r12
jmp 0x4561
// File: /workspace/github_cpp_makefile_star2_O3/overfl0[P]iojack/processes.cpp
// Function: processInfo::closeFileDescriptor(unsigned int)
void processInfo::closeFileDescriptor(unsigned int fd)
{
    if(isStdin(fd))
        stdin.erase(fd);

    if(isStdout(fd))
        stdout.erase(fd);

    if(isStderr(fd))
        stderr.erase(fd);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movq 0x100(%rdi), %rax
testq %rax, %rax
je 0x460b
leaq 0xf8(%rbx), %rdx
movq %rdx, %rcx
xorl %esi, %esi
cmpl %ebp, 0x20(%rax)
setl %sil
cmovgeq %rax, %rcx
movq 0x10(%rax,%rsi,8), %rax
testq %rax, %rax
jne 0x45c9
cmpq %rdx, %rcx
je 0x460b
cmpl %ebp, 0x20(%rcx)
jg 0x460b
leaq 0xf0(%rbx), %r14
leaq 0xc(%rsp), %rsi
movl %ebp, (%rsi)
movq %r14, %rdi
callq 0x4a5a
movq %r14, %rdi
movq %rax, %rsi
callq 0x4ad8
movq 0x130(%rbx), %rax
testq %rax, %rax
je 0x4663
leaq 0x128(%rbx), %rdx
movq %rdx, %rcx
xorl %esi, %esi
cmpl %ebp, 0x20(%rax)
setl %sil
cmovgeq %rax, %rcx
movq 0x10(%rax,%rsi,8), %rax
testq %rax, %rax
jne 0x4621
cmpq %rdx, %rcx
je 0x4663
cmpl %ebp, 0x20(%rcx)
jg 0x4663
leaq 0x120(%rbx), %r14
leaq 0x8(%rsp), %rsi
movl %ebp, (%rsi)
movq %r14, %rdi
callq 0x4a5a
movq %r14, %rdi
movq %rax, %rsi
callq 0x4ad8
movq 0x160(%rbx), %rax
testq %rax, %rax
je 0x46bb
leaq 0x158(%rbx), %rdx
movq %rdx, %rcx
xorl %esi, %esi
cmpl %ebp, 0x20(%rax)
setl %sil
cmovgeq %rax, %rcx
movq 0x10(%rax,%rsi,8), %rax
testq %rax, %rax
jne 0x4679
cmpq %rdx, %rcx
je 0x46bb
cmpl %ebp, 0x20(%rcx)
jg 0x46bb
addq $0x150, %rbx            # imm = 0x150
leaq 0x4(%rsp), %rsi
movl %ebp, (%rsi)
movq %rbx, %rdi
callq 0x4a5a
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4ad8
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/overfl0[P]iojack/processes.cpp
// Function: processInfo::duplicateFileDescriptor(unsigned int, unsigned int)
void processInfo::duplicateFileDescriptor(unsigned int oldfd, unsigned int newfd)
{
    //printf("[%d] Duplicating descriptor: %u -> %u\n", pid, oldfd, newfd);
    if(isStdin(oldfd))
        stdin.insert(newfd);

    if(isStdout(oldfd))
        stdout.insert(newfd);

    if(isStderr(oldfd))
        stderr.insert(newfd);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movq 0x100(%rdi), %rax
testq %rax, %rax
je 0x471d
leaq 0xf8(%r14), %rdx
movq %rdx, %rcx
xorl %esi, %esi
cmpl %ebp, 0x20(%rax)
setl %sil
cmovgeq %rax, %rcx
movq 0x10(%rax,%rsi,8), %rax
testq %rax, %rax
jne 0x46e9
cmpq %rdx, %rcx
je 0x471d
cmpl %ebp, 0x20(%rcx)
jg 0x471d
leaq 0xf0(%r14), %rdi
leaq 0xc(%rsp), %rsi
movl %ebx, (%rsi)
callq 0x4b7e
movq 0x130(%r14), %rax
testq %rax, %rax
je 0x4767
leaq 0x128(%r14), %rdx
movq %rdx, %rcx
xorl %esi, %esi
cmpl %ebp, 0x20(%rax)
setl %sil
cmovgeq %rax, %rcx
movq 0x10(%rax,%rsi,8), %rax
testq %rax, %rax
jne 0x4733
cmpq %rdx, %rcx
je 0x4767
cmpl %ebp, 0x20(%rcx)
jg 0x4767
leaq 0x120(%r14), %rdi
leaq 0x8(%rsp), %rsi
movl %ebx, (%rsi)
callq 0x4b7e
movq 0x160(%r14), %rax
testq %rax, %rax
je 0x47b4
leaq 0x158(%r14), %rdx
movq %rdx, %rcx
xorl %esi, %esi
cmpl %ebp, 0x20(%rax)
setl %sil
cmovgeq %rax, %rcx
movq 0x10(%rax,%rsi,8), %rax
testq %rax, %rax
jne 0x477d
cmpq %rdx, %rcx
je 0x47b4
cmpl %ebp, 0x20(%rcx)
jg 0x47b4
addq $0x150, %r14            # imm = 0x150
leaq 0x4(%rsp), %rsi
movl %ebx, (%rsi)
movq %r14, %rdi
callq 0x4b7e
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/overfl0[P]iojack/processes.cpp
// Function: processInfo::detachProcess()
void processInfo::detachProcess()
{
    printf("Detaching %d... ", pid);
    int retval = ptrace(PTRACE_DETACH, pid, NULL, NULL);
    if(retval == -1)
    {
        printf("Failed! ");
        printPtraceError(errno);
        perror("Detach failed");
    }
    else
    {
        printf("OK!\n");
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %esi
leaq 0x3236(%rip), %rdi      # 0x7a01
xorl %eax, %eax
callq 0x2040
movl (%rbx), %esi
movl $0x11, %edi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x2140
cmpl $-0x1, %eax
je 0x47f6
leaq 0x32ce(%rip), %rdi      # 0x7abe
popq %rbx
jmp 0x22b0
callq 0x2448
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/overfl0[P]iojack/syscalls.cpp
// Function: setPreHook(int, void (*)(processInfo*, user_regs_struct&, int&, int&))
inline void setHook(vector<hookPtr> &v, int syscall, hookPtr ptr)
{
    if(syscall < 0)
        return; // Fail silently. Who told you to hook negative syscalls?

    if(v.size() <= (unsigned int)syscall)
    {
        v.resize(syscall + 1, NULL);
    }
    v[syscall] = ptr;
}

// Assembly:
testl %edi, %edi
js 0x4d8c
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %esi
movq 0x64ec(%rip), %rcx      # 0xb238
movq 0x64dd(%rip), %rax      # 0xb230
subq %rax, %rcx
sarq $0x3, %rcx
movl %edi, %r14d
cmpq %r14, %rcx
ja 0x4d81
incl %esi
movq %rsp, %rdx
movq $0x0, (%rdx)
leaq 0x64bb(%rip), %rdi      # 0xb230
callq 0x583e
movq 0x64af(%rip), %rax      # 0xb230
movq %rbx, (%rax,%r14,8)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/overfl0[P]iojack/syscalls.cpp
// Function: getPreHook(int)
inline hookPtr getHook(vector<hookPtr> &v, int syscall)
{
    if(syscall < 0 || v.size() <= (unsigned int)syscall)
        return NULL;
    return v[syscall];
    /* This version, while pretty, REALLY sucks performance-wise!
    try
    {
        return v.at(syscall);
    } catch(std::out_of_range e)
    {
        return NULL;
    }*/
}

// Assembly:
testl %edi, %edi
js 0x4e5c
movq 0x63f6(%rip), %rdx      # 0xb238
movq 0x63e7(%rip), %rax      # 0xb230
subq %rax, %rdx
sarq $0x3, %rdx
movl %edi, %ecx
cmpq %rcx, %rdx
jbe 0x4e5c
movq (%rax,%rcx,8), %rax
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/overfl0[P]iojack/syscalls.cpp
// Function: fakedReadHook(processInfo*, user_regs_struct&, int&, int&)
void fakedReadHook(processInfo *pi, user_regs_struct &regs, int &saveRegs, int &unused)
{
    //ssize_t read(int fd, void *buf, size_t count);
    //eax read(ebx fd, ecx *buf, edx count);
    unsigned int len = inputBuffer.lockedSize();
    if(regs.ARG3 < len)
        len = regs.ARG3;

    inputBuffer.lock();
    for(unsigned int i = 0; i < len; i++)
    {
        char c = inputBuffer.get();
        pi->writeChar(regs.ARG2 + i, c);
    }
    inputBuffer.unlock();
    regs.RAX = len;

    saveRegs = 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x6349(%rip), %r12      # 0xb278
movq %r12, %rdi
callq 0x3d5c
movq 0x60(%r14), %r13
movl %eax, %ecx
cmpq %rcx, %r13
cmovael %eax, %r13d
movq %r12, %rdi
callq 0x3c62
testl %r13d, %r13d
je 0x4f81
movl %r13d, %r13d
xorl %ebp, %ebp
leaq 0x631b(%rip), %r12      # 0xb278
movq %r12, %rdi
callq 0x3da4
movq 0x68(%r14), %rsi
addq %rbp, %rsi
movzbl %al, %edx
movq %r15, %rdi
callq 0x42e2
incq %rbp
cmpq %rbp, %r13
jne 0x4f5d
jmp 0x4f84
xorl %r13d, %r13d
leaq 0x62ed(%rip), %rdi      # 0xb278
callq 0x3c6c
movq %r13, 0x50(%r14)
movl $0x1, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/overfl0[P]iojack/syscalls.cpp
// Function: preWriteHook(processInfo*, user_regs_struct&, int&, int&)
void preWriteHook(processInfo *pi, user_regs_struct &regs, int &saveRegs, int &fakeSyscall)
{
    // ssize_t write(int fd, const void *buf, size_t count);
    //ssize_t retval = write(regs.ARG1, regs.ARG2, regs.ARG3);
    //write(stdout, regs.ARG2, regs.ARG3);
    dprintf("Got a write syscall!\n");
    dprintf("fd = %d\n", (int)regs.ARG1);
    if(pi->isStdout(regs.ARG1) || pi->isStderr(regs.ARG1))
    {
        for(unsigned int i = 0; i < regs.ARG3; i++)
        {
            unsigned long c = pi->getValue(regs.ARG2 + i);
            dprintf("Wrote letter: ");
            printf("%c", (int)c);
            //printf("0x%02x (%c)\n", (unsigned char)c, (unsigned char)c);
            dprintf("\n");
        }
        fflush(stdout);
    }

    //return retval;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl 0x70(%rsi), %eax
movq 0x130(%rdi), %rcx
testq %rcx, %rcx
je 0x4fed
leaq 0x128(%r14), %rsi
movq %rsi, %rdx
xorl %edi, %edi
cmpl %eax, 0x20(%rcx)
setl %dil
cmovgeq %rcx, %rdx
movq 0x10(%rcx,%rdi,8), %rcx
testq %rcx, %rcx
jne 0x4fcc
cmpq %rsi, %rdx
je 0x4fed
cmpl %eax, 0x20(%rdx)
jle 0x5029
movq 0x160(%r14), %rcx
testq %rcx, %rcx
je 0x5024
leaq 0x158(%r14), %rsi
movq %rsi, %rdx
xorl %edi, %edi
cmpl %eax, 0x20(%rcx)
setl %dil
cmovgeq %rcx, %rdx
movq 0x10(%rcx,%rdi,8), %rcx
testq %rcx, %rcx
jne 0x5003
cmpq %rsi, %rdx
je 0x5024
cmpl %eax, 0x20(%rdx)
jle 0x5029
popq %rbx
popq %r14
popq %rbp
retq
cmpq $0x0, 0x60(%rbx)
je 0x5054
movl $0x1, %ebp
xorl %esi, %esi
addq 0x68(%rbx), %rsi
movq %r14, %rdi
callq 0x4254
movl %eax, %edi
callq 0x2230
movl %ebp, %esi
incl %ebp
cmpq %rsi, 0x60(%rbx)
ja 0x5037
movq 0x5f6d(%rip), %rax      # 0xafc8
movq (%rax), %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x21d0
// File: /workspace/github_cpp_makefile_star2_O3/overfl0[P]iojack/syscalls.cpp
// Function: preSelectHook(processInfo*, user_regs_struct&, int&, int&)
void preSelectHook(processInfo *pi, user_regs_struct &regs, int &saveRegs, int &fakeSyscall)
{
    //int maxDwords = sizeof(fd_set) / sizeof(__fd_mask);
    //printf("MaxDwords: %d\n", maxDwords);
    fd_set inSet;
    if(regs.ARG2 && inputBuffer.lockedSize() && pi->stdin.size())
    {
        pi->readMemcpy(&inSet, regs.ARG2, sizeof(fd_set));
        foreach(pi->stdin, it)
            if(FD_ISSET(*it, &inSet))
            {
                fakeSyscall = 1;
                return;
            }
    }
}

// Assembly:
cmpq $0x0, 0x68(%rsi)
je 0x50ff
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rcx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x61ea(%rip), %rdi      # 0xb278
callq 0x3d5c
testl %eax, %eax
je 0x50f3
cmpq $0x0, 0x118(%r14)
je 0x50f3
movq 0x68(%r15), %rdx
movq %rsp, %rsi
movq %r14, %rdi
movl $0x80, %ecx
callq 0x4316
movq 0x108(%r14), %rax
addq $0xf8, %r14
cmpq %r14, %rax
je 0x50f3
movl 0x20(%rax), %ecx
leal 0x3f(%rcx), %edx
testl %ecx, %ecx
cmovnsl %ecx, %edx
sarl $0x6, %edx
movslq %edx, %rdx
movq (%rsp,%rdx,8), %rdx
btq %rcx, %rdx
jb 0x50ed
movq %rax, %rdi
callq 0x21c0
jmp 0x50c3
movl $0x1, (%rbx)
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/overfl0[P]iojack/syscalls.cpp
// Function: prePollHook(processInfo*, user_regs_struct&, int&, int&)
void prePollHook(processInfo *pi, user_regs_struct &regs, int &saveRegs, int &fakeSyscall)
{
    // int poll(struct pollfd *fds, nfds_t nfds, int timeout);
    if(regs.ARG2 && inputBuffer.lockedSize() && pi->stdin.size())
    {
        pollfd fds[regs.ARG2];
        pi->readMemcpy(&fds, regs.ARG1, regs.ARG2 * sizeof(pollfd));

        for(unsigned int i = 0; i < regs.ARG2; i++)
        {
            if(pi->isStdin(fds[i].fd) && (fds[i].events & POLLIN))
            {
                fakeSyscall = 1;
                return;
            }
        }
    }
}

// Assembly:
cmpq $0x0, 0x68(%rsi)
je 0x53bb
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rsi, %r12
movq %rdi, %r14
leaq 0x5f79(%rip), %rdi      # 0xb278
callq 0x3d5c
testl %eax, %eax
je 0x53ad
cmpq $0x0, 0x118(%r14)
je 0x53ad
movq %rsp, %r13
movq 0x68(%r12), %rax
movq %rsp, %r15
leaq 0xf(,%rax,8), %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
movq 0x70(%r12), %rdx
movl 0x68(%r12), %ecx
shll $0x3, %ecx
movq %r14, %rdi
movq %r15, %rsi
callq 0x4316
movq 0x68(%r12), %rax
testq %rax, %rax
je 0x53aa
movq 0x100(%r14), %rcx
addq $0xf8, %r14
xorl %edx, %edx
testq %rcx, %rcx
je 0x53a3
movl (%r15,%rdx,8), %esi
movq %rcx, %r8
movq %r14, %rdi
xorl %r9d, %r9d
cmpl %esi, 0x20(%r8)
setl %r9b
cmovgeq %r8, %rdi
movq 0x10(%r8,%r9,8), %r8
testq %r8, %r8
jne 0x5378
cmpq %r14, %rdi
je 0x53a3
cmpl %esi, 0x20(%rdi)
jg 0x53a3
testb $0x1, 0x4(%r15,%rdx,8)
jne 0x53bc
incl %edx
cmpq %rdx, %rax
ja 0x5369
movq %r13, %rsp
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, (%rbx)
jmp 0x53aa
// File: /workspace/github_cpp_makefile_star2_O3/overfl0[P]iojack/syscalls.cpp
// Function: fakePollHook(processInfo*, user_regs_struct&, int&, int&)
void fakePollHook(processInfo *pi, user_regs_struct &regs, int &saveRegs, int &unused)
{
    regs.RAX = 0;

    if(regs.ARG2 && inputBuffer.lockedSize())
    {
        pollfd fds[regs.ARG2];
        pi->readMemcpy(&fds, regs.ARG1, regs.ARG2 * sizeof(pollfd));

        for(unsigned int i = 0; i < regs.ARG2; i++)
        {
            fds[i].revents = 0;

            if(pi->isStdin(fds[i].fd) && (fds[i].events & POLLIN))
            {
                fds[i].revents = POLLIN;
                regs.RAX += 1;
                // Maybe force all other revents to 0 now that we've found one valid stdin fd?
            }
        }

        pi->writeMemcpy(regs.ARG1, &fds, regs.ARG2 * sizeof(pollfd));
    }

    saveRegs = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq $0x0, 0x50(%rsi)
cmpq $0x0, 0x68(%rsi)
je 0x54bf
movq %rsi, %r15
movq %rdi, %r14
leaq 0x5e83(%rip), %rdi      # 0xb278
callq 0x3d5c
testl %eax, %eax
je 0x54bf
movq %rsp, %r13
movq 0x68(%r15), %rax
movq %rsp, %r12
leaq 0xf(,%rax,8), %rax
andq $-0x10, %rax
subq %rax, %r12
movq %r12, %rsp
movq 0x70(%r15), %rdx
movl 0x68(%r15), %ecx
shll $0x3, %ecx
movq %r14, %rdi
movq %r12, %rsi
callq 0x4316
movq 0x68(%r15), %rcx
testq %rcx, %rcx
je 0x54aa
movq 0x50(%r15), %rax
movq 0x100(%r14), %rdx
leaq 0xf8(%r14), %rsi
xorl %edi, %edi
movw $0x0, 0x6(%r12,%rdi,8)
testq %rdx, %rdx
je 0x54a3
movl (%r12,%rdi,8), %r8d
movq %rdx, %r10
movq %rsi, %r9
xorl %r11d, %r11d
cmpl %r8d, 0x20(%r10)
setl %r11b
cmovgeq %r10, %r9
movq 0x10(%r10,%r11,8), %r10
testq %r10, %r10
jne 0x5468
cmpq %rsi, %r9
je 0x54a3
cmpl %r8d, 0x20(%r9)
jg 0x54a3
testb $0x1, 0x4(%r12,%rdi,8)
je 0x54a3
movw $0x1, 0x6(%r12,%rdi,8)
incq %rax
movq %rax, 0x50(%r15)
incl %edi
cmpq %rdi, %rcx
ja 0x5451
movq 0x70(%r15), %rsi
shll $0x3, %ecx
movq %r14, %rdi
movq %r12, %rdx
callq 0x43e0
movq %r13, %rsp
movl $0x1, (%rbx)
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/overfl0[P]iojack/syscalls.cpp
// Function: postDup2Hook(processInfo*, user_regs_struct&, int&, int&)
void postDup2Hook(processInfo *pi, user_regs_struct &regs, int &saveRegs, int &unused)
{
    //printf("[%d] Got dup2(%lu, %lu) syscall! (returned: %d)\n", pi->pid, pi->orig_regs.ARG1, pi->orig_regs.ARG2, (int)regs.RAX);
    if((int)regs.RAX == -1)
        return;

    if(pi->orig_regs.ARG1 == pi->orig_regs.ARG2)
        return; // Do nothing as per the man page

    pi->closeFileDescriptor(pi->orig_regs.ARG2);

    //TODO: check the man for FD_CLOEXEC
    pi->duplicateFileDescriptor(pi->orig_regs.ARG1, pi->orig_regs.ARG2);
}

// Assembly:
pushq %rbx
cmpl $-0x1, 0x50(%rsi)
je 0x5514
movq %rdi, %rbx
movq 0x80(%rdi), %rsi
cmpq %rsi, 0x88(%rdi)
jne 0x5516
popq %rbx
retq
movq %rbx, %rdi
callq 0x45a6
movl 0x80(%rbx), %edx
movl 0x88(%rbx), %esi
movq %rbx, %rdi
popq %rbx
jmp 0x46c4