LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: 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 %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x48(%rbp)
movq %rdi, %rax
movq %rax, -0x40(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movb $0x0, -0x19(%rbp)
callq 0x46e0
movq -0x38(%rbp), %rdi
addq $0x70, %rdi
callq 0x4760
movq -0x38(%rbp), %rdi
addq $0x40, %rdi
callq 0x10d50
testb $0x1, %al
jne 0x11874
callq 0x4130
movq -0x38(%rbp), %rdi
cltq
movq %rax, -0x50(%rbp)
addq $0x40, %rdi
movq %rdi, -0x58(%rbp)
callq 0x10850
movq -0x58(%rbp), %rdi
movq %rax, %rcx
movq -0x50(%rbp), %rax
xorl %edx, %edx
divq %rcx
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rsi
callq 0x10eb0
movq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x4060
jmp 0x11805
movq -0x38(%rbp), %rdi
addq $0x40, %rdi
movq -0x18(%rbp), %rsi
callq 0x10eb0
movq -0x38(%rbp), %rdi
movq %rax, -0x60(%rbp)
movq %rdi, %rax
addq $0x40, %rax
movq %rax, -0x68(%rbp)
addq $0x40, %rdi
callq 0x10850
movq -0x68(%rbp), %rdi
movq %rax, %rsi
subq $0x1, %rsi
callq 0x10eb0
movq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0x11710
movq -0x38(%rbp), %rdi
addq $0x40, %rdi
callq 0x11740
jmp 0x11874
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x4300
jmp 0x1189e
movq -0x38(%rbp), %rdi
addq $0x70, %rdi
callq 0x4400
movb $0x1, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0x11894
movq -0x48(%rbp), %rdi
callq 0x4300
movq -0x40(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x4890
nopw (%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
movl $0xffffffff, -0xc(%rbp) # imm = 0xFFFFFFFF
addq $0xc0, %rdi
callq 0x4760
movq -0x20(%rbp), %rdi
addq $0x58, %rdi
callq 0x11450
testb $0x1, %al
jne 0x11980
callq 0x4130
movq -0x20(%rbp), %rdi
cltq
movq %rax, -0x38(%rbp)
addq $0x58, %rdi
callq 0xff50
movq -0x20(%rbp), %rdi
movq %rax, %rcx
movq -0x38(%rbp), %rax
xorl %edx, %edx
divq %rcx
movq %rdx, -0x18(%rbp)
addq $0x58, %rdi
movq -0x18(%rbp), %rsi
callq 0x115b0
movq -0x20(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0xc(%rbp)
addq $0x58, %rdi
movq -0x18(%rbp), %rsi
callq 0x115b0
movq -0x20(%rbp), %rdi
movq %rax, -0x28(%rbp)
movq %rdi, %rax
addq $0x58, %rax
movq %rax, -0x30(%rbp)
addq $0x58, %rdi
callq 0xff50
movq -0x30(%rbp), %rdi
movq %rax, %rsi
subq $0x1, %rsi
callq 0x115b0
movq -0x28(%rbp), %rdi
movq %rax, %rsi
callq 0x119a0
movq -0x20(%rbp), %rdi
addq $0x58, %rdi
callq 0x119d0
movq -0x20(%rbp), %rdi
addq $0xc0, %rdi
callq 0x4400
movl -0xc(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: trapexit[P]bbf/src/blkdev.cpp
// Function: BlkDev::_reset_data()
void
BlkDev::_reset_data(void)
{
  _fd                   = -1;
  _logical_block_size   =  0;
  _physical_block_size  =  0;
  _size_in_bytes        =  0;
  _logical_block_count  =  0;
  _physical_block_count =  0;
  _timeout              =  SECONDS(10);
  _has_identity         =  false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x8c(%rax) # imm = 0xFFFFFFFF
movq $0x0, 0x8(%rax)
movq $0x0, 0x10(%rax)
movq $0x0, 0x18(%rax)
movq $0x0, 0x20(%rax)
movq $0x0, 0x28(%rax)
movl $0x2710, 0x90(%rax)     # imm = 0x2710
movb $0x0, 0x88(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x4210
movq %rax, %rdi
movl -0x1c(%rbp), %esi
movb $0x0, %al
callq 0x43d0
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x8c(%rax)
cmpl $-0x1, 0x8c(%rax)
jne 0x14c0a
callq 0x4070
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
movl %eax, -0x4(%rbp)
jmp 0x14d30
movq -0x30(%rbp), %rax
movl 0x8c(%rax), %edi
callq 0x14d90
cltq
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jge 0x14c2b
jmp 0x14d11
movq -0x30(%rbp), %rsi
movl 0x8c(%rsi), %edi
addq $0x30, %rsi
callq 0x217a0
cltq
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x14c56
movq -0x30(%rbp), %rax
movb $0x1, 0x88(%rax)
movq -0x30(%rbp), %rax
movl 0x8c(%rax), %edi
callq 0x18f40
cltq
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jge 0x14c77
jmp 0x14d11
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl 0x8c(%rax), %edi
callq 0x18f90
cltq
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jge 0x14c9d
jmp 0x14d11
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rcx, 0x10(%rax)
movl 0x8c(%rax), %edi
callq 0x18fe0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jge 0x14cc1
jmp 0x14d11
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rax, 0x18(%rcx)
movq 0x18(%rcx), %rax
xorl %edx, %edx
divq 0x8(%rcx)
movq %rax, 0x20(%rcx)
movq 0x18(%rcx), %rax
xorl %edx, %edx
divq 0x10(%rcx)
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x28(%rax)
movl 0x8c(%rax), %edi
movq 0x18(%rax), %rdx
xorl %eax, %eax
movl %eax, %esi
movl $0x4, %ecx
callq 0x43e0
movl $0x0, -0x4(%rbp)
jmp 0x14d30
movq -0x30(%rbp), %rax
movl 0x8c(%rax), %edi
callq 0x4960
movq -0x30(%rbp), %rdi
callq 0x14ab0
movq -0x28(%rbp), %rax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpl $-0x1, 0x8c(%rax)
jne 0x14e26
movl $0x0, -0x4(%rbp)
jmp 0x14e64
movq -0x20(%rbp), %rax
movl 0x8c(%rax), %edi
callq 0x4960
movq -0x20(%rbp), %rdi
movl %eax, -0x14(%rbp)
callq 0x14ab0
cmpl $-0x1, -0x14(%rbp)
jne 0x14e58
callq 0x4070
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
movl %eax, -0x24(%rbp)
jmp 0x14e5e
movl -0x14(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x10(%rbp), %rcx
movq %rcx, -0x58(%rbp)
movq -0x30(%rbp), %rax
imulq 0x8(%rcx), %rax
xorl %edx, %edx
divq 0x8(%rcx)
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
imulq 0x8(%rcx), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x59b0
movq %rax, %rcx
movq -0x58(%rbp), %rax
movq (%rcx), %rcx
movq %rcx, -0x40(%rbp)
movq -0x18(%rbp), %rcx
imulq 0x8(%rax), %rcx
movq %rcx, -0x48(%rbp)
movl 0x8c(%rax), %edi
movq -0x28(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x48(%rbp), %rcx
callq 0x4660
movq %rax, -0x38(%rbp)
cmpq $-0x1, -0x38(%rbp)
jne 0x14f12
callq 0x4070
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
cltq
movq %rax, -0x8(%rbp)
jmp 0x14f24
movq -0x58(%rbp), %rcx
movq -0x38(%rbp), %rax
xorl %edx, %edx
divq 0x8(%rcx)
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nop
// File: 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 %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x10(%rbp), %rcx
movq %rcx, -0x58(%rbp)
movq -0x30(%rbp), %rax
imulq 0x8(%rcx), %rax
xorl %edx, %edx
divq 0x8(%rcx)
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
imulq 0x8(%rcx), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x59b0
movq %rax, %rcx
movq -0x58(%rbp), %rax
movq (%rcx), %rcx
movq %rcx, -0x40(%rbp)
movq -0x18(%rbp), %rcx
imulq 0x8(%rax), %rcx
movq %rcx, -0x48(%rbp)
movl 0x8c(%rax), %edi
movq -0x28(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x48(%rbp), %rcx
callq 0x4160
movq %rax, -0x38(%rbp)
cmpq $-0x1, -0x38(%rbp)
jne 0x14fd2
callq 0x4070
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
cltq
movq %rax, -0x8(%rbp)
jmp 0x14fe4
movq -0x58(%rbp), %rcx
movq -0x38(%rbp), %rax
xorl %edx, %edx
divq 0x8(%rcx)
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nop
// File: trapexit[P]bbf/src/blkdev.cpp
// Function: BlkDev::ata_read(unsigned long, unsigned long, void*, unsigned long)
int64_t
BlkDev::ata_read(const uint64_t  lba_,
                 const uint64_t  blocks_,
                 void           *buf_,
                 const uint64_t  buflen_)
{
  int rv;

  rv = sg::read_block(_fd,
                      lba_,
                      blocks_,
                      buf_,
                      buflen_,
                      _timeout);
  if(rv < 0)
    return rv;

  return blocks_;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl 0x8c(%rax), %edi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movl 0x90(%rax), %r9d
callq 0x21830
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jge 0x15045
movslq -0x34(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1504d
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: trapexit[P]bbf/src/blkdev.cpp
// Function: BlkDev::ata_write(unsigned long, unsigned long, void const*, unsigned long)
int64_t
BlkDev::ata_write(const uint64_t  lba_,
                  const uint64_t  blocks_,
                  const void     *buf_,
                  const uint64_t  buflen_)
{
  int rv;

  rv = sg::write_block(_fd,
                       lba_,
                       blocks_,
                       buf_,
                       buflen_,
                       _timeout);
  if(rv < 0)
    return rv;

  return blocks_;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl 0x8c(%rax), %edi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movl 0x90(%rax), %r9d
callq 0x218b0
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jge 0x150b5
movslq -0x34(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x150bd
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movl (%rax), %eax
movl %eax, -0x34(%rbp)
testl %eax, %eax
je 0x15109
jmp 0x150ff
movl -0x34(%rbp), %eax
subl $0x1, %eax
je 0x15128
jmp 0x15147
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0x14ff0
movq %rax, -0x8(%rbp)
jmp 0x1514f
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0x14e70
movq %rax, -0x8(%rbp)
jmp 0x1514f
movq $-0x5f, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
testl %eax, %eax
je 0x15198
jmp 0x1518b
movl -0x2c(%rbp), %eax
subl $0x1, %eax
je 0x151e0
jmp 0x15228
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x9980
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rdi
callq 0x7a90
movq -0x38(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq %rax, %r8
callq 0x14ff0
movq %rax, -0x8(%rbp)
jmp 0x15230
movq -0x18(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x28(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x9980
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rdi
callq 0x7a90
movq -0x38(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq -0x58(%rbp), %rcx
movq %rax, %r8
callq 0x14e70
movq %rax, -0x8(%rbp)
jmp 0x15230
movq $-0x5f, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movl (%rax), %eax
movl %eax, -0x34(%rbp)
testl %eax, %eax
je 0x15279
jmp 0x1526f
movl -0x34(%rbp), %eax
subl $0x1, %eax
je 0x15298
jmp 0x152b7
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0x15060
movq %rax, -0x8(%rbp)
jmp 0x152bf
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0x14f30
movq %rax, -0x8(%rbp)
jmp 0x152bf
movq $-0x5f, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
testl %eax, %eax
je 0x15308
jmp 0x152fb
movl -0x2c(%rbp), %eax
subl $0x1, %eax
je 0x15350
jmp 0x15398
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x99c0
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rdi
callq 0x7a90
movq -0x38(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq %rax, %r8
callq 0x15060
movq %rax, -0x8(%rbp)
jmp 0x153a0
movq -0x18(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x28(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x99c0
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rdi
callq 0x7a90
movq -0x38(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq -0x58(%rbp), %rcx
movq %rax, %r8
callq 0x14f30
movq %rax, -0x8(%rbp)
jmp 0x153a0
movq $-0x5f, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x10(%rbp)
movl 0x8c(%rax), %edi
callq 0x4480
movl %eax, -0xc(%rbp)
cmpl $-0x1, -0xc(%rbp)
jne 0x1540e
callq 0x4070
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
movl %eax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movl 0x8c(%rax), %edi
callq 0x4280
movl %eax, -0xc(%rbp)
cmpl $-0x1, -0xc(%rbp)
jne 0x15435
callq 0x4070
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
movl %eax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movl 0x8c(%rax), %edi
callq 0x19120
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jge 0x15453
movl -0xc(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x17c70
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jge 0x15535
movq -0x28(%rbp), %rax
movl %eax, -0x4(%rbp)
jmp 0x1555d
movq -0x30(%rbp), %rdx
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x15570
movq -0x30(%rbp), %rdi
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x1c(%rbp)
callq 0x15720
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0xa8(%rbp)
movq %rdi, %rax
movq %rax, -0xa0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x15d20
movq -0x98(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x15d40
movq -0x98(%rbp), %rdi
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
callq 0xa720
movq %rax, -0x30(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xa750
testb $0x1, %al
jne 0x1591b
jmp 0x15924
leaq -0x20(%rbp), %rdi
callq 0x15d70
movq -0x98(%rbp), %rdi
callq 0xa720
movq %rax, -0x38(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x15da0
testb $0x1, %al
jne 0x15947
jmp 0x1599c
movb $0x0, -0x39(%rbp)
leaq -0x60(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x46e0
movq -0xa8(%rbp), %rdi
movq -0xb0(%rbp), %rdx
leaq -0x39(%rbp), %rsi
callq 0x15dd0
jmp 0x15974
leaq -0x60(%rbp), %rdi
callq 0x4300
jmp 0x15a5f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x4300
jmp 0x15a6f
movq -0x18(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xa6c0
movq (%rax), %rax
movq %rax, -0xc0(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xa6c0
movq -0xc0(%rbp), %rcx
movq %rax, %rdx
movq -0xb8(%rbp), %rax
addq 0x8(%rdx), %rcx
cmpq %rcx, %rax
jae 0x15a07
movb $0x1, -0x6d(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xa6c0
movq -0xa8(%rbp), %rdi
movq %rax, %rdx
addq $0x8, %rdx
addq $0x8, %rdx
leaq -0x6d(%rbp), %rsi
callq 0x15e10
jmp 0x15a5f
movb $0x0, -0x6e(%rbp)
leaq -0x90(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x46e0
movq -0xa8(%rbp), %rdi
movq -0xc8(%rbp), %rdx
leaq -0x6e(%rbp), %rsi
callq 0x15dd0
jmp 0x15a37
leaq -0x90(%rbp), %rdi
callq 0x4300
jmp 0x15a5f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x4300
jmp 0x15a6f
movq -0xa0(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x4890
nopl (%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x1e0, %rsp            # imm = 0x1E0
movq %rdi, -0x1b8(%rbp)
movq %rdi, %rax
movq %rax, -0x1b0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x43a0
movq -0x10(%rbp), %rdi
callq 0x12c80
movb %al, -0x1a5(%rbp)
jmp 0x16d51
movb -0x1a5(%rbp), %al
testb $0x1, %al
jne 0x16d5d
jmp 0x16dbb
leaq -0x188(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x12ca0
movq %rax, -0x1c0(%rbp)
jmp 0x16d7d
movq -0x1c8(%rbp), %rdi
movq -0x1c0(%rbp), %rsi
addq $0x10, %rsi
callq 0x4540
jmp 0x16d96
jmp 0x16dbb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x43f0
jmp 0x16e45
leaq -0x198(%rbp), %rdi
callq 0x4980
movq %rax, -0x1d0(%rbp)
jmp 0x16dd0
movq -0x1d0(%rbp), %rax
cmpq $0x0, %rax
jne 0x16e14
leaq -0x188(%rbp), %rax
movq %rax, -0x1e0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x12ce0
movq %rax, -0x1d8(%rbp)
jmp 0x16dfd
movq -0x1d8(%rbp), %rsi
movq -0x1e0(%rbp), %rdi
callq 0x4100
jmp 0x16e12
jmp 0x16e14
movq -0x1b8(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x4530
jmp 0x16e29
leaq -0x198(%rbp), %rdi
callq 0x43f0
movq -0x1b0(%rbp), %rax
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbp
retq
movq -0x1a0(%rbp), %rdi
callq 0x4890
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: trapexit[P]bbf/src/errors.cpp
// Function: AppError::to_string[abi:cxx11]() const
std::string
AppError::to_string(void) const
{
  std::string rv;

  rv = "ERROR - ";
  rv += type_to_string(type);
  rv += ": ";
  rv += extra;
  rv += " [";
  rv += Error::to_string(error);
  rv += ']';

  return rv;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x50(%rbp)
movq %rdi, %rax
movq %rax, -0x60(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movb $0x0, -0x11(%rbp)
callq 0x46e0
movq -0x50(%rbp), %rdi
leaq 0xca29(%rip), %rsi      # 0x23960
callq 0x46d0
jmp 0x16f3e
movq -0x58(%rbp), %rax
movl (%rax), %esi
leaq -0x48(%rbp), %rdi
callq 0x17030
jmp 0x16f4f
movq -0x50(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x4680
jmp 0x16f5e
leaq -0x48(%rbp), %rdi
callq 0x4300
movq -0x50(%rbp), %rdi
leaq 0xc8c6(%rip), %rsi      # 0x23838
callq 0x4500
jmp 0x16f79
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
addq $0x8, %rsi
callq 0x4680
jmp 0x16f8c
movq -0x50(%rbp), %rdi
leaq 0xc2e4(%rip), %rsi      # 0x2327b
callq 0x4500
jmp 0x16f9e
movq -0x58(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x16e60
movq %rax, -0x68(%rbp)
jmp 0x16fb0
movq -0x68(%rbp), %rsi
movq -0x50(%rbp), %rdi
callq 0x4500
jmp 0x16fbf
movq -0x50(%rbp), %rdi
movl $0x5d, %esi
callq 0x4310
jmp 0x16fcf
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0x17009
jmp 0x17000
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x17013
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x4300
jmp 0x17013
movq -0x50(%rbp), %rdi
callq 0x4300
movq -0x60(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x4300
movq -0x20(%rbp), %rdi
callq 0x4890
nopw %cs:(%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x8(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x42b0
movq $-0x1, -0x28(%rbp)
movl -0x8(%rbp), %edi
movl $0xc020660b, %esi       # imm = 0xC020660B
leaq -0x30(%rbp), %rdx
movb $0x0, %al
callq 0x4710
movl %eax, -0xc(%rbp)
cmpl $-0x1, -0xc(%rbp)
jne 0x17ba8
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x17bae
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0xc(%rbp)
movl -0xc(%rbp), %edi
callq 0x17b60
movl %eax, -0x14(%rbp)
cmpl $-0x1, -0x14(%rbp)
jne 0x17be6
movq $0x0, -0x8(%rbp)
jmp 0x17c65
movslq -0x14(%rbp), %rax
imulq $0x38, %rax, %rax
movl %eax, -0x18(%rbp)
movslq -0x18(%rbp), %rsi
addq $0x20, %rsi
movl $0x1, %edi
callq 0x4360
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x17c18
movq $0x0, -0x8(%rbp)
jmp 0x17c65
movq -0x20(%rbp), %rax
movq $-0x1, 0x8(%rax)
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x18(%rax)
movl -0xc(%rbp), %edi
movq -0x20(%rbp), %rdx
movl $0xc020660b, %esi       # imm = 0xC020660B
movb $0x0, %al
callq 0x4710
movl %eax, -0x10(%rbp)
cmpl $-0x1, -0x10(%rbp)
jne 0x17c5d
movq -0x20(%rbp), %rdi
callq 0x4620
movq $0x0, -0x8(%rbp)
jmp 0x17c65
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: 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
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x46e0
movq -0x10(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x185f0
jmp 0x17c97
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x4640
leaq -0x60(%rbp), %rdi
callq 0x4300
leaq -0x40(%rbp), %rdi
callq 0x4840
testb $0x1, %al
jne 0x17cbc
jmp 0x17cea
movq $-0x2, -0x8(%rbp)
movl $0x1, -0x70(%rbp)
jmp 0x17d5d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x4300
jmp 0x17d73
leaq -0x40(%rbp), %rdi
callq 0x4210
movq %rax, %rdi
xorl %eax, %eax
movl $0x800, %esi            # imm = 0x800
callq 0x43d0
movl %eax, -0x74(%rbp)
jmp 0x17d07
movl -0x74(%rbp), %eax
movl %eax, -0x14(%rbp)
cmpl $-0x1, -0x14(%rbp)
jne 0x17d2e
callq 0x4070
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
cltq
movq %rax, -0x8(%rbp)
movl $0x1, -0x70(%rbp)
jmp 0x17d5d
movl -0x14(%rbp), %edi
callq 0x18f40
movl %eax, -0x78(%rbp)
jmp 0x17d3b
movl -0x78(%rbp), %eax
cltq
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %edi
callq 0x4960
jmp 0x17d4e
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0x70(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x4300
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x4890
nopl (%rax)
// File: 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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x17c70
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jge 0x17dad
movq -0x28(%rbp), %rax
movl %eax, -0x4(%rbp)
jmp 0x17dfd
movq -0x10(%rbp), %rdi
callq 0x4210
movq %rax, %rdi
xorl %esi, %esi
movb $0x0, %al
callq 0x43d0
movl %eax, -0x1c(%rbp)
cmpl $-0x1, -0x1c(%rbp)
jne 0x17ddc
callq 0x4070
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
movl %eax, -0x4(%rbp)
jmp 0x17dfd
movl -0x1c(%rbp), %edi
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x17e10
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %edi
callq 0x4960
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq 0x1e659(%rip), %rdi     # 0x36fb0
leaq 0xb142(%rip), %rsi      # 0x23aa0
callq 0x4540
movq %rax, %rdi
movl $0x1b, %esi
callq 0x4610
movq %rax, %rdi
movl $0x37, %esi
callq 0x4610
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rcx
movq %rcx, 0x18(%rax)
callq 0x221b0
movq -0x28(%rbp), %rax
movsd %xmm0, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
movl -0x8(%rbp), %edi
movl $0x1268, %esi           # imm = 0x1268
leaq -0x10(%rbp), %rdx
movb $0x0, %al
callq 0x4710
movl %eax, -0xc(%rbp)
cmpl $-0x1, -0xc(%rbp)
jne 0x18f78
callq 0x4070
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
movl %eax, -0x4(%rbp)
jmp 0x18f7e
movl -0x10(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
movl -0x8(%rbp), %edi
movl $0x80081270, %esi       # imm = 0x80081270
leaq -0x10(%rbp), %rdx
movb $0x0, %al
callq 0x4710
movl %eax, -0xc(%rbp)
cmpl $-0x1, -0xc(%rbp)
jne 0x18fc8
callq 0x4070
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
movl %eax, -0x4(%rbp)
jmp 0x18fce
movl -0x10(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0xc(%rbp)
movl -0xc(%rbp), %edi
movl $0x80081272, %esi       # imm = 0x80081272
leaq -0x18(%rbp), %rdx
movb $0x0, %al
callq 0x4710
movl %eax, -0x10(%rbp)
cmpl $-0x1, -0x10(%rbp)
je 0x19011
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1904d
movl -0xc(%rbp), %edi
movl $0x1260, %esi           # imm = 0x1260
leaq -0x20(%rbp), %rdx
movb $0x0, %al
callq 0x4710
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x1903b
movq -0x20(%rbp), %rax
shlq $0x9, %rax
movq %rax, -0x8(%rbp)
jmp 0x1904d
callq 0x4070
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
cltq
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0xc(%rbp)
movl -0xc(%rbp), %edi
callq 0x18f40
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jge 0x19086
movslq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x190b4
movl -0xc(%rbp), %edi
callq 0x18fe0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jge 0x190a3
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x190b4
movq -0x18(%rbp), %rax
movslq -0x10(%rbp), %rcx
cqto
idivq %rcx
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: 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
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0xc(%rbp)
movl -0xc(%rbp), %edi
callq 0x18f90
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jge 0x190e6
movslq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x19114
movl -0xc(%rbp), %edi
callq 0x18fe0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jge 0x19103
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x19114
movq -0x18(%rbp), %rax
movslq -0x10(%rbp), %rcx
cqto
idivq %rcx
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: 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
movq %rsp, %rbp
subq $0x1f0, %rsp            # imm = 0x1F0
movq %rdi, -0x1c8(%rbp)
movb %dl, %al
movq %rdi, %rcx
movq %rcx, -0x1c0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movl $0x0, -0x18(%rbp)
movb -0x11(%rbp), %dl
movl $0x400, %eax            # imm = 0x400
movl $0x3e8, %ecx            # imm = 0x3E8
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x1c(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x43a0
cmpq $0x0, -0x10(%rbp)
jne 0x19225
xorl %eax, %eax
movl %eax, -0x1cc(%rbp)
jmp 0x19247
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x19380
movl %eax, -0x1d0(%rbp)
jmp 0x19239
movl -0x1d0(%rbp), %eax
movl %eax, -0x1cc(%rbp)
jmp 0x19247
movl -0x1cc(%rbp), %eax
movl %eax, -0x18(%rbp)
movq -0x1a8(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x1a8(%rbp,%rax), %rdi
movl $0x2, %esi
callq 0x19400
jmp 0x1926f
leaq -0x198(%rbp), %rdi
leaq -0x4dd(%rip), %rsi      # 0x18da0
callq 0x41c0
movq %rax, -0x1d8(%rbp)
jmp 0x1928b
movaps 0xa7de(%rip), %xmm1     # 0x23a70
movq -0x10(%rbp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0xa7dd(%rip), %xmm1     # 0x23a80
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, -0x1e8(%rbp)
movl -0x1c(%rbp), %edi
movl -0x18(%rbp), %esi
callq 0x19430
movsd %xmm0, -0x1e0(%rbp)
jmp 0x192cf
movq -0x1d8(%rbp), %rdi
movsd -0x1e0(%rbp), %xmm1
movsd -0x1e8(%rbp), %xmm0
divsd %xmm1, %xmm0
callq 0x4910
movq %rax, -0x1f0(%rbp)
jmp 0x192f8
movq -0x1f0(%rbp), %rdi
movslq -0x18(%rbp), %rcx
shlq $0x4, %rcx
leaq 0x1e1e2(%rip), %rax     # 0x374f0
addq %rcx, %rax
movzbl -0x11(%rbp), %ecx
andl $0x1, %ecx
movq (%rax,%rcx,8), %rsi
callq 0x4540
jmp 0x19323
movq -0x1c8(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
callq 0x4530
jmp 0x19338
leaq -0x1a8(%rbp), %rdi
callq 0x43f0
movq -0x1c0(%rbp), %rax
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b0(%rbp)
movl %eax, -0x1b4(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x43f0
movq -0x1b0(%rbp), %rdi
callq 0x4890
nop
// File: 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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x38(%rbp)
movq %rdi, %rax
movq %rax, -0x30(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movb $0x0, -0xd(%rbp)
callq 0x46e0
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x1a818
callq 0x4130
movq -0x38(%rbp), %rdi
movl %eax, %edx
movslq %edx, %rax
imulq $0x4ec4ec4f, %rax, %rcx # imm = 0x4EC4EC4F
movq %rcx, %rax
shrq $0x3f, %rax
sarq $0x23, %rcx
addl %eax, %ecx
movl %ecx, %eax
leal (%rax,%rax,4), %esi
movl %esi, %eax
leal (%rax,%rax,4), %eax
addl %ecx, %eax
negl %eax
movl %eax, %ecx
movl %edx, %eax
leal 0x61(%rax,%rcx), %eax
movsbl %al, %esi
callq 0x4470
jmp 0x1a7f4
jmp 0x1a7f6
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1a7aa
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x4300
jmp 0x1a835
movb $0x1, -0xd(%rbp)
testb $0x1, -0xd(%rbp)
jne 0x1a82b
movq -0x38(%rbp), %rdi
callq 0x4300
movq -0x30(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x4890
nop
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0xf, %edx
callq 0x42b0
movb -0x9(%rbp), %cl
movq -0x8(%rbp), %rax
movb %cl, 0x1(%rax)
movq -0x8(%rbp), %rax
movb $-0x20, (%rax)
movq -0x18(%rbp), %rax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x7(%rax)
movq -0x18(%rbp), %rax
shrq $0x8, %rax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x8(%rax)
movq -0x18(%rbp), %rax
shrq $0x10, %rax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x9(%rax)
movl -0x1c(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x6(%rax)
movb -0x9(%rbp), %al
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movzbl %al, %edi
callq 0x20b60
testb $0x1, %al
jne 0x20aed
jmp 0x20b41
movq -0x8(%rbp), %rax
movb $0x1, 0x4(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0xa(%rax)
movl -0x1c(%rbp), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0xb(%rax)
movq -0x18(%rbp), %rax
shrq $0x18, %rax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0xc(%rax)
movq -0x18(%rbp), %rax
shrq $0x20, %rax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0xd(%rax)
movq -0x18(%rbp), %rax
shrq $0x28, %rax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0xe(%rax)
jmp 0x20b59
movq -0x18(%rbp), %rdx
shrq $0x18, %rdx
andq $0xf, %rdx
movq -0x8(%rbp), %rax
movzbl (%rax), %ecx
orq %rdx, %rcx
movb %cl, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nop
// File: trapexit[P]bbf/src/sg.cpp
// Function: sg::exec(int, int, int, sg::ata_tf const*, void*, unsigned int, unsigned int)
int
  exec(const int            fd,
       const int            rw,
       const int            dma,
       const struct ata_tf *tf,
       void                *data,
       const unsigned int   data_bytes,
       const unsigned int   timeout)
  {
    int rv;
    uint8_t cdb[SG_ATA_16_LEN] = {0};
    uint8_t sb[32]             = {0};
    sg_io_hdr_t io_hdr         = {0};

    if(data && data_bytes && !rw)
      memset(data,0,data_bytes);

    cdb[1]         = calculate_cdb1(dma,rw,data);
    cdb[2]         = calculate_cdb2(rw,data);
    io_hdr.cmd_len = populate_cdb_from_tf(cdb,tf);
    populate_io_hdr(&io_hdr,cdb,sb,tf,data,data_bytes,rw,timeout);

    return sg::exec_core(fd,io_hdr);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movl 0x10(%rbp), %eax
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x42b0
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x42b0
leaq -0xb8(%rbp), %rdi
xorl %esi, %esi
movl $0x58, %edx
callq 0x42b0
cmpq $0x0, -0x20(%rbp)
je 0x20cc9
cmpl $0x0, -0x24(%rbp)
je 0x20cc9
cmpl $0x0, -0x8(%rbp)
jne 0x20cc9
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %eax
movl %eax, %edx
xorl %esi, %esi
callq 0x42b0
movl -0xc(%rbp), %edi
movl -0x8(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0x20d50
movb %al, -0x3f(%rbp)
movl -0x8(%rbp), %edi
movq -0x20(%rbp), %rsi
callq 0x20dc0
movb %al, -0x3e(%rbp)
leaq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x20e00
movb %al, -0xb0(%rbp)
leaq -0x40(%rbp), %rsi
leaq -0x60(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
movl -0x24(%rbp), %r9d
movl -0x8(%rbp), %r10d
movl 0x10(%rbp), %eax
leaq -0xb8(%rbp), %rdi
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x20e50
movl -0x4(%rbp), %edi
leaq -0xb8(%rbp), %rsi
callq 0x20f20
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: trapexit[P]bbf/src/sg.cpp
// Function: sg::identify(int, sg::identity&)
int
  identify(const int     fd,
           sg::identity &ident)
  {
    int rv;
    int timeout;
    char buf[512];
    int buflen = sizeof(buf);
    struct ata_tf tf;

    tf_init(&tf,ATA_OP_IDENTIFY,0,1);

    timeout = 60000;
    rv = exec(fd,SG_READ,SG_PIO,&tf,buf,buflen,timeout);
    if(rv == 0)
      buf_to_identity(buf,ident);

    return rv;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x240, %rsp            # imm = 0x240
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x200, -0x224(%rbp)    # imm = 0x200
leaq -0x233(%rbp), %rdi
movl $0xec, %esi
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %ecx
callq 0x20a60
movl $0xea60, -0x18(%rbp)    # imm = 0xEA60
movl -0x4(%rbp), %edi
leaq -0x220(%rbp), %r8
movl -0x224(%rbp), %r9d
movl -0x18(%rbp), %eax
xorl %edx, %edx
leaq -0x233(%rbp), %rcx
movl %edx, %esi
movl %eax, (%rsp)
callq 0x20c50
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x2181d
leaq -0x220(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x21040
movl -0x14(%rbp), %eax
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
nopl (%rax)