LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/badblockfile.cpp
// Function: BadBlockFile::read(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<unsigned long, std::allocator<unsigned long>>&)
int
BadBlockFile::read(const std::string     &filepath_,
                   std::vector<uint64_t> &blocks_)
{
  if(filepath_ == "-")
    {
      l::read(std::cin,blocks_);
    }
  else
    {
      std::ifstream file;

      file.open(filepath_.c_str());
      if(!file.is_open() || file.bad())
        return -1;

      l::read(file,blocks_);

      file.close();
    }

  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x1130a(%rip), %rsi     # 0x1601b
callq 0x4120
testl %eax, %eax
je 0x4d8c
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x44f0
movq (%r14), %rsi
movq %r15, %rdi
movl $0x8, %edx
callq 0x42c0
leaq 0x80(%rsp), %rdi
callq 0x40d0
testb %al, %al
je 0x4d7b
movq 0x8(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x1, 0x28(%rsp,%rax)
jne 0x4d7b
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x4dbf
leaq 0x8(%rsp), %rdi
callq 0x40c0
leaq 0x8(%rsp), %rdi
callq 0x40e0
jmp 0x4d9b
leaq 0x8(%rsp), %rdi
callq 0x40e0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4d9d
movq 0x1f245(%rip), %rdi     # 0x23fd8
movq %rbx, %rsi
callq 0x4dbf
xorl %eax, %eax
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x40e0
movq %rbx, %rdi
callq 0x46f0
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/badblockfile.cpp
// Function: BadBlockFile::write(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<unsigned long, std::allocator<unsigned long>> const&)
int
BadBlockFile::write(const std::string           &filepath_,
                    const std::vector<uint64_t> &blocks_)
{
  if(filepath_ == "-")
    {
      l::write(std::cout,blocks_);
    }
  else
    {
      std::ofstream file;

      file.open(filepath_.c_str());
      if(!file.is_open() || file.bad())
        return -1;

      l::write(file,blocks_);

      file.close();
    }

  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x111c7(%rip), %rsi     # 0x1601b
callq 0x4120
testl %eax, %eax
je 0x4eee
movq %rsp, %r15
movq %r15, %rdi
callq 0x46d0
movq (%r14), %rsi
movq %r15, %rdi
movl $0x10, %edx
callq 0x4080
leaq 0x70(%rsp), %rdi
callq 0x40d0
testb %al, %al
je 0x4eb0
movq (%rsp), %rax
movq -0x18(%rax), %rax
testb $0x1, 0x20(%rsp,%rax)
jne 0x4eb0
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x4f1f
movb $0x1, %bl
movq %rsp, %rdi
callq 0x45c0
jmp 0x4eb2
xorl %ebx, %ebx
movq 0x1f0f7(%rip), %rax     # 0x23fb0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x8(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, (%rsp,%rcx)
callq 0x43e0
leaq 0xf8(%rsp), %rdi
callq 0x4190
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb %bl, %bl
jne 0x4efd
jmp 0x4eff
movq 0x1f0c3(%rip), %rdi     # 0x23fb8
movq %rbx, %rsi
callq 0x4f1f
xorl %eax, %eax
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x45f0
movq %rbx, %rdi
callq 0x46f0
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/bbf_captcha.cpp
// Function: bbf::captcha(Options const&)
AppError
  captcha(const Options &opts_)
  {
    int rv;
    BlkDev blkdev;

    rv = blkdev.open_read(opts_.device);
    if(rv == -ENOTBLK)
      rv = l::open_file_dev(blkdev,opts_.device);

    if(rv < 0)
      return AppError::opening_device(-rv,opts_.device);

    std::cout << captcha::calculate(blkdev) << std::endl;

    rv = blkdev.close();
    if(rv < 0)
      return AppError::closing_device(-rv,opts_.device);

    return AppError::success();
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xe0, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x48(%rsp), %r15
movq %r15, %rdi
callq 0xccb4
addq $0x8, %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0xcd02
movl %eax, %ebp
cmpl $-0xf, %eax
jne 0x69e0
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0xe914
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %r15
movq %r15, %rsi
callq 0x4540
movq (%r15), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x69a9
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x44b0
cmpq $0x0, 0x10(%rsp)
je 0x69c4
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xcd02
movl %eax, %ebp
jmp 0x69c9
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x69e0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x44b0
testl %ebp, %ebp
js 0x6a6a
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0xd8ec
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x1d5b0(%rip), %rdi     # 0x23fb8
callq 0x4500
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4480
movsbl %al, %esi
movq %r15, %rdi
callq 0x4050
movq %rax, %rdi
callq 0x4310
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6a52
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x44b0
leaq 0x48(%rsp), %rdi
callq 0xce64
testl %eax, %eax
js 0x6a7b
movq %rbx, %rdi
callq 0xdd7c
jmp 0x6a8a
negl %ebp
movq %rbx, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0xdfc6
jmp 0x6a8a
negl %eax
movq %rbx, %rdi
movl %eax, %esi
movq %r14, %rdx
callq 0xe060
leaq 0x48(%rsp), %rdi
callq 0xcce6
movq %rbx, %rax
addq $0xe0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6aa9
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
jne 0x6acb
jmp 0x6add
jmp 0x6ada
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6add
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x44b0
jmp 0x6add
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0xcce6
movq %rbx, %rdi
callq 0x46f0
nop
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/bbf_dump_files.cpp
// Function: operator<<(std::ostream&, std::_Rb_tree_const_iterator<std::pair<unsigned long const, std::pair<unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>> const&)
std::ostream&
operator<<(std::ostream                                      &os_,
           const BlockToFileMapper::BlockMap::const_iterator &i_)
{
  os_ << i_->first << " - "
      << (i_->first + i_->second.first - 1)
      << " "
      << i_->second.second;
  return os_;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rax
movq 0x20(%rax), %rsi
callq 0x4300
movq %rax, %r15
leaq 0xfe38(%rip), %rsi      # 0x16949
movl $0x3, %edx
movq %rax, %rdi
callq 0x4500
movq (%r14), %rax
movq 0x20(%rax), %rcx
movq 0x28(%rax), %rax
leaq (%rcx,%rax), %rsi
decq %rsi
movq %r15, %rdi
callq 0x4300
movq %rax, %r15
leaq 0xf7aa(%rip), %rsi      # 0x162ec
movl $0x1, %edx
movq %rax, %rdi
callq 0x4500
movq (%r14), %rax
movq 0x30(%rax), %rsi
movq 0x38(%rax), %rdx
movq %r15, %rdi
callq 0x4500
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/bbf_dump_files.cpp
// Function: operator<<(std::ostream&, std::map<unsigned long, std::pair<unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, std::pair<unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>> const&)
std::ostream&
operator<<(std::ostream                      &os_,
           const BlockToFileMapper::BlockMap &bm_)
{
  for(BlockToFileMapper::BlockMap::const_iterator
        i = bm_.begin(), ei = bm_.end();
      i != ei;
      ++i)
    {
      os_ << i << std::endl;
    }

  return os_;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rsi), %r15
movq %r15, (%rsp)
addq $0x8, %r14
cmpq %r14, %r15
je 0x6bd3
movq %rsp, %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6af0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4480
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4050
movq %rax, %rdi
callq 0x4310
movq %r15, %rdi
callq 0x4510
movq %rax, %r15
movq %rax, (%rsp)
cmpq %r14, %rax
jne 0x6b8d
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/bbf_dump_files.cpp
// Function: bbf::dump_files(Options const&)
AppError
  dump_files(const Options &opts_)
  {
    int rv;
    BlockToFileMapper b2fm;

    rv = b2fm.scan(opts_.device);
    if(rv < 0)
      return AppError::opening_device(-rv,opts_.device);

    std::cout << b2fm.blockmap();

    return AppError::success();
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsp, %r15
movq %r15, %rdi
callq 0xd164
addq $0x8, %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0xd182
testl %eax, %eax
js 0x6c30
movq %rsp, %rdi
callq 0xd71c
movq 0x1d39a(%rip), %rdi     # 0x23fb8
movq %rax, %rsi
callq 0x6b6b
movq %rbx, %rdi
callq 0xdd7c
jmp 0x6c3f
negl %eax
movq %rbx, %rdi
movl %eax, %esi
movq %r14, %rdx
callq 0xdfc6
movq %rsp, %rdi
callq 0x6c68
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x6c68
movq %rbx, %rdi
callq 0x46f0
nop
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/bbf_file_blocks.cpp
// Function: bbf::file_blocks(Options const&)
AppError
  file_blocks(const Options &opts_)
  {
    int rv;
    File::BlockVector blockvector;

    rv = File::blocks(opts_.device,blockvector);
    if(rv < 0)
      return AppError::opening_file(-rv,opts_.device);

    for(uint64_t i = 0, ei = blockvector.size(); i != ei; i++)
      {
        uint64_t        j = blockvector[i].block;
        const uint64_t ej = blockvector[i].length + j;

        for(; j != ej; j++)
          {
            std::cout << j << std::endl;
          }
      }

    return AppError::success();
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
addq $0x8, %r14
movq %r14, %rdi
callq 0xe6f1
testl %eax, %eax
js 0x6db2
movq %rbx, 0x20(%rsp)
movq 0x8(%rsp), %r13
movq (%rsp), %rax
subq %rax, %r13
je 0x6da3
sarq $0x4, %r13
xorl %ebp, %ebp
movq 0x1d273(%rip), %r14     # 0x23fb8
movq (%rsp), %rax
movq %rbp, %rcx
shlq $0x4, %rcx
movq 0x8(%rax,%rcx), %rbx
testq %rbx, %rbx
je 0x6d9b
movq (%rax,%rcx), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x4300
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4480
movsbl %al, %esi
movq %r12, %rdi
callq 0x4050
movq %rax, %rdi
callq 0x4310
incq %r15
decq %rbx
jne 0x6d5e
incq %rbp
cmpq %r13, %rbp
jne 0x6d45
movq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0xdd7c
jmp 0x6dc1
negl %eax
movq %rbx, %rdi
movl %eax, %esi
movq %r14, %rdx
callq 0xe2c8
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x6dd7
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x44b0
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6deb
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x6e04
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x44b0
movq %rbx, %rdi
callq 0x46f0
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/bbf_fsthrash.cpp
// Function: bbf::fsthrash(Options const&)
AppError
  fsthrash(const Options &opts_)
  {
    int rv;
    struct stat st;

    rv = stat(opts_.device.c_str(),&st);
    if(rv == -1)
      return AppError::opening_file(errno,opts_.device);
    if(!S_ISDIR(st.st_mode))
      return AppError::not_a_directory(opts_.device);

    return l::fsthrash(opts_);
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x90, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x8(%rsi), %r14
movq 0x8(%rsi), %rdi
movq %rsp, %rsi
callq 0x4430
cmpl $-0x1, %eax
je 0x9acf
movl $0xf000, %eax           # imm = 0xF000
andl 0x18(%rsp), %eax
movq %rbx, %rdi
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x9ae3
movq %r15, %rsi
callq 0x8558
jmp 0x9aeb
callq 0x4060
movl (%rax), %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0xe2c8
jmp 0x9aeb
movq %r14, %rsi
callq 0xdf2c
movq %rbx, %rax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/bbf_fsthrash.cpp
// Function: FSThrashState::rnd_file[abi:cxx11]()
std::string
  rnd_file(void)
  {
    std::string rv;

    pthread_mutex_lock(&mutex_file);
    if(!files.empty())
      rv = rnd::element(files);
    pthread_mutex_unlock(&mutex_file);

    return rv;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x10(%rdi), %r12
movq %r12, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
leaq 0x98(%rsi), %r14
movq %r14, %rdi
callq 0x45e0
movq 0x28(%r15), %rax
cmpq 0x30(%r15), %rax
je 0xa1ba
callq 0x4100
cltq
movq 0x28(%r15), %rsi
movq 0x30(%r15), %rcx
subq %rsi, %rcx
sarq $0x5, %rcx
xorl %edx, %edx
divq %rcx
shlq $0x5, %rdx
addq %rdx, %rsi
movq %rbx, %rdi
callq 0x4250
movq %r14, %rdi
callq 0x4390
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r12, %rdi
je 0xa1e8
movq (%r12), %rsi
incq %rsi
callq 0x44b0
movq %r14, %rdi
callq 0x46f0
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/bbf_fsthrash.cpp
// Function: FSThrashState::rnd_fd()
int
  rnd_fd(void)
  {
    int rv = -1;

    pthread_mutex_lock(&mutex_fd);
    if(!fds.empty())
      rv = rnd::element(fds);
    pthread_mutex_unlock(&mutex_fd);

    return rv;
  }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0xc0(%rdi), %rbx
movq %rbx, %rdi
callq 0x45e0
movq 0x58(%r14), %rax
cmpq 0x60(%r14), %rax
je 0xa25c
callq 0x4100
cltq
movq 0x58(%r14), %rcx
movq 0x60(%r14), %rsi
subq %rcx, %rsi
sarq $0x2, %rsi
xorl %edx, %edx
divq %rsi
movl (%rcx,%rdx,4), %ebp
jmp 0xa261
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %rbx, %rdi
callq 0x4390
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/bbf_fsthrash.cpp
// Function: FSThrashState::rm_rnd_file[abi:cxx11]()
std::string
  rm_rnd_file(void)
  {
    size_t r;
    std::string rv;

    pthread_mutex_lock(&mutex_file);
    if(!files.empty())
      {
        r = (std::rand() % files.size());
        rv = files[r];
        std::swap(files[r],files[files.size()-1]);
        files.pop_back();
      }
    pthread_mutex_unlock(&mutex_file);

    return rv;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x10(%rdi), %r13
movq %r13, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
leaq 0x98(%rsi), %r14
movq %r14, %rdi
callq 0x45e0
movq 0x28(%r15), %rax
cmpq 0x30(%r15), %rax
je 0xa422
callq 0x4100
cltq
movq 0x28(%r15), %rsi
movq 0x30(%r15), %rcx
subq %rsi, %rcx
sarq $0x5, %rcx
xorl %edx, %edx
divq %rcx
movq %rdx, %r12
shlq $0x5, %r12
addq %r12, %rsi
movq %rbx, %rdi
callq 0x4250
addq 0x28(%r15), %r12
movq 0x30(%r15), %rsi
addq $-0x20, %rsi
movq %r12, %rdi
callq 0x4350
movq 0x30(%r15), %rax
leaq -0x20(%rax), %rcx
movq %rcx, 0x30(%r15)
movq -0x20(%rax), %rdi
addq $-0x10, %rax
cmpq %rax, %rdi
je 0xa422
movq (%rax), %rsi
incq %rsi
callq 0x44b0
movq %r14, %rdi
callq 0x4390
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r13, %rdi
je 0xa44e
movq (%r13), %rsi
incq %rsi
callq 0x44b0
movq %r14, %rdi
callq 0x46f0
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/bbf_fsthrash.cpp
// Function: FSThrashState::rm_rnd_dir[abi:cxx11]()
std::string
  rm_rnd_dir(void)
  {
    size_t r;
    std::string rv;

    pthread_mutex_lock(&mutex_dir);
    if(!dirs.empty())
      {
        r = (std::rand() % dirs.size());
        rv = dirs[r];
        std::swap(dirs[r],dirs[dirs.size()-1]);
        dirs.pop_back();
      }
    pthread_mutex_unlock(&mutex_dir);

    return rv;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x10(%rdi), %r13
movq %r13, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
leaq 0x70(%rsi), %r14
movq %r14, %rdi
callq 0x45e0
movq 0x40(%r15), %rax
cmpq 0x48(%r15), %rax
je 0xa4f3
callq 0x4100
cltq
movq 0x40(%r15), %rsi
movq 0x48(%r15), %rcx
subq %rsi, %rcx
sarq $0x5, %rcx
xorl %edx, %edx
divq %rcx
movq %rdx, %r12
shlq $0x5, %r12
addq %r12, %rsi
movq %rbx, %rdi
callq 0x4250
addq 0x40(%r15), %r12
movq 0x48(%r15), %rsi
addq $-0x20, %rsi
movq %r12, %rdi
callq 0x4350
movq 0x48(%r15), %rax
leaq -0x20(%rax), %rcx
movq %rcx, 0x48(%r15)
movq -0x20(%rax), %rdi
addq $-0x10, %rax
cmpq %rax, %rdi
je 0xa4f3
movq (%rax), %rsi
incq %rsi
callq 0x44b0
movq %r14, %rdi
callq 0x4390
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r13, %rdi
je 0xa51f
movq (%r13), %rsi
incq %rsi
callq 0x44b0
movq %r14, %rdi
callq 0x46f0
nop
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/bbf_fsthrash.cpp
// Function: FSThrashState::rm_rnd_fd()
int
  rm_rnd_fd(void)
  {
    int rv;
    size_t r;

    rv = -1;
    pthread_mutex_lock(&mutex_fd);
    if(!fds.empty())
      {
        r = (std::rand() % fds.size());
        rv = fds[r];
        std::swap(fds[r],fds[fds.size()-1]);
        fds.pop_back();
      }
    pthread_mutex_unlock(&mutex_fd);

    return rv;
  }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0xc0(%rdi), %rbx
movq %rbx, %rdi
callq 0x45e0
movq 0x58(%r14), %rax
cmpq 0x60(%r14), %rax
je 0xa57c
callq 0x4100
cltq
movq 0x58(%r14), %rcx
movq 0x60(%r14), %rsi
movq %rsi, %rdi
subq %rcx, %rdi
sarq $0x2, %rdi
xorl %edx, %edx
divq %rdi
movl (%rcx,%rdx,4), %ebp
movl -0x4(%rsi), %eax
movl %eax, (%rcx,%rdx,4)
movl %ebp, -0x4(%rsi)
addq $-0x4, %rsi
movq %rsi, 0x60(%r14)
jmp 0xa581
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %rbx, %rdi
callq 0x4390
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/blkdev.cpp
// Function: BlkDev::open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)
int
BlkDev::open(const std::string &path,
             const int          flags)
{
  int64_t rv;

  _fd = ::open(path.c_str(),flags);
  if(_fd == -1)
    return -errno;

  rv = l::block_device(_fd);
  if(rv < 0)
    goto error;

  rv = sg::identify(_fd,_identity);
  if(rv == 0)
    _has_identity = true;

  rv = IOCtl::logical_block_size(_fd);
  if(rv < 0)
    goto error;
  _logical_block_size = rv;

  rv = IOCtl::physical_block_size(_fd);
  if(rv < 0)
    goto error;
  _physical_block_size = rv;

  rv = IOCtl::size_in_bytes(_fd);
  if(rv < 0)
    goto error;
  _size_in_bytes = rv;

  _logical_block_count  = (_size_in_bytes / _logical_block_size);
  _physical_block_count = (_size_in_bytes / _physical_block_size);

  ::posix_fadvise(_fd,0,_size_in_bytes,POSIX_FADV_DONTNEED);

  return 0;

 error:
  ::close(_fd);

  _reset_data();

  return rv;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
movq (%rsi), %rdi
xorl %r14d, %r14d
movl %edx, %esi
xorl %eax, %eax
callq 0x4360
movl %eax, 0x8c(%rbx)
cmpl $-0x1, %eax
je 0xcd5e
leaq 0x8(%rsp), %rsi
movl %eax, %edi
callq 0x46b0
cmpl $-0x1, %eax
je 0xcd6b
movl $0xf000, %eax           # imm = 0xF000
andl 0x20(%rsp), %eax
xorl %edx, %edx
cmpl $0x6000, %eax           # imm = 0x6000
movl $0xfffffff1, %ecx       # imm = 0xFFFFFFF1
cmovel %edx, %ecx
jmp 0xcd74
callq 0x4060
subl (%rax), %r14d
jmp 0xce48
callq 0x4060
xorl %ecx, %ecx
subl (%rax), %ecx
testl %ecx, %ecx
js 0xce0f
movl 0x8c(%rbx), %edi
leaq 0x30(%rbx), %rsi
callq 0x14de1
testl %eax, %eax
jne 0xcd96
movb $0x1, 0x88(%rbx)
movl 0x8c(%rbx), %edi
callq 0xefec
movslq %eax, %r14
testl %r14d, %r14d
js 0xce12
movq %r14, 0x8(%rbx)
movl 0x8c(%rbx), %edi
callq 0xf01e
movslq %eax, %r14
testl %r14d, %r14d
js 0xce12
movq %r14, 0x10(%rbx)
movl 0x8c(%rbx), %edi
callq 0xf050
movq %rax, %r14
testq %rax, %rax
js 0xce12
movq %r14, 0x18(%rbx)
movq %r14, %rax
xorl %edx, %edx
divq 0x8(%rbx)
movq %rax, 0x20(%rbx)
movq %r14, %rax
xorl %edx, %edx
divq 0x10(%rbx)
movq %rax, 0x28(%rbx)
movl 0x8c(%rbx), %edi
xorl %esi, %esi
movq %r14, %rdx
movl $0x4, %ecx
callq 0x4380
xorl %r14d, %r14d
jmp 0xce48
movl %ecx, %r14d
movl 0x8c(%rbx), %edi
callq 0x4780
movabsq $0x2710ffffffff, %rax   # imm = 0x2710FFFFFFFF
movq %rax, 0x8c(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movups %xmm0, 0x18(%rbx)
movq $0x0, 0x28(%rbx)
movb $0x0, 0x88(%rbx)
movl %r14d, %eax
addq $0x98, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/blkdev.cpp
// Function: BlkDev::close()
int
BlkDev::close(void)
{
  int rv;

  if(_fd == -1)
    return 0;

  rv = ::close(_fd);

  _reset_data();

  return ((rv == -1) ? -errno : rv);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x8c(%rdi), %edi
cmpl $-0x1, %edi
je 0xceb6
callq 0x4780
movabsq $0x2710ffffffff, %rcx   # imm = 0x2710FFFFFFFF
movq %rcx, 0x8c(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movups %xmm0, 0x18(%rbx)
movq $0x0, 0x28(%rbx)
movb $0x0, 0x88(%rbx)
cmpl $-0x1, %eax
jne 0xceb8
callq 0x4060
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
jmp 0xceb8
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/blkdev.cpp
// Function: BlkDev::os_read(unsigned long, unsigned long, void*, unsigned long)
int64_t
BlkDev::os_read(const uint64_t  lba_,
                const uint64_t  blocks_,
                void           *buf_,
                const uint64_t  buflen_)
{
  int64_t rv;
  uint64_t len;
  off_t offset;

  len    = ((buflen_ * _logical_block_size) / _logical_block_size);
  len    = std::min((blocks_ * _logical_block_size),len);
  offset = (lba_ * _logical_block_size);

  rv = ::pread(_fd,buf_,len,offset);
  if(rv == -1)
    return -errno;

  return (rv / _logical_block_size);
}

// Assembly:
pushq %rbx
movq %r8, %rax
movq %rdx, %r8
movq %rdi, %rbx
movq 0x8(%rdi), %r9
imulq %r9, %rax
xorl %edx, %edx
divq %r9
imulq %r9, %r8
cmpq %r8, %rax
cmovbq %rax, %r8
imulq %rsi, %r9
movl 0x8c(%rdi), %edi
movq %rcx, %rsi
movq %r8, %rdx
movq %r9, %rcx
callq 0x4550
cmpq $-0x1, %rax
je 0xcf02
xorl %edx, %edx
divq 0x8(%rbx)
jmp 0xcf0d
callq 0x4060
movslq (%rax), %rax
negq %rax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/blkdev.cpp
// Function: BlkDev::os_write(unsigned long, unsigned long, void const*, unsigned long)
int64_t
BlkDev::os_write(const uint64_t  lba_,
                 const uint64_t  blocks_,
                 const void     *buf_,
                 const uint64_t  buflen_)
{
  int64_t rv;
  uint64_t len;
  off_t offset;

  len    = ((buflen_ * _logical_block_size) / _logical_block_size);
  len    = std::min((blocks_ * _logical_block_size),len);
  offset = (lba_ * _logical_block_size);

  rv = ::pwrite(_fd,buf_,len,offset);
  if(rv == -1)
    return -errno;

  return (rv / _logical_block_size);
}

// Assembly:
pushq %rbx
movq %r8, %rax
movq %rdx, %r8
movq %rdi, %rbx
movq 0x8(%rdi), %r9
imulq %r9, %rax
xorl %edx, %edx
divq %r9
imulq %r9, %r8
cmpq %r8, %rax
cmovbq %rax, %r8
imulq %rsi, %r9
movl 0x8c(%rdi), %edi
movq %rcx, %rsi
movq %r8, %rdx
movq %r9, %rcx
callq 0x4130
cmpq $-0x1, %rax
je 0xcf58
xorl %edx, %edx
divq 0x8(%rbx)
jmp 0xcf63
callq 0x4060
movslq (%rax), %rax
negq %rax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/blkdev.cpp
// Function: BlkDev::read(unsigned long, unsigned long, void*, unsigned long)
int64_t
BlkDev::read(const uint64_t  lba_,
             const uint64_t  blocks_,
             void           *buf_,
             const uint64_t  buflen_)
{
  switch(_rw_type)
    {
    case ATA:
      return ata_read(lba_,blocks_,buf_,buflen_);
    case OS:
      return os_read(lba_,blocks_,buf_,buflen_);
    }

  return -ENOTSUP;
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
movl (%rdi), %edx
cmpl $0x1, %edx
je 0xcfe1
movq $-0x5f, %rax
testl %edx, %edx
jne 0xcfdf
movl 0x8c(%rdi), %eax
movl 0x90(%rdi), %r9d
movl %eax, %edi
movq %rbx, %rdx
callq 0x14e48
testl %eax, %eax
cltq
cmovnsq %rbx, %rax
popq %rbx
retq
movq %rbx, %rdx
popq %rbx
jmp 0xceba
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/blkdev.cpp
// Function: BlkDev::read(unsigned long, unsigned long, std::vector<char, std::allocator<char>>&)
int64_t
BlkDev::read(const uint64_t     lba_,
             const uint64_t     blocks_,
             std::vector<char> &buf_)
{
  switch(_rw_type)
    {
    case ATA:
      return ata_read(lba_,blocks_,&buf_[0],buf_.size());
    case OS:
      return os_read(lba_,blocks_,&buf_[0],buf_.size());
    }

  return -ENOTSUP;
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
movl (%rdi), %edx
cmpl $0x1, %edx
je 0xd02e
movq $-0x5f, %rax
testl %edx, %edx
jne 0xd02c
movq (%rcx), %rax
movq 0x8(%rcx), %r8
subq %rax, %r8
movl 0x8c(%rdi), %ecx
movl 0x90(%rdi), %r9d
movl %ecx, %edi
movq %rbx, %rdx
movq %rax, %rcx
callq 0x14e48
testl %eax, %eax
cltq
cmovnsq %rbx, %rax
popq %rbx
retq
movq (%rcx), %rax
movq 0x8(%rcx), %r8
subq %rax, %r8
movq %rbx, %rdx
movq %rax, %rcx
popq %rbx
jmp 0xceba
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/blkdev.cpp
// Function: BlkDev::write(unsigned long, unsigned long, void const*, unsigned long)
int64_t
BlkDev::write(const uint64_t  lba_,
              const uint64_t  blocks_,
              const void     *buf_,
              const uint64_t  buflen_)
{
  switch(_rw_type)
    {
    case ATA:
      return ata_write(lba_,blocks_,buf_,buflen_);
    case OS:
      return os_write(lba_,blocks_,buf_,buflen_);
    }

  return -ENOTSUP;
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
movl (%rdi), %edx
cmpl $0x1, %edx
je 0xd07b
movq $-0x5f, %rax
testl %edx, %edx
jne 0xd079
movl 0x8c(%rdi), %eax
movl 0x90(%rdi), %r9d
movl %eax, %edi
movq %rbx, %rdx
callq 0x14ec0
testl %eax, %eax
cltq
cmovnsq %rbx, %rax
popq %rbx
retq
movq %rbx, %rdx
popq %rbx
jmp 0xcf10
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/blkdev.cpp
// Function: BlkDev::write(unsigned long, unsigned long, std::vector<char, std::allocator<char>> const&)
int64_t
BlkDev::write(const uint64_t           lba_,
              const uint64_t           blocks_,
              const std::vector<char> &buf_)
{
  switch(_rw_type)
    {
    case ATA:
      return ata_write(lba_,blocks_,&buf_[0],buf_.size());
    case OS:
      return os_write(lba_,blocks_,&buf_[0],buf_.size());
    }

  return -ENOTSUP;
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
movl (%rdi), %edx
cmpl $0x1, %edx
je 0xd0c8
movq $-0x5f, %rax
testl %edx, %edx
jne 0xd0c6
movq (%rcx), %rax
movq 0x8(%rcx), %r8
subq %rax, %r8
movl 0x8c(%rdi), %ecx
movl 0x90(%rdi), %r9d
movl %ecx, %edi
movq %rbx, %rdx
movq %rax, %rcx
callq 0x14ec0
testl %eax, %eax
cltq
cmovnsq %rbx, %rax
popq %rbx
retq
movq (%rcx), %rax
movq 0x8(%rcx), %r8
subq %rax, %r8
movq %rbx, %rdx
movq %rax, %rcx
popq %rbx
jmp 0xcf10
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/blkdev.cpp
// Function: BlkDev::sync()
int
BlkDev::sync(void)
{
  int rv;
  int error;

  error = 0;

  rv = ::fsync(_fd);
  if(rv == -1)
    error = -errno;

  rv = ::fdatasync(_fd);
  if(rv == -1)
    error = -errno;

  rv = IOCtl::block_flush(_fd);
  if(rv < 0)
    error = rv;

  return error;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x8c(%rdi), %edi
callq 0x4400
xorl %ebp, %ebp
cmpl $-0x1, %eax
jne 0xd10b
callq 0x4060
xorl %ebp, %ebp
subl (%rax), %ebp
movl 0x8c(%rbx), %edi
callq 0x4230
cmpl $-0x1, %eax
jne 0xd124
callq 0x4060
xorl %ebp, %ebp
subl (%rax), %ebp
movl 0x8c(%rbx), %edi
callq 0xf110
testl %eax, %eax
cmovnsl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/blocktofilemapper.cpp
// Function: BlockToFileMapper::scan(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
int
BlockToFileMapper::scan(const std::string &basepath)
{
  int rv;
  int64_t blocksize;

  blocksize = File::logical_block_size(basepath);
  if(blocksize < 0)
    return blocksize;

  rv = ::scan(basepath,blocksize,_blockmap);

  ::compress(_blockmap);

  return rv;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, %rdi
callq 0xe610
movq %rax, %rbx
testq %rax, %rax
js 0xd23b
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xd247
movzbl %al, %ebx
movq 0x18(%r14), %r15
leaq 0x8(%r14), %r13
cmpq %r13, %r15
je 0xd23b
movq %r15, %rdi
callq 0x4320
cmpq %r13, %rax
je 0xd22b
movq %rax, %r12
movq 0x38(%r15), %rdx
cmpq 0x38(%r12), %rdx
jne 0xd22b
testq %rdx, %rdx
je 0xd1f5
movq 0x30(%r12), %rsi
movq 0x30(%r15), %rdi
callq 0x44c0
testl %eax, %eax
jne 0xd22b
movq 0x28(%r15), %rax
movq 0x20(%r15), %rcx
addq %rax, %rcx
cmpq 0x20(%r12), %rcx
jne 0xd22b
addq 0x28(%r12), %rax
movq %rax, 0x28(%r15)
movq %r14, %rdi
movq %r12, %rsi
callq 0xd8b2
movq %r15, %rdi
callq 0x4320
movq %rax, %r12
cmpq %r13, %rax
jne 0xd1d3
movq %r15, %rdi
callq 0x4320
movq %rax, %r15
cmpq %r13, %rax
jne 0xd1c3
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/blocktofilemapper.cpp
// Function: BlockToFileMapper::find[abi:cxx11](unsigned long) const
std::pair<bool,std::string>
BlockToFileMapper::find(const uint64_t block) const
{
  BlockMap::const_iterator iter;


  iter = _blockmap.upper_bound(block);
  if(iter != _blockmap.end())
    --iter;

  if(iter == _blockmap.end())
    return std::make_pair(false,std::string());

  if(block < (iter->first + iter->second.first))
    return std::make_pair(true,iter->second.second);

  return std::make_pair(false,std::string());
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x10(%rsi), %rcx
addq $0x8, %r15
movq %r15, %rax
testq %rcx, %rcx
je 0xd68e
movq %r15, %rax
xorl %edx, %edx
cmpq %r14, 0x20(%rcx)
cmovaq %rcx, %rax
setbe %dl
movq 0x10(%rcx,%rdx,8), %rcx
testq %rcx, %rcx
jne 0xd677
cmpq %r15, %rax
je 0xd69b
movq %rax, %rdi
callq 0x42b0
cmpq %r15, %rax
je 0xd6ce
movq 0x28(%rax), %rcx
addq 0x20(%rax), %rcx
cmpq %r14, %rcx
jbe 0xd6ce
movb $0x1, (%rbx)
leaq 0x8(%rbx), %rdi
leaq 0x18(%rbx), %rcx
movq %rcx, 0x8(%rbx)
movq 0x30(%rax), %rsi
movq 0x38(%rax), %rdx
addq %rsi, %rdx
callq 0x9b42
jmp 0xd70e
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
xorl %ecx, %ecx
movq %rcx, -0x8(%rax)
movb %cl, (%rax)
movb %cl, (%rbx)
leaq 0x18(%rbx), %rdx
movq %rdx, 0x8(%rbx)
movb (%rax), %dl
movb %dl, 0x18(%rbx)
movq 0x1(%rax), %rdx
movq %rdx, 0x19(%rbx)
movl 0x9(%rax), %edx
movl %edx, 0x21(%rbx)
movzwl 0xd(%rax), %edx
movw %dx, 0x25(%rbx)
movb 0xf(%rax), %al
movb %al, 0x27(%rbx)
movq %rcx, 0x10(%rbx)
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/captcha.cpp
// Function: captcha::calculate[abi:cxx11](BlkDev const&)
std::string
  calculate(const BlkDev &blkdev)
  {
    std::stringstream ss;

    if(blkdev.has_identity())
      ss << blkdev.identity().serial_number;

    if(ss.gcount() == 0)
      ss << blkdev.size_in_bytes();

    return ss.str();
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rsi, %r14
movq %rdi, %rbx
movq %rsp, %rdi
callq 0x4330
cmpb $0x1, 0x88(%r14)
jne 0xd931
leaq 0x10(%rsp), %r15
leaq 0x40(%r14), %r12
movq %r12, %rdi
callq 0x4200
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x4500
cmpq $0x0, 0x8(%rsp)
jne 0xd947
leaq 0x10(%rsp), %rdi
movq 0x18(%r14), %rsi
callq 0x4300
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x4650
movq 0x16635(%rip), %rsi     # 0x23f90
movq %rsp, %rdi
callq 0x4370
leaq 0x80(%rsp), %rdi
callq 0x4190
movq %rbx, %rax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x16604(%rip), %rsi     # 0x23f90
movq %rsp, %rdi
callq 0x4370
leaq 0x80(%rsp), %rdi
callq 0x4190
movq %rbx, %rdi
callq 0x46f0
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/fiemap.cpp
// Function: FIEMap::extent_map_count(int)
int
  extent_map_count(const int fd)
  {
    int rv;
    struct fiemap fm = {0};

    fm.fm_length = FIEMAP_MAX_OFFSET;

    rv = ::ioctl(fd,FS_IOC_FIEMAP,&fm);
    if(rv == -1)
      return -1;

    return fm.fm_mapped_extents;
  }

// Assembly:
subq $0x28, %rsp
xorps %xmm0, %xmm0
movq %rsp, %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x10(%rdx)
movq $-0x1, 0x8(%rdx)
movl $0xc020660b, %esi       # imm = 0xC020660B
xorl %eax, %eax
callq 0x45b0
cmpl $-0x1, %eax
je 0xe56e
movl 0x14(%rsp), %eax
addq $0x28, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/fiemap.cpp
// Function: FIEMap::extent_map(int)
struct fiemap *
  extent_map(const int fd)
  {
    int rv;
    int extent_count;
    int extent_size;
    struct fiemap *fm;

    extent_count = FIEMap::extent_map_count(fd);
    if(extent_count == -1)
      return NULL;

    extent_size = (sizeof(struct fiemap_extent) * extent_count);

    fm = (struct fiemap*)calloc(1,(sizeof(struct fiemap) + extent_size));
    if(fm == NULL)
      return NULL;

    fm->fm_length       = FIEMAP_MAX_OFFSET;
    fm->fm_extent_count = extent_count;

    rv = ::ioctl(fd,FS_IOC_FIEMAP,fm);
    if(rv == -1)
      {
        ::free(fm);
        return NULL;
      }

    return fm;
  }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %edi, %ebp
xorps %xmm0, %xmm0
movq %rsp, %r14
movaps %xmm0, (%r14)
movaps %xmm0, 0x10(%r14)
movq $-0x1, 0x8(%r14)
xorl %ebx, %ebx
movl $0xc020660b, %esi       # imm = 0xC020660B
movq %r14, %rdx
xorl %eax, %eax
callq 0x45b0
cmpl $-0x1, %eax
sete %al
movl 0x14(%r14), %r14d
cmpl $-0x1, %r14d
sete %cl
orb %al, %cl
jne 0xe603
imull $0x38, %r14d, %eax
movslq %eax, %rsi
addq $0x20, %rsi
movl $0x1, %edi
callq 0x42f0
testq %rax, %rax
je 0xe601
movq %rax, %rbx
movq $-0x1, 0x8(%rax)
movl %r14d, 0x18(%rax)
movl $0xc020660b, %esi       # imm = 0xC020660B
movl %ebp, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x45b0
cmpl $-0x1, %eax
jne 0xe603
movq %rbx, %rdi
callq 0x4520
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/file.cpp
// Function: File::logical_block_size(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
int64_t
  logical_block_size(const std::string &filepath)
  {
    int fd;
    int64_t logical_block_size;
    std::string devpath;

    devpath = FileToBlkDev::find(filepath);
    if(devpath.empty())
      return -ENOENT;

    fd = ::open(devpath.c_str(),O_RDONLY|O_NONBLOCK);
    if(fd == -1)
      return -errno;

    logical_block_size = IOCtl::logical_block_size(fd);

    ::close(fd);

    return logical_block_size;
  }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rsi
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
movq $0x0, -0x8(%r14)
movb $0x0, (%r14)
leaq 0x20(%rsp), %rdi
callq 0xe914
movq %rsp, %rdi
leaq 0x20(%rsp), %rbx
movq %rbx, %rsi
callq 0x4540
movq (%rbx), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xe664
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x44b0
cmpq $0x0, 0x8(%rsp)
je 0xe698
movq (%rsp), %rdi
movl $0x800, %esi            # imm = 0x800
xorl %eax, %eax
callq 0x4360
movl %eax, %ebx
cmpl $-0x1, %eax
je 0xe6a1
movl %ebx, %edi
callq 0xefec
movl %eax, %ebp
movl %ebx, %edi
callq 0x4780
movslq %ebp, %rbx
jmp 0xe6ac
movq $-0x2, %rbx
jmp 0xe6ac
callq 0x4060
movslq (%rax), %rbx
negq %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0xe6c2
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x44b0
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0xe6d0
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0xe6e9
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x44b0
movq %rbx, %rdi
callq 0x46f0
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/file.cpp
// Function: File::blocks(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<File::Block, std::allocator<File::Block>>&)
int
  blocks(const std::string &filepath,
         BlockVector       &blockvector)
  {
    int fd;
    int rv;
    int64_t logical_block_size;

    logical_block_size = File::logical_block_size(filepath);
    if(logical_block_size < 0)
      return logical_block_size;

    fd = ::open(filepath.c_str(),O_RDONLY);
    if(fd == -1)
      return -errno;

    rv = ::blocks(fd,logical_block_size,blockvector);

    ::close(fd);

    return rv;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %r15
callq 0xe610
movq %rax, %rbx
testq %rax, %rax
js 0xe7c2
movq (%r15), %rdi
xorl %r15d, %r15d
xorl %esi, %esi
xorl %eax, %eax
callq 0x4360
cmpl $-0x1, %eax
je 0xe7a9
movl %eax, %ebp
movl %eax, %edi
callq 0xe573
testq %rax, %rax
je 0xe7b6
movq %rax, %r15
cmpl $0x0, 0x14(%rax)
je 0xe79d
movq %r15, %r13
addq $0x30, %r13
xorl %r12d, %r12d
movq -0x8(%r13), %rax
xorl %edx, %edx
divq %rbx
movq %rax, 0x8(%rsp)
movq (%r13), %rax
xorl %edx, %edx
divq %rbx
movq %rax, 0x10(%rsp)
movq 0x8(%r14), %rsi
cmpq 0x10(%r14), %rsi
je 0xe780
movups 0x8(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x8(%r14)
jmp 0xe78d
movq %r14, %rdi
leaq 0x8(%rsp), %rdx
callq 0xe7d4
incq %r12
movl 0x14(%r15), %eax
addq $0x38, %r13
cmpq %rax, %r12
jb 0xe74b
movq %r15, %rdi
callq 0x4520
xorl %ebx, %ebx
jmp 0xe7bb
callq 0x4060
subl (%rax), %r15d
movl %r15d, %ebx
jmp 0xe7c2
movl $0xfffffff4, %ebx       # imm = 0xFFFFFFF4
movl %ebp, %edi
callq 0x4780
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/info.cpp
// Function: InfoPrinter::init(unsigned long, unsigned long, std::vector<unsigned long, std::allocator<unsigned long>>*)
void
InfoPrinter::init(const size_t  start_block_,
                  const size_t  end_block_,
                  U64Vec       *badblocks_)
{
  std::cout << "\r\x1B[2K" << '\x1B' << '7';

  _start_block = start_block_;
  _end_block   = end_block_;
  _badblocks   = badblocks_;
  _start_time  = Time::get_monotonic();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq 0x1543c(%rip), %r13     # 0x23fb8
leaq 0x7efd(%rip), %rsi      # 0x16a80
movl $0x5, %edx
movq %r13, %rdi
callq 0x4500
leaq 0xe(%rsp), %rsi
movb $0x1b, (%rsi)
movl $0x1, %edx
movq %r13, %rdi
callq 0x4500
leaq 0xf(%rsp), %rsi
movb $0x37, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x4500
movq %r12, 0x8(%rbx)
movq %r15, 0x10(%rbx)
movq %r14, 0x18(%rbx)
callq 0x153e4
movsd %xmm0, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/ioctl.cpp
// Function: IOCtl::logical_block_size(int)
int
  logical_block_size(const int fd)
  {
    int rv;
    int size;

    rv = ::ioctl(fd, BLKSSZGET, &size);
    if(rv == -1)
      return -errno;

    return size;
  }

// Assembly:
pushq %rbx
subq $0x10, %rsp
xorl %ebx, %ebx
leaq 0xc(%rsp), %rdx
movl $0x1268, %esi           # imm = 0x1268
xorl %eax, %eax
callq 0x45b0
cmpl $-0x1, %eax
je 0xf00f
movl 0xc(%rsp), %ebx
jmp 0xf016
callq 0x4060
subl (%rax), %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/ioctl.cpp
// Function: IOCtl::physical_block_size(int)
int
  physical_block_size(const int fd)
  {
    int rv;
    int size;

    rv = ::ioctl(fd,BLKBSZGET,&size);
    if(rv == -1)
      return -errno;

    return size;
  }

// Assembly:
pushq %rbx
subq $0x10, %rsp
xorl %ebx, %ebx
leaq 0xc(%rsp), %rdx
movl $0x80081270, %esi       # imm = 0x80081270
xorl %eax, %eax
callq 0x45b0
cmpl $-0x1, %eax
je 0xf041
movl 0xc(%rsp), %ebx
jmp 0xf048
callq 0x4060
subl (%rax), %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/ioctl.cpp
// Function: IOCtl::size_in_bytes(int)
int64_t
  size_in_bytes(const int fd)
  {
    int rv;

#ifdef BLKGETSIZE64
    {
      int64_t size;

      rv = ::ioctl(fd,BLKGETSIZE64,&size);
      if(rv != -1)
        return size;
    }
#endif

    {
      unsigned long size;

      rv = ::ioctl(fd,BLKGETSIZE,&size);
      if(rv != 0)
        return ((int64_t)size * 512);
    }

    return -errno;
  }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebp
leaq 0x8(%rsp), %rbx
movl $0x80081272, %esi       # imm = 0x80081272
movq %rbx, %rdx
xorl %eax, %eax
callq 0x45b0
movq (%rbx), %rbx
cmpl $-0x1, %eax
jne 0xf0a6
leaq 0x8(%rsp), %r14
movl $0x1260, %esi           # imm = 0x1260
movl %ebp, %edi
movq %r14, %rdx
xorl %eax, %eax
callq 0x45b0
movq (%r14), %rcx
shlq $0x9, %rcx
testl %eax, %eax
cmovneq %rcx, %rbx
jne 0xf0a6
callq 0x4060
movslq (%rax), %rbx
negq %rbx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/ioctl.cpp
// Function: IOCtl::logical_block_count(int)
int64_t
  logical_block_count(const int fd)
  {
    int logical_block_size;
    int64_t size_in_bytes;

    logical_block_size = IOCtl::logical_block_size(fd);
    if(logical_block_size < 0)
      return logical_block_size;

    size_in_bytes = IOCtl::size_in_bytes(fd);
    if(size_in_bytes < 0)
      return size_in_bytes;

    return (size_in_bytes / logical_block_size);
  }

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebp
callq 0xefec
movl %eax, %ebx
testl %eax, %eax
js 0xf0d7
movl %ebp, %edi
callq 0xf050
testq %rax, %rax
js 0xf0da
movl %ebx, %ecx
xorl %edx, %edx
divq %rcx
jmp 0xf0da
movslq %ebx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/ioctl.cpp
// Function: IOCtl::physical_block_count(int)
int64_t
  physical_block_count(const int fd)
  {
    int physical_block_size;
    int64_t size_in_bytes;

    physical_block_size = IOCtl::physical_block_size(fd);
    if(physical_block_size < 0)
      return physical_block_size;

    size_in_bytes = IOCtl::size_in_bytes(fd);
    if(size_in_bytes < 0)
      return size_in_bytes;

    return (size_in_bytes / physical_block_size);
  }

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebp
callq 0xf01e
movl %eax, %ebx
testl %eax, %eax
js 0xf106
movl %ebp, %edi
callq 0xf050
testq %rax, %rax
js 0xf109
movl %ebx, %ecx
xorl %edx, %edx
divq %rcx
jmp 0xf109
movslq %ebx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/num.cpp
// Function: num::humanize[abi:cxx11](unsigned long, bool)
std::string
  humanize(const uint64_t bytes,
           const bool     si)
  {
    int exp  = 0;
    int unit = (si ? 1000 : 1024);
    std::stringstream ss;

    exp = ((bytes == 0) ?
           0 :
           compute_exp(bytes,unit));

    ss.precision(2);
    ss << std::fixed
       << (bytes / std::pow(unit,exp))
       << suffix[exp][si];

    return ss.str();
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
testl %edx, %edx
movl $0x3e8, %eax            # imm = 0x3E8
movl $0x400, %r15d           # imm = 0x400
cmovnel %eax, %r15d
leaq 0x30(%rsp), %rdi
callq 0x4330
movq %r14, %xmm1
cvtsi2sd %r15d, %xmm0
testq %r14, %r14
je 0xf204
movdqa %xmm1, 0x20(%rsp)
movapd 0x20(%rsp), %xmm1
unpcklps 0x78a2(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x78aa(%rip), %xmm1     # 0x16a60
movsd %xmm0, (%rsp)
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
callq 0x43c0
movsd %xmm0, 0x18(%rsp)
movsd (%rsp), %xmm0
callq 0x43c0
movdqa 0x20(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
divsd %xmm0, %xmm2
movsd (%rsp), %xmm0
cvttsd2si %xmm2, %eax
cmpl $0x7, %eax
movl $0x7, %r15d
cmovll %eax, %r15d
jmp 0xf207
xorl %r15d, %r15d
leaq 0x40(%rsp), %r14
movq -0x10(%r14), %rax
movq -0x18(%rax), %rax
movq $0x2, 0x38(%rsp,%rax)
movq (%r14), %rax
movq -0x18(%rax), %rax
movl $0xfffffefb, %ecx       # imm = 0xFFFFFEFB
andl 0x58(%rsp,%rax), %ecx
orl $0x4, %ecx
punpckldq 0x7818(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
movl %ecx, 0x58(%rsp,%rax)
subpd 0x781c(%rip), %xmm1     # 0x16a60
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
movapd %xmm2, (%rsp)
xorps %xmm1, %xmm1
cvtsi2sd %r15d, %xmm1
callq 0x46e0
movapd (%rsp), %xmm1
divsd %xmm0, %xmm1
movq %r14, %rdi
movapd %xmm1, %xmm0
callq 0x4670
movq %rax, %r14
movslq %r15d, %rax
shlq $0x4, %rax
leaq 0x148d8(%rip), %rcx     # 0x23b60
addq %rax, %rcx
movzbl %bpl, %eax
movq (%rcx,%rax,8), %r15
testq %r15, %r15
je 0xf2b0
movq %r15, %rdi
callq 0x4200
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x4500
jmp 0xf2ca
movq (%r14), %rax
movq -0x18(%rax), %rax
movq %r14, %rdi
addq %rax, %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x46c0
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0x4650
movq 0x14cb2(%rip), %rsi     # 0x23f90
leaq 0x30(%rsp), %rdi
callq 0x4370
leaq 0xb0(%rsp), %rdi
callq 0x4190
movq %rbx, %rax
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x14c80(%rip), %rsi     # 0x23f90
leaq 0x30(%rsp), %rdi
callq 0x4370
leaq 0xb0(%rsp), %rdi
callq 0x4190
movq %rbx, %rdi
callq 0x46f0
nop
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/rnd.cpp
// Function: rnd::str[abi:cxx11](int)
std::string
  str(int len_)
  {
    std::string s;

    for(int i = 0; i < len_; i++)
      s.push_back('a' + (std::rand() % 26));

    return s;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
testl %esi, %esi
jle 0xff15
movl %esi, %ebp
callq 0x4100
cltq
imulq $0x4ec4ec4f, %rax, %rcx # imm = 0x4EC4EC4F
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x23, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,4), %edx
leal (%rdx,%rdx,4), %edx
addl %ecx, %edx
subl %edx, %eax
addb $0x61, %al
movsbl %al, %esi
movq %rbx, %rdi
callq 0x43f0
decl %ebp
jne 0xfedf
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0xff39
movq (%r15), %rsi
incq %rsi
callq 0x44b0
movq %r14, %rdi
callq 0x46f0
// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/sg.cpp
// Function: sg::tf_init(sg::ata_tf*, unsigned char, unsigned long, unsigned int)
void
  tf_init(struct ata_tf *tf,
          uint8_t        ata_op,
          uint64_t       lba,
          unsigned int   nsect)
  {
    memset(tf,0,sizeof(struct ata_tf));

    tf->command   = ata_op;
    tf->dev       = ATA_USING_LBA | 0xA0;
    tf->lob.lbal  = lba;
    tf->lob.lbam  = lba >>  8;
    tf->lob.lbah  = lba >> 16;
    tf->lob.nsect = nsect;

    if(needs_lba48(ata_op,lba,nsect))
      {
        tf->is_lba48  = 1;
        tf->hob.feat  = 0;
        tf->hob.nsect = nsect >>  8;
        tf->hob.lbal  =   lba >> 24;
        tf->hob.lbam  =   lba >> 32;
        tf->hob.lbah  =   lba >> 40;
      }
    else
      {
        tf->dev |= (lba >> 24) & 0x0F;
      }
  }

// Assembly:
xorl %eax, %eax
movq %rax, (%rdi)
movq %rax, 0x7(%rdi)
movb %sil, 0x1(%rdi)
movb $-0x20, (%rdi)
movb %dl, 0x7(%rdi)
movb %dh, 0x8(%rdi)
movl %edx, %eax
shrl $0x10, %eax
movb %al, 0x9(%rdi)
movb %cl, 0x6(%rdi)
cmpl $0xaf, %esi
jg 0x147b6
leal -0x6(%rsi), %eax
cmpl $0x3f, %eax
ja 0x147d3
movabsq $-0x6ffd3ffd3fffffff, %r8 # imm = 0x9002C002C0000001
btq %rax, %r8
jae 0x147d3
movb $0x1, 0x4(%rdi)
movb $0x0, 0xa(%rdi)
movb %ch, 0xb(%rdi)
movl %edx, %eax
shrl $0x18, %eax
movb %al, 0xc(%rdi)
movq %rdx, %rax
shrq $0x20, %rax
movb %al, 0xd(%rdi)
shrq $0x28, %rdx
movb %dl, 0xe(%rdi)
retq
leal -0xf3(%rsi), %eax
cmpl $0x2, %eax
jb 0x14808
cmpl $0xb0, %esi
je 0x14808
cmpl $0xea, %esi
je 0x14791
jmp 0x147db
cmpl $0x80, %esi
je 0x14808
cmpq $0xfffffff, %rdx        # imm = 0xFFFFFFF
setae %al
cmpl $0x100, %ecx            # imm = 0x100
setae %sil
orb %al, %sil
jne 0x14791
movl %ecx, %eax
addq %rdx, %rax
movq $-0x10000000, %rsi      # imm = 0xF0000000
addq %rsi, %rax
cmpq %rsi, %rax
jbe 0x14791
shrl $0x18, %edx
andb $0xf, %dl
orb $-0x20, %dl
movb %dl, (%rdi)
retq