// File: mindbeast[P]rnes/main.cpp
// Function: Rnes::md5OfFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::string md5OfFile(std::string file) {
  std::string salt = "$1$$";
  struct crypt_data data = {0};
  std::string contents;

  using namespace std;
  namespace io = boost::iostreams;

  io::stream<io::mapped_file_source> stream(file);
  stream >> contents;

  auto ret = std::string(crypt_r(contents.c_str(), salt.c_str(), &data));
  for_each(begin(ret), end(ret), [](char &c) {
    if (c == '/' or c == '.') {
      c = 'x';
    }
  });
  return ret.substr(salt.size());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x82a0, %rsp           # imm = 0x82A0
movq %rsi, -0x8268(%rbp)
movq %rdi, -0x8260(%rbp)
movq %rdi, %rax
movq %rax, -0x8258(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x8250(%rbp)
callq 0xea50
movq -0x8250(%rbp), %rdx
leaq 0x4ff10(%rip), %rsi     # 0x68049
leaq -0x30(%rbp), %rdi
callq 0x19b90
jmp 0x18144
leaq -0x31(%rbp), %rdi
callq 0xed50
leaq -0x8044(%rbp), %rdi
xorl %esi, %esi
movl %esi, -0x826c(%rbp)
movl $0x8000, %edx           # imm = 0x8000
callq 0xe420
leaq -0x8068(%rbp), %rdi
callq 0xe490
movl -0x826c(%rbp), %eax
movq -0x8268(%rbp), %rsi
movl %eax, %edx
leaq -0x8208(%rbp), %rdi
callq 0x19c40
jmp 0x1818f
leaq -0x8208(%rbp), %rdi
leaq -0x8068(%rbp), %rsi
callq 0xe560
jmp 0x181a4
leaq -0x8068(%rbp), %rdi
callq 0xe140
movq %rax, -0x8288(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xe140
movq -0x8288(%rbp), %rdi
movq %rax, %rsi
leaq -0x8044(%rbp), %rdx
callq 0xed30
movq %rax, -0x8280(%rbp)
leaq -0x8229(%rbp), %rdi
movq %rdi, -0x8278(%rbp)
callq 0xea50
movq -0x8280(%rbp), %rsi
movq -0x8278(%rbp), %rdx
leaq -0x8228(%rbp), %rdi
callq 0x19b90
jmp 0x1820c
leaq -0x8229(%rbp), %rdi
callq 0xed50
leaq -0x8228(%rbp), %rdi
callq 0x19d40
movq %rax, -0x8290(%rbp)
jmp 0x1822d
movq -0x8290(%rbp), %rax
movq %rax, -0x8238(%rbp)
leaq -0x8228(%rbp), %rdi
callq 0x19d70
movq %rax, -0x8298(%rbp)
jmp 0x18250
movq -0x8298(%rbp), %rax
movq %rax, -0x8240(%rbp)
movq -0x8238(%rbp), %rdi
movq -0x8240(%rbp), %rsi
callq 0x18370
jmp 0x18273
leaq -0x30(%rbp), %rdi
callq 0xe3a0
movq -0x8260(%rbp), %rdi
movq %rax, %rdx
leaq -0x8228(%rbp), %rsi
movq $-0x1, %rcx
callq 0xeaa0
jmp 0x1829b
leaq -0x8228(%rbp), %rdi
callq 0xed78
leaq -0x8208(%rbp), %rdi
callq 0x19da0
leaq -0x8068(%rbp), %rdi
callq 0xed78
leaq -0x30(%rbp), %rdi
callq 0xed78
movq -0x8258(%rbp), %rax
addq $0x82a0, %rsp           # imm = 0x82A0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0xed50
jmp 0x1835e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x18349
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1833d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x8229(%rbp), %rdi
callq 0xed50
jmp 0x1833d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x8228(%rbp), %rdi
callq 0xed78
leaq -0x8208(%rbp), %rdi
callq 0x19da0
leaq -0x8068(%rbp), %rdi
callq 0xed78
leaq -0x30(%rbp), %rdi
callq 0xed78
movq -0x40(%rbp), %rdi
callq 0xe700
nopw (%rax,%rax)