LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/communication/ClientSocket.cpp
// Function: communication::ClientSocket::ReceiveReply(communication::SockMessage&)
SockError ClientSocket::ReceiveReply(SockMessage& msg) {
	SockError err = eNone;
	int valread;
	char buffer[BUFLEN];
	int bytes_read = 0;
	while(1) {
		valread = recv( sockfd, buffer, BUFLEN, 0);
    		if (valread <= 0){
			err = eOther;
			return err;
		}
		bytes_read += valread;
		string compare(buffer);
		//cout  << "Reply : " << buffer << " Bytes read = " << compare.find("cmEOF") << endl;
		string::size_type n = compare.find("cmEOF");
		if (n != string::npos){
			break;
		}
	}
	return err;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1028, %rsp           # imm = 0x1028
movq %rdi, %r14
leaq -0x1050(%rbp), %r15
leaq -0x50(%rbp), %r12
leaq 0x9b31(%rip), %rbx      # 0x11576
movl (%r14), %edi
movl $0x1000, %edx           # imm = 0x1000
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x5170
testl %eax, %eax
jle 0x7a8c
movq %r12, %rdi
movq %r15, %rsi
leaq -0x29(%rbp), %rdx
callq 0x51c0
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x5880
movq %rax, %r13
movq %r12, %rdi
callq 0x58a8
cmpq $-0x1, %r13
je 0x7a45
pushq $0x3
jmp 0x7a8e
pushq $0x2
popq %rax
addq $0x1028, %rsp           # imm = 0x1028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/tests/BaseTestCase.cpp
// Function: tests::BaseTestCase::Run(int, int)
int BaseTestCase::Run(const int change_fd, const int checkpoint) {
  DefaultFsFns default_fns;
  RecordCmFsOps cm(&default_fns);
  PassthroughCmFsOps pcm(&default_fns);
  if (checkpoint == 0) {
    cm_ = &cm;
  } else {
    cm_ = &pcm;
  }

  int res_1 = run(checkpoint);
  if (res_1 < 0) {
    return res_1;
  }

  if (checkpoint == 0) {
    int res_2 = cm.Serialize(change_fd);
    if (res_2 < 0) {
      return res_2;
    }
  }
  return res_1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movl %edx, %r14d
movl %esi, -0x2c(%rbp)
movq %rdi, %r15
leaq 0x11e02(%rip), %rax     # 0x19a28
addq $0x10, %rax
leaq -0x38(%rbp), %rbx
movq %rax, (%rbx)
leaq -0xe0(%rbp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x9170
leaq -0x48(%rbp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0xa732
testl %r14d, %r14d
cmoveq %r12, %r13
movq %r13, 0x30(%r15)
movq (%r15), %rax
movq %r15, %rdi
movl %r14d, %esi
callq *0x18(%rax)
movl %eax, %r15d
testl %eax, %eax
js 0x7c8b
testl %r14d, %r14d
jne 0x7c8b
leaq -0xe0(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0xa66a
testl %eax, %eax
jns 0x7c8b
movl %eax, %r15d
leaq -0xe0(%rbp), %rdi
callq 0x7cc8
movl %r15d, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7cb0
jmp 0x7cb0
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
callq 0x7cc8
movq %rbx, %rdi
callq 0x5780
nop
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/results/DataTestResult.cpp
// Function: tests::DataTestResult::PrintErrors(std::ostream&) const
ostream& DataTestResult::PrintErrors(ostream& os) const {
  unsigned int noted_errors = error_summary_;
  unsigned int shift = 0;
  while (noted_errors != 0) {
    if (noted_errors & 1) {
      os << (DataTestResult::ErrorType) (1 << shift);
    }
    ++shift;
    noted_errors >>= 1;
  }

  return os;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movl 0x20(%rdi), %r15d
xorl %r14d, %r14d
pushq $0x1
popq %r12
testl %r15d, %r15d
je 0x804c
testb $0x1, %r15b
je 0x8044
movl %r12d, %esi
movl %r14d, %ecx
shll %cl, %esi
movq %rbx, %rdi
callq 0x8058
incl %r14d
shrl %r15d
jmp 0x8029
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/results/DataTestResult.cpp
// Function: tests::operator<<(std::ostream&, tests::DataTestResult::ErrorType)
ostream& operator<<(ostream& os, DataTestResult::ErrorType err) {
  switch (err) {
    case DataTestResult::kClean:
      break;
    case DataTestResult::kOldFilePersisted:
      os << "old_file_persisted";
      break;
    case DataTestResult::kFileMissing:
      os << "file_missing";
      break;
    case DataTestResult::kFileDataCorrupted:
      os << "file_data_corrupted";
      break;
    case DataTestResult::kFileMetadataCorrupted:
      os << "file_metadata_corrupted";
      break;
    case DataTestResult::kIncorrectBlockCount:
      os << "incorrect_block_count";
      break;      
    case DataTestResult::kOther:
      os << "other_error";
      break;
    case DataTestResult::kAutoCheckFailed:
      os << "auto_check_test_failed";
      break;
    default:
      os.setstate(std::ios_base::failbit);
  }
  return os;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x8, %esi
ja 0x8081
movl %esi, %eax
leaq 0x95f1(%rip), %rcx      # 0x11660
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x9605(%rip), %rsi      # 0x11684
jmp 0x80d8
cmpl $0x10, %esi
je 0x80d1
cmpl $0x20, %esi
je 0x80c8
cmpl $0x40, %esi
jne 0x8099
leaq 0x965b(%rip), %rsi      # 0x116f2
jmp 0x80d8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
pushq $0x4
popq %rsi
callq 0x5300
jmp 0x80e0
leaq 0x95f0(%rip), %rsi      # 0x116a4
jmp 0x80d8
leaq 0x95fb(%rip), %rsi      # 0x116b8
jmp 0x80d8
leaq 0x95d1(%rip), %rsi      # 0x11697
jmp 0x80d8
leaq 0x9617(%rip), %rsi      # 0x116e6
jmp 0x80d8
leaq 0x95f8(%rip), %rsi      # 0x116d0
movq %rbx, %rdi
callq 0x5480
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/results/FileSystemTestResult.cpp
// Function: FileSystemTestResult::PrintErrors(std::ostream&) const
void FileSystemTestResult::PrintErrors(ostream& os) const {
  if (error_summary_ == 0) {
    os << FileSystemTestResult::kCheckNotRun;
    return;
  }

  unsigned int noted_errors = error_summary_;
  unsigned int shift = 0;
  while (noted_errors != 0) {
    if (noted_errors & 1) {
      os << (FileSystemTestResult::ErrorType) (1 << shift) << " ";
    }
    ++shift;
    noted_errors >>= 1;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl 0x44(%rdi), %r12d
testl %r12d, %r12d
je 0x819b
xorl %r14d, %r14d
pushq $0x1
popq %r13
leaq 0xa506(%rip), %r15      # 0x12664
testl %r12d, %r12d
je 0x818c
testb $0x1, %r12b
je 0x8184
movl %r13d, %esi
movl %r14d, %ecx
shll %cl, %esi
movq %rbx, %rdi
callq 0x81b8
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5480
incl %r14d
shrl %r12d
jmp 0x815e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x958e(%rip), %rsi      # 0x11730
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5480
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/results/FileSystemTestResult.cpp
// Function: operator<<(std::ostream&, FileSystemTestResult::ErrorType)
ostream& operator<<(ostream& os, FileSystemTestResult::ErrorType err) {
  switch (err) {
    case FileSystemTestResult::kCheckNotRun:
      os << "fsck_not_run";
      break;
    case FileSystemTestResult::kClean:
      os << "fsck_no_errors";
      break;
    case FileSystemTestResult::kUnmountable:
      os << "unmountable_file_system";
      break;
    case FileSystemTestResult::kCheck:
      os << "fsck_error";
      break;
    case FileSystemTestResult::kFixed:
      os << "file_system_fixed";
      break;
    case FileSystemTestResult::kSnapshotRestore:
      os << "restoring_snapshot";
      break;
    case FileSystemTestResult::kBioWrite:
      os << "writing_crash_state";
      break;
    case FileSystemTestResult::kOther:
      os << "other_error";
      break;
    case FileSystemTestResult::kKernelMount:
      os << "kernel_mount";
      break;
    case FileSystemTestResult::kCheckUnfixed:
      os << "unfixed_fsck_errors";
      break;
    default:
      os.setstate(std::ios_base::failbit);
  }
  return os;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x8, %esi
jbe 0x81f2
cmpl $0x10, %esi
je 0x8260
cmpl $0x20, %esi
je 0x8245
cmpl $0x40, %esi
je 0x8257
cmpl $0x80, %esi
je 0x824e
cmpl $0x100, %esi            # imm = 0x100
jne 0x820d
leaq 0x95c5(%rip), %rsi      # 0x117b5
jmp 0x8267
movl %esi, %eax
leaq 0x9511(%rip), %rcx      # 0x1170c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x9525(%rip), %rsi      # 0x11730
jmp 0x8267
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
pushq $0x4
popq %rsi
callq 0x5300
jmp 0x826f
leaq 0x953c(%rip), %rsi      # 0x11764
jmp 0x8267
leaq 0x950c(%rip), %rsi      # 0x1173d
jmp 0x8267
leaq 0x9535(%rip), %rsi      # 0x1176f
jmp 0x8267
leaq 0x9509(%rip), %rsi      # 0x1174c
jmp 0x8267
leaq 0x9548(%rip), %rsi      # 0x11794
jmp 0x8267
leaq 0x9553(%rip), %rsi      # 0x117a8
jmp 0x8267
leaq 0x9488(%rip), %rsi      # 0x116e6
jmp 0x8267
leaq 0x951a(%rip), %rsi      # 0x11781
movq %rbx, %rdi
callq 0x5480
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/results/SingleTestInfo.cpp
// Function: SingleTestInfo::GetTestResult() const
SingleTestInfo::ResultType SingleTestInfo::GetTestResult() const {
  if ((fs_test.GetError() == FileSystemTestResult::kClean ||
        fs_test.GetError() == FileSystemTestResult::kCheckNotRun)
      && data_test.GetError() == DataTestResult::kClean) {
    return SingleTestInfo::kPassed;
  } else if (fs_test.GetError() == FileSystemTestResult::kFixed
      && data_test.GetError() == DataTestResult::kClean) {
    return SingleTestInfo::kFsckFixed;
  } else if (fs_test.GetError() == FileSystemTestResult::kKernelMount) {
    return SingleTestInfo::kFsckRequired;
  }
  return SingleTestInfo::kFailed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0x30(%rdi), %rbx
movq %rbx, %rdi
callq 0x812c
cmpl $0x1, %eax
je 0x8303
movq %rbx, %rdi
callq 0x812c
testl %eax, %eax
jne 0x8310
leaq 0x8(%r14), %rdi
callq 0x8006
testl %eax, %eax
je 0x8347
movq %rbx, %rdi
callq 0x812c
cmpl $0x4, %eax
jne 0x832d
addq $0x8, %r14
movq %r14, %rdi
callq 0x8006
testl %eax, %eax
je 0x834b
movq %rbx, %rdi
callq 0x812c
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x80, %ecx
sete %al
xorl $0x3, %eax
jmp 0x834e
xorl %eax, %eax
jmp 0x834e
pushq $0x1
popq %rax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/results/SingleTestInfo.cpp
// Function: SingleTestInfo::PrintResults(std::ostream&) const
void SingleTestInfo::PrintResults(ostream& os) const {
  os << "Test #" << test_num << ": " << GetTestResult() << ": ";
  data_test.PrintErrors(os);
  if (GetTestResult() == SingleTestInfo::kFailed &&
      fs_test.GetError() == FileSystemTestResult::kCheck) {
    os << fs_test.error_description << endl;
  } else {
    os << data_test.error_description << endl;
  }
  os << "\tfsck result: ";
  fs_test.PrintErrors(os);
  os << endl;
  os << "\tfsck output:" << endl << fs_test.fsck_result << endl << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x9470(%rip), %rsi      # 0x117dc
movq %r14, %rdi
callq 0x5480
movl (%rbx), %esi
movq %rax, %rdi
callq 0x5320
leaq 0xa25a(%rip), %r15      # 0x125df
movq %rax, %rdi
movq %r15, %rsi
callq 0x5480
movq %rax, %r12
movq %rbx, %rdi
callq 0x82dc
movq %r12, %rdi
movl %eax, %esi
callq 0x8454
movq %r12, %rdi
movq %r15, %rsi
callq 0x5480
leaq 0x8(%rbx), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x8010
movq %rbx, %rdi
callq 0x82dc
cmpl $0x3, %eax
jne 0x83dd
leaq 0x30(%rbx), %r12
movq %r12, %rdi
callq 0x812c
cmpl $0x8, %eax
je 0x83e0
movq %r15, %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x5410
movq %rax, %rdi
callq 0x5240
leaq 0x93e9(%rip), %rsi      # 0x117e3
movq %r14, %rdi
callq 0x5480
leaq 0x30(%rbx), %rdi
movq %r14, %rsi
callq 0x8136
movq %r14, %rdi
callq 0x5240
leaq 0x93d5(%rip), %rsi      # 0x117f2
movq %r14, %rdi
callq 0x5480
movq %rax, %rdi
callq 0x5240
addq $0x50, %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x5410
movq %rax, %rdi
callq 0x5240
movq %rax, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x5240
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/results/SingleTestInfo.cpp
// Function: operator<<(std::ostream&, SingleTestInfo::ResultType)
ostream& operator<<(ostream& os, SingleTestInfo::ResultType rt) {
  switch (rt) {
    case SingleTestInfo::kPassed:
      os << "PASSED";
      break;
    case SingleTestInfo::kFsckFixed:
      os << "FSCK_FIXED";
      break;
    case SingleTestInfo::kFsckRequired:
      os << "FSCK_REQUIRED";
      break;
    case SingleTestInfo::kFailed:
      os << "FAILED";
      break;
    default:
      os.setstate(std::ios_base::failbit);
  }
  return os;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x3, %esi
ja 0x84a8
movl %esi, %eax
leaq 0x9361(%rip), %rcx      # 0x117cc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x9385(%rip), %rsi      # 0x11800
jmp 0x8496
leaq 0x938e(%rip), %rsi      # 0x11812
jmp 0x8496
leaq 0x9393(%rip), %rsi      # 0x11820
jmp 0x8496
leaq 0x9371(%rip), %rsi      # 0x11807
movq %rbx, %rdi
callq 0x5480
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
pushq $0x4
popq %rsi
callq 0x5300
jmp 0x849e
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/results/TestSuiteResult.cpp
// Function: TestSuiteResult::TallyResult(SingleTestInfo&, ResultSet&)
void TestSuiteResult::TallyResult(SingleTestInfo &done, ResultSet &set) {
  switch (done.GetTestResult()) {
    case SingleTestInfo::kPassed:
      ++set.num_passed;
      break;
    case SingleTestInfo::kFsckFixed:
      ++set.num_passed_fixed;
      break;
    case SingleTestInfo::kFsckRequired:
      ++set.fsck_required;
      break;
    case SingleTestInfo::kFailed:
      ++set.num_failed;

      switch (done.data_test.GetError()) {
        case DataTestResult::kOldFilePersisted:
          ++set.old_file_persisted;
          break;
        case DataTestResult::kFileMissing:
          ++set.file_missing;
          break;
        case DataTestResult::kFileDataCorrupted:
          ++set.file_data_corrupted;
          break;
        case DataTestResult::kFileMetadataCorrupted:
          ++set.file_metadata_corrupted;
          break;
        case DataTestResult::kIncorrectBlockCount:
          ++set.incorrect_block_count;
          break;    
        case DataTestResult::kOther:
          ++set.other;
          break;
        case DataTestResult::kAutoCheckFailed:
          ++set.auto_check_failed;
          break;
      }
      break;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rsi, %rdi
callq 0x82dc
cmpl $0x3, %eax
ja 0x8540
movl %eax, %eax
leaq 0x9329(%rip), %rcx      # 0x11828
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
pushq $0x8
jmp 0x853c
pushq $0x10
jmp 0x853c
incl (%rbx)
addq $0x8, %r14
movq %r14, %rdi
callq 0x8006
leal -0x1(%rax), %ecx
cmpl $0x7, %ecx
ja 0x8545
leaq 0x930b(%rip), %rax      # 0x11838
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
pushq $0x14
jmp 0x853c
pushq $0x4
popq %rax
incl (%rbx,%rax)
popq %rbx
popq %r14
popq %rbp
retq
cmpl $0x10, %eax
je 0x8568
cmpl $0x20, %eax
je 0x8564
cmpl $0x40, %eax
jne 0x8540
pushq $0x2c
jmp 0x853c
pushq $0x18
jmp 0x853c
pushq $0x20
jmp 0x853c
pushq $0x1c
jmp 0x853c
pushq $0x28
jmp 0x853c
pushq $0x24
jmp 0x853c
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/wrapper/DiskMod.cpp
// Function: wrapper::DiskMod::SerializeHeader(char*, unsigned int, wrapper::DiskMod&)
int DiskMod::SerializeHeader(char *buf, const unsigned int buf_offset,
    DiskMod &dm) {
  buf = buf + buf_offset;
  uint16_t mod_type = htobe16((uint16_t) dm.mod_type);
  uint16_t mod_opts = htobe16((uint16_t) dm.mod_opts);
  memcpy(buf, &mod_type, sizeof(uint16_t));
  buf += sizeof(uint16_t);
  memcpy(buf, &mod_opts, sizeof(uint16_t));

  return 2 * sizeof(uint16_t);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %esi, %eax
movzwl 0x20(%rdx), %ecx
movzwl 0x24(%rdx), %edx
rolw $0x8, %cx
rolw $0x8, %dx
movw %cx, (%rdi,%rax)
movw %dx, 0x2(%rdi,%rax)
movl $0x4, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/wrapper/DiskMod.cpp
// Function: wrapper::DiskMod::SerializeChangeHeader(char*, unsigned int, wrapper::DiskMod&)
int DiskMod::SerializeChangeHeader(char *buf,
    const unsigned int buf_offset, DiskMod &dm) {
  buf += buf_offset;
  unsigned int size = dm.path.size() + 1;
  // Add the path that was changed to the buffer.
  // size() doesn't include null-terminator.
  // TODO(ashmrtn): The below assumes 1 character per byte encoding.
  memcpy(buf, dm.path.c_str(), size);
  buf += size;

  // Add directory_mod to buffer.
  uint8_t mod_directory_mod = dm.directory_mod;
  memcpy(buf, &mod_directory_mod, sizeof(uint8_t));

  return size + sizeof(uint8_t);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movl %esi, %eax
addq %rax, %r14
movl 0x8(%rdx), %r15d
leal 0x1(%r15), %r12d
movq (%rdx), %rsi
movq %r14, %rdi
movq %r12, %rdx
callq 0x53c0
movb 0xb8(%rbx), %al
movb %al, (%r12,%r14)
addl $0x2, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/wrapper/DiskMod.cpp
// Function: wrapper::DiskMod::SerializeDataRange(char*, unsigned int, wrapper::DiskMod&)
int DiskMod::SerializeDataRange(char *buf, const unsigned int buf_offset,
    DiskMod &dm) {
  buf += buf_offset;
  // Add file_mod_location.
  uint64_t file_mod_location = htobe64(dm.file_mod_location);
  memcpy(buf, &file_mod_location, sizeof(uint64_t));
  buf += sizeof(uint64_t);

  // Add file_mod_len.
  uint64_t file_mod_len = htobe64(dm.file_mod_len);
  memcpy(buf, &file_mod_len, sizeof(uint64_t));
  buf += sizeof(uint64_t);

  if (dm.mod_type == DiskMod::kSyncFileRangeMod ||
      dm.mod_opts == DiskMod::kFallocateOpt ||
      dm.mod_opts == DiskMod::kFallocateKeepSizeOpt ||
      dm.mod_opts == DiskMod::kPunchHoleKeepSizeOpt ||
      dm.mod_opts == DiskMod::kCollapseRangeOpt ||
      dm.mod_opts == DiskMod::kZeroRangeOpt ||
      dm.mod_opts == DiskMod::kZeroRangeKeepSizeOpt ||
      dm.mod_opts == DiskMod::kInsertRangeOpt) {
    // kSyncFileRangeMod does not contain the data range, just the offset and
    // length.
    return 2 * sizeof(uint64_t);
  }

  // Add file_mod_data (non-null terminated).
  memcpy(buf, dm.file_mod_data.get(), dm.file_mod_len);

  return (2 * sizeof(uint64_t)) + dm.file_mod_len;
}

// Assembly:
movl %esi, %ecx
movq 0xd0(%rdx), %rax
bswapq %rax
movq %rax, (%rdi,%rcx)
movq 0xd8(%rdx), %rax
bswapq %rax
movq %rax, 0x8(%rdi,%rcx)
pushq $0x10
popq %rax
cmpl $0x9, 0x20(%rdx)
je 0x8b8f
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl 0x24(%rdx), %edx
addl $-0x2, %edx
cmpl $0x7, %edx
jb 0x8b89
addq %rcx, %rdi
addq $0x10, %rdi
movq 0xc0(%rbx), %rsi
movq 0xd8(%rbx), %rdx
callq 0x53c0
movl 0xd8(%rbx), %eax
addl $0x10, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/wrapper/DiskMod.cpp
// Function: wrapper::DiskMod::Reset()
void DiskMod::Reset() {
  path.clear();
  mod_type = kCreateMod;
  mod_opts = kNoneOpt;
  memset(&post_mod_stats, 0, sizeof(struct stat));
  directory_mod = false;
  file_mod_data.reset();
  file_mod_location = 0;
  file_mod_len = 0;
  directory_added_entry.clear();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
andq $0x0, 0x8(%rdi)
movq (%rdi), %rax
xorl %r15d, %r15d
movb %r15b, (%rax)
addq $0x20, %rdi
leaq 0xc0(%rbx), %r14
movl $0x99, %edx
xorl %esi, %esi
callq 0x52b0
movq %r14, %rdi
callq 0x8f9c
andq $0x0, 0xe8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0xd0(%rbx)
movq 0xe0(%rbx), %rax
movb %r15b, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/wrapper/wrapper.cpp
// Function: wrapper::DefaultFsFns::FnPathExists(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool DefaultFsFns::FnPathExists(const std::string &pathname) {
  const int res = access(pathname.c_str(), F_OK);
  // TODO(ashmrtn): Should probably have some better way to handle errors.
  if (res != 0) {
    return false;
  }

  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rsi), %rdi
xorl %esi, %esi
callq 0x5730
testl %eax, %eax
sete %al
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/wrapper/wrapper.cpp
// Function: wrapper::RecordCmFsOps::CmMkdir(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int)
int RecordCmFsOps::CmMkdir(const string &pathname, const mode_t mode) {
  const int res = fns_->FnMkdir(pathname.c_str(), mode);
  if (res < 0) {
    return res;
  }

  DiskMod mod;
  mod.directory_mod = true;
  mod.path = pathname;
  mod.mod_type = DiskMod::kCreateMod;
  mod.mod_opts = DiskMod::kNoneOpt;

  mods_.push_back(mod);

  return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
movq 0x90(%rdi), %r12
movq (%rsi), %rsi
leaq -0x128(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x51c0
movq (%r12), %rax
leaq -0x128(%rbp), %rsi
movq %r12, %rdi
movl %r14d, %edx
callq *0x18(%rax)
movl %eax, %r14d
leaq -0x128(%rbp), %rdi
callq 0x58a8
testl %r14d, %r14d
js 0x92ec
leaq -0x128(%rbp), %r12
movq %r12, %rdi
callq 0x8e2e
movb $0x1, 0xb8(%r12)
movq %r12, %rdi
movq %r15, %rsi
callq 0x52a0
leaq -0x128(%rbp), %rsi
andq $0x0, 0x20(%rsi)
addq $0x78, %rbx
movq %rbx, %rdi
callq 0xac5a
leaq -0x128(%rbp), %rdi
callq 0x7d8e
movl %r14d, %eax
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x128(%rbp), %rdi
callq 0x58a8
jmp 0x9324
movq %rax, %rbx
jmp 0x9324
movq %rax, %rbx
leaq -0x128(%rbp), %rdi
callq 0x7d8e
movq %rbx, %rdi
callq 0x5780
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/wrapper/wrapper.cpp
// Function: wrapper::RecordCmFsOps::CmOpenCommon(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, int)
void RecordCmFsOps::CmOpenCommon(const int fd, const string &pathname,
    const bool exists, const int flags) {
  fd_map_.insert({fd, pathname});

  if (!exists || (flags & O_TRUNC)) {
    // We only want to record this op if we changed something on the file
    // system.

    DiskMod mod;

    // Need something like stat() because umask could affect the file
    // permissions.
    const int post_stat_res = fns_->FnStat(pathname.c_str(),
        &mod.post_mod_stats);
    if (post_stat_res < 0) {
      // TODO(ashmrtn): Some sort of warning here?
      return;
    }

    mod.directory_mod = S_ISDIR(mod.post_mod_stats.st_mode);

    if (!exists) {
      mod.mod_type = DiskMod::kCreateMod;
      mod.mod_opts = DiskMod::kNoneOpt;
    } else {
      mod.mod_type = DiskMod::kDataMetadataMod;
      mod.mod_opts = DiskMod::kTruncateOpt;
    }

    mod.path = pathname;

    mods_.push_back(mod);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movl %r8d, %r12d
movl %ecx, %r14d
movq %rdi, %rbx
leaq 0x8(%rdi), %r15
leaq -0x150(%rbp), %r13
movl %esi, -0x8(%r13)
movq %r13, %rdi
movq %rdx, -0x38(%rbp)
movq %rdx, %rsi
callq 0x5580
leaq -0x158(%rbp), %rsi
movq %r15, %rdi
callq 0xb070
movq %r13, %rdi
callq 0x58a8
btl $0x9, %r12d
setae %al
testb %r14b, %al
jne 0x942b
leaq -0x158(%rbp), %rdi
callq 0x8e2e
movq 0x90(%rbx), %r12
movq -0x38(%rbp), %r15
movq (%r15), %rsi
leaq -0x58(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x51c0
leaq -0x130(%rbp), %rdx
movq (%r12), %rax
leaq -0x58(%rbp), %rsi
movq %r12, %rdi
callq *0x88(%rax)
movl %eax, %r12d
leaq -0x58(%rbp), %rdi
callq 0x58a8
testl %r12d, %r12d
js 0x941f
movl $0xf000, %eax           # imm = 0xF000
leaq -0x158(%rbp), %rdi
andl 0x40(%rdi), %eax
cmpl $0x4000, %eax           # imm = 0x4000
sete 0xb8(%rdi)
movzbl %r14b, %eax
movl %eax, 0x20(%rdi)
movl %eax, 0x24(%rdi)
movq %r15, %rsi
callq 0x52a0
addq $0x78, %rbx
leaq -0x158(%rbp), %rsi
movq %rbx, %rdi
callq 0xac5a
leaq -0x158(%rbp), %rdi
callq 0x7d8e
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x58a8
jmp 0x9450
jmp 0x944d
movq %rax, %rbx
leaq -0x158(%rbp), %rdi
callq 0x7d8e
jmp 0x9469
movq %rax, %rbx
movq %r13, %rdi
callq 0x58a8
movq %rbx, %rdi
callq 0x5780
nop
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/wrapper/wrapper.cpp
// Function: wrapper::RecordCmFsOps::CmOpen(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)
int RecordCmFsOps::CmOpen(const string &pathname, const int flags) {
  // Will this make a new file or is this path a directory?
  const bool exists = fns_->FnPathExists(pathname.c_str());

  const int res = fns_->FnOpen(pathname.c_str(), flags);
  if (res < 0) {
    return res;
  }

  CmOpenCommon(res, pathname, exists, flags);

  return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movq 0x90(%rdi), %r12
movq (%rsi), %rsi
leaq -0x50(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x51c0
movq (%r12), %rax
leaq -0x50(%rbp), %rsi
movq %r12, %rdi
callq *0x90(%rax)
movl %eax, %r12d
leaq -0x50(%rbp), %rdi
callq 0x58a8
movq 0x90(%r15), %r13
movq (%r14), %rsi
leaq -0x50(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x51c0
movq (%r13), %rax
leaq -0x50(%rbp), %rsi
movq %r13, %rdi
movl %ebx, %edx
callq *0x20(%rax)
movl %eax, %r13d
leaq -0x50(%rbp), %rdi
callq 0x58a8
testl %r13d, %r13d
js 0x950c
movzbl %r12b, %ecx
movq %r15, %rdi
movl %r13d, %esi
movq %r14, %rdx
movl %ebx, %r8d
callq 0x932c
movl %r13d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9522
jmp 0x9530
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x58a8
jmp 0x9533
movq %rax, %rbx
movq %rbx, %rdi
callq 0x5780
nop
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/wrapper/wrapper.cpp
// Function: wrapper::RecordCmFsOps::CmOpen(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, unsigned int)
int RecordCmFsOps::CmOpen(const string &pathname, const int flags,
    const mode_t mode) {
  // Will this make a new file or is this path a directory?
  const bool exists = fns_->FnPathExists(pathname.c_str());

  const int res = fns_->FnOpen2(pathname.c_str(), flags, mode);
  if (res < 0) {
    return res;
  }

  CmOpenCommon(res, pathname, exists, flags);

  return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %r12d
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movq 0x90(%rdi), %r13
movq (%rsi), %rsi
leaq -0x50(%rbp), %rdi
leaq -0x2a(%rbp), %rdx
callq 0x51c0
movq (%r13), %rax
leaq -0x50(%rbp), %rsi
movq %r13, %rdi
callq *0x90(%rax)
movb %al, -0x29(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x58a8
movq 0x90(%r15), %r13
movq (%r14), %rsi
leaq -0x50(%rbp), %rdi
leaq -0x2a(%rbp), %rdx
callq 0x51c0
movq (%r13), %rax
leaq -0x50(%rbp), %rsi
movq %r13, %rdi
movl %ebx, %edx
movl %r12d, %ecx
callq *0x28(%rax)
movl %eax, %r12d
leaq -0x50(%rbp), %rdi
callq 0x58a8
testl %r12d, %r12d
js 0x95dc
movzbl -0x29(%rbp), %ecx
movq %r15, %rdi
movl %r12d, %esi
movq %r14, %rdx
movl %ebx, %r8d
callq 0x932c
movl %r12d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x95f2
jmp 0x9600
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x58a8
jmp 0x9603
movq %rax, %rbx
movq %rbx, %rdi
callq 0x5780
nop
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/wrapper/wrapper.cpp
// Function: wrapper::RecordCmFsOps::CmMmap(void*, unsigned long, int, int, int, long)
void * RecordCmFsOps::CmMmap(void *addr, const size_t length, const int prot,
    const int flags, const int fd, const off_t offset) {
  void *res = fns_->FnMmap(addr, length, prot, flags, fd, offset);
  if (res == (void*) -1) {
    return res;
  }

  if (!(prot & PROT_WRITE) || flags & MAP_PRIVATE || flags & MAP_ANON ||
      flags & MAP_ANONYMOUS) {
    // In these cases, the user cannot write to the mmap-ed region, the region
    // is not backed by a file, or the changes the user makes are not reflected
    // in the file, so we can just act like this never happened.
    return res;
  }

  // All other cases we actually need to keep track of the fact that we mmap-ed
  // this region.
  mmap_map_.insert({(long long) res,
      tuple<string, unsigned int, unsigned int>(
          fd_map_.at(fd), offset, length)});
  return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %r8d, %r12d
movl %ecx, %r13d
movq %rdx, %r14
movq %rdi, %r15
movq 0x10(%rbp), %rcx
movl %r9d, -0x2c(%rbp)
movq 0x90(%rdi), %rdi
movq (%rdi), %rax
movq %rcx, (%rsp)
movl %r13d, %ecx
callq *0x48(%rax)
movq %rax, %rbx
cmpq $-0x1, %rax
je 0x9b6d
testb $0x2, %r13b
sete %al
testb $0x22, %r12b
setne %cl
orb %al, %cl
jne 0x9b6d
leaq 0x40(%r15), %r12
addq $0x8, %r15
leaq -0x2c(%rbp), %rsi
movq %r15, %rdi
callq 0xb44e
leaq -0x88(%rbp), %r15
movl %r14d, -0x8(%r15)
movq 0x10(%rbp), %rcx
movl %ecx, -0x4(%r15)
movq %r15, %rdi
movq %rax, %rsi
callq 0x5580
leaq -0x60(%rbp), %rdi
movq %rbx, -0x8(%rdi)
leaq -0x90(%rbp), %rsi
callq 0xacec
leaq -0x68(%rbp), %rsi
movq %r12, %rdi
callq 0xb490
leaq -0x50(%rbp), %rdi
callq 0x58a8
movq %r15, %rdi
callq 0x58a8
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x58a8
movq %r15, %rdi
callq 0x58a8
movq %rbx, %rdi
callq 0x5780
nop
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/wrapper/wrapper.cpp
// Function: wrapper::RecordCmFsOps::CmMunmap(void*, unsigned long)
int RecordCmFsOps::CmMunmap(void *addr, const size_t length) {
  const int res = fns_->FnMunmap(addr, length);
  if (res < 0) {
    return res;
  }

  // TODO(ashmrtn): Assume that we always munmap with the same pointer and
  // length that we mmap-ed with. May not actually remove anything if the
  // mapping was not something that caused writes to be reflected in the
  // underlying file (i.e. the key wasn't present to begin with).
  mmap_map_.erase((long long int) addr);

  return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x90(%rdi), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
movl %eax, %r15d
testl %eax, %eax
js 0x9db3
addq $0x40, %rbx
leaq -0x20(%rbp), %rsi
movq %r14, (%rsi)
movq %rbx, %rdi
callq 0xb84e
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/wrapper/wrapper.cpp
// Function: wrapper::RecordCmFsOps::CmRename(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
int RecordCmFsOps::CmRename(const string &old_path, const string &new_path) {
  // check if there are any open files with the old path
  // change the file descriptors to point to the new path
  for (auto it = fd_map_.begin(); it != fd_map_.end(); it++) {
    string& open_fd_old_path = it->second;
    if (open_fd_old_path.compare(old_path) == 0) {
      fd_map_[it->first] = new_path;
      continue;
    }
    // if we are renaming a directory that is open; we want to
    // change the mapping of the open files in that directory
    auto found = open_fd_old_path.find(old_path);
    if ( found != std::string::npos) {
      fd_map_[it->first].replace(found, old_path.length(), new_path);
    }
  }
  return fns_->FnRename(old_path, new_path);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, -0x30(%rbp)
movq %rsi, %r14
leaq 0x8(%rdi), %r12
movq %rdi, -0x38(%rbp)
leaq 0x18(%rdi), %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0xa0fa
leaq 0x8(%rbx), %r13
leaq 0x10(%rbx), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x5040
testl %eax, %eax
je 0xa0e1
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x5890
cmpq $-0x1, %rax
je 0xa08c
movq %rax, %r15
movq %r12, %rdi
movq %r13, %rsi
callq 0xb960
movq 0x8(%r14), %rdx
movq %rax, %rdi
movq %r15, %rsi
movq -0x30(%rbp), %rcx
callq 0x51b0
jmp 0xa08c
movq %r12, %rdi
movq %r13, %rsi
callq 0xb960
movq %rax, %rdi
movq -0x30(%rbp), %rsi
callq 0x52a0
jmp 0xa08c
movq -0x38(%rbp), %rax
movq 0x90(%rax), %rdi
movq (%rdi), %rax
movq 0x70(%rax), %rax
movq %r14, %rsi
movq -0x30(%rbp), %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
nop
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/wrapper/wrapper.cpp
// Function: wrapper::RecordCmFsOps::CmUnlink(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
int RecordCmFsOps::CmUnlink(const string &pathname) {
  const int res = fns_->FnUnlink(pathname.c_str());
  if (res < 0) {
    return res;
  }

  DiskMod mod;
  mod.mod_type = DiskMod::kRemoveMod;
  mod.mod_opts = DiskMod::kNoneOpt;
  mod.path = pathname;
  mods_.push_back(mod);

  return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
movq %rsi, %r15
movq %rdi, %rbx
movq 0x90(%rdi), %r14
movq (%rsi), %rsi
leaq -0x128(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x51c0
movq (%r14), %rax
leaq -0x128(%rbp), %rsi
movq %r14, %rdi
callq *0x78(%rax)
movl %eax, %r14d
leaq -0x128(%rbp), %rdi
callq 0x58a8
testl %r14d, %r14d
js 0xa1bc
leaq -0x128(%rbp), %r12
movq %r12, %rdi
callq 0x8e2e
movq $0x5, 0x20(%r12)
movq %r12, %rdi
movq %r15, %rsi
callq 0x52a0
addq $0x78, %rbx
leaq -0x128(%rbp), %rsi
movq %rbx, %rdi
callq 0xac5a
leaq -0x128(%rbp), %rdi
callq 0x7d8e
movl %r14d, %eax
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x128(%rbp), %rdi
callq 0x58a8
jmp 0xa1f4
movq %rax, %rbx
jmp 0xa1f4
movq %rax, %rbx
leaq -0x128(%rbp), %rdi
callq 0x7d8e
movq %rbx, %rdi
callq 0x5780
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/wrapper/wrapper.cpp
// Function: wrapper::RecordCmFsOps::CmRemove(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
int RecordCmFsOps::CmRemove(const string &pathname) {
  const int res = fns_->FnRemove(pathname.c_str());
  if (res < 0) {
    return res;
  }

  DiskMod mod;
  mod.mod_type = DiskMod::kRemoveMod;
  mod.mod_opts = DiskMod::kNoneOpt;
  mod.path = pathname;
  mods_.push_back(mod);

  return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
movq %rsi, %r15
movq %rdi, %rbx
movq 0x90(%rdi), %r14
movq (%rsi), %rsi
leaq -0x128(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x51c0
movq (%r14), %rax
leaq -0x128(%rbp), %rsi
movq %r14, %rdi
callq *0x80(%rax)
movl %eax, %r14d
leaq -0x128(%rbp), %rdi
callq 0x58a8
testl %r14d, %r14d
js 0xa297
leaq -0x128(%rbp), %r12
movq %r12, %rdi
callq 0x8e2e
movq $0x5, 0x20(%r12)
movq %r12, %rdi
movq %r15, %rsi
callq 0x52a0
addq $0x78, %rbx
leaq -0x128(%rbp), %rsi
movq %rbx, %rdi
callq 0xac5a
leaq -0x128(%rbp), %rdi
callq 0x7d8e
movl %r14d, %eax
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x128(%rbp), %rdi
callq 0x58a8
jmp 0xa2cf
movq %rax, %rbx
jmp 0xa2cf
movq %rax, %rbx
leaq -0x128(%rbp), %rdi
callq 0x7d8e
movq %rbx, %rdi
callq 0x5780
nop
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/wrapper/wrapper.cpp
// Function: wrapper::RecordCmFsOps::CmFsync(int)
int RecordCmFsOps::CmFsync(const int fd) {
  const int res = fns_->FnFsync(fd);
  if (res < 0) {
    return res;
  }

  DiskMod mod;
  mod.mod_type = DiskMod::kFsyncMod;
  mod.mod_opts = DiskMod::kNoneOpt;
  mod.path = fd_map_.at(fd);
  mods_.push_back(mod);

  return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %r14
movl %esi, -0x1c(%rbp)
movq 0x90(%rdi), %rdi
movq (%rdi), %rax
callq *0x98(%rax)
movl %eax, %ebx
testl %eax, %eax
js 0xa356
leaq -0x120(%rbp), %r15
movq %r15, %rdi
callq 0x8e2e
movq $0x7, 0x20(%r15)
leaq 0x8(%r14), %rdi
leaq -0x1c(%rbp), %rsi
callq 0xb44e
leaq -0x120(%rbp), %rdi
movq %rax, %rsi
callq 0x52a0
addq $0x78, %r14
leaq -0x120(%rbp), %rsi
movq %r14, %rdi
callq 0xac5a
leaq -0x120(%rbp), %rdi
callq 0x7d8e
movl %ebx, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x120(%rbp), %rdi
callq 0x7d8e
movq %rbx, %rdi
callq 0x5780
nop
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/wrapper/wrapper.cpp
// Function: wrapper::RecordCmFsOps::CmSync()
void RecordCmFsOps::CmSync() {
  fns_->FnSync();
  
  DiskMod mod;
  mod.mod_type = DiskMod::kSyncMod;
  mod.mod_opts = DiskMod::kNoneOpt;
  mods_.push_back(mod);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq %rdi, %rbx
movq 0x90(%rdi), %rdi
movq (%rdi), %rax
callq *0xa8(%rax)
leaq -0x110(%rbp), %r14
movq %r14, %rdi
callq 0x8e2e
movq $0x8, 0x20(%r14)
addq $0x78, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xac5a
leaq -0x110(%rbp), %rdi
callq 0x7d8e
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x110(%rbp), %rdi
callq 0x7d8e
movq %rbx, %rdi
callq 0x5780
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/wrapper/wrapper.cpp
// Function: wrapper::RecordCmFsOps::CmSyncFileRange(int, unsigned long, unsigned long, unsigned int)
int RecordCmFsOps::CmSyncFileRange(const int fd, size_t offset, size_t nbytes,
    unsigned int flags) {
  const int res = fns_->FnSyncFileRange(fd, offset, nbytes, flags);
  if (res < 0) {
    return res;
  }

  DiskMod mod;
  mod.mod_type = DiskMod::kSyncFileRangeMod;
  mod.mod_opts = DiskMod::kNoneOpt;
  mod.path = fd_map_.at(fd);
  const int post_stat_res = fns_->FnStat(fd_map_.at(fd), &mod.post_mod_stats);
  if (post_stat_res < 0) {
    // TODO(ashmrtn): Some sort of warning here?
    return post_stat_res;
  }
  mod.file_mod_location = offset;
  mod.file_mod_len = nbytes;
  mods_.push_back(mod);
  return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rcx, %r15
movq %rdx, %r12
movq %rdi, %r14
movl %esi, -0x2c(%rbp)
movq 0x90(%rdi), %rdi
movq (%rdi), %rax
callq *0xb0(%rax)
movl %eax, %ebx
testl %eax, %eax
js 0xa570
movq %r15, -0x38(%rbp)
leaq -0x138(%rbp), %r15
movq %r15, %rdi
callq 0x8e2e
movq $0x9, 0x20(%r15)
leaq 0x8(%r14), %r13
leaq -0x2c(%rbp), %rsi
movq %r13, %rdi
callq 0xb44e
leaq -0x138(%rbp), %rdi
movq %rax, %rsi
callq 0x52a0
movq 0x90(%r14), %r15
leaq -0x2c(%rbp), %rsi
movq %r13, %rdi
callq 0xb44e
leaq -0x110(%rbp), %rdx
movq (%r15), %rcx
movq %r15, %rdi
movq %rax, %rsi
callq *0x88(%rcx)
testl %eax, %eax
js 0xa562
leaq -0x138(%rbp), %rsi
movq %r12, 0xd0(%rsi)
movq -0x38(%rbp), %rax
movq %rax, 0xd8(%rsi)
addq $0x78, %r14
movq %r14, %rdi
callq 0xac5a
jmp 0xa564
movl %eax, %ebx
leaq -0x138(%rbp), %rdi
callq 0x7d8e
movl %ebx, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa586
movq %rax, %rbx
leaq -0x138(%rbp), %rdi
callq 0x7d8e
movq %rbx, %rdi
callq 0x5780
nop
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/wrapper/wrapper.cpp
// Function: wrapper::RecordCmFsOps::CmCheckpoint()
int RecordCmFsOps::CmCheckpoint() {
  const int res = fns_->CmCheckpoint();
  if (res < 0) {
    return res;
  }

  DiskMod mod;
  mod.mod_type = DiskMod::kCheckpointMod;
  mod.mod_opts = DiskMod::kNoneOpt;
  mods_.push_back(mod);

  return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %r14
movq 0x90(%rdi), %rdi
movq (%rdi), %rax
callq *0xb8(%rax)
movl %eax, %ebx
testl %eax, %eax
js 0xa5f9
leaq -0x118(%rbp), %r15
movq %r15, %rdi
callq 0x8e2e
movq $0x6, 0x20(%r15)
addq $0x78, %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0xac5a
leaq -0x118(%rbp), %rdi
callq 0x7d8e
movl %ebx, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x118(%rbp), %rdi
callq 0x7d8e
movq %rbx, %rdi
callq 0x5780
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/wrapper/wrapper.cpp
// Function: wrapper::RecordCmFsOps::WriteWhole(int, unsigned long long, std::shared_ptr<char>)
int RecordCmFsOps::WriteWhole(const int fd, const unsigned long long size,
    shared_ptr<char> data) {
  unsigned long long written = 0;
  while (written < size) {
    const int res = write(fd, data.get() + written, size - written);
    if (res < 0) {
      return res;
    }
    written += res;
  }

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %r15d
xorl %r12d, %r12d
movq %r14, %rdx
subq %r12, %rdx
jbe 0xa65e
movq (%rbx), %rsi
addq %r12, %rsi
movl %r15d, %edi
callq 0x5190
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
addq %rcx, %r12
testl %eax, %eax
jns 0xa637
jmp 0xa660
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/wrapper/wrapper.cpp
// Function: wrapper::RecordCmFsOps::Serialize(int)
int RecordCmFsOps::Serialize(const int fd) {
  for (auto &mod : mods_) {
    unsigned long long size;
    shared_ptr<char> serial_mod = DiskMod::Serialize(mod, &size);
    if (serial_mod == nullptr) {
      return -1;
    }

    const int res = WriteWhole(fd, size, serial_mod);
    if (res < 0) {
      return -1;
    }
  }

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, -0x2c(%rbp)
movq 0x78(%rdi), %rax
movq 0x80(%rdi), %r15
leaq -0x40(%rbp), %r12
leaq -0x58(%rbp), %rbx
movq %rax, %r14
cmpq %r15, %rax
je 0xa6ed
movq %r12, %rdi
movq %r14, %rsi
leaq -0x48(%rbp), %rdx
callq 0x8912
cmpq $0x0, -0x40(%rbp)
je 0xa6f9
movq -0x48(%rbp), %r13
movq %rbx, %rdi
movq %r12, %rsi
callq 0xad3a
movl -0x2c(%rbp), %esi
movq %r13, %rdx
movq %rbx, %rcx
callq 0xa620
movl %eax, %r13d
leaq -0x50(%rbp), %rdi
callq 0x7dbe
leaq -0x38(%rbp), %rdi
callq 0x7dbe
leaq 0x100(%r14), %rax
testl %r13d, %r13d
jns 0xa691
xorl %eax, %eax
cmpq %r15, %r14
setne %al
negl %eax
jmp 0xa705
leaq -0x38(%rbp), %rdi
callq 0x7dbe
pushq $-0x1
popq %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x7dbe
leaq -0x38(%rbp), %rdi
callq 0x7dbe
movq %rbx, %rdi
callq 0x5780
nop
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/utils/FSCommands.cpp
// Function: GetFSCommands(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
FSCommands* GetFSCommands(string &fs_name){
	if (fs_name.compare(DAXCommands::fsName) == 0 )
		return new DAXCommands(); 
	else if (fs_name.compare(NOVACommands::fsName) == 0 )
		return new NOVACommands();
	else if (fs_name.compare(PMFSCommands::fsName) == 0 )
		return new PMFSCommands();
	else
		return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x6345(%rip), %rsi      # 0x11eb9
callq 0x5140
testl %eax, %eax
je 0xbba7
leaq 0x6339(%rip), %rsi      # 0x11ebd
movq %rbx, %rdi
callq 0x5140
testl %eax, %eax
je 0xbbb0
leaq 0x632b(%rip), %rsi      # 0x11ec2
movq %rbx, %rdi
callq 0x5140
testl %eax, %eax
je 0xbbb9
xorl %eax, %eax
jmp 0xbbcf
leaq 0xe0a2(%rip), %rbx      # 0x19c50
jmp 0xbbc0
leaq 0xe0e9(%rip), %rbx      # 0x19ca0
jmp 0xbbc0
leaq 0xe120(%rip), %rbx      # 0x19ce0
addq $0x10, %rbx
pushq $0x8
popq %rdi
callq 0x54a0
movq %rbx, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/williewillus[P]panda_scratchpad/src/utils/Tester.cpp
// Function: Tester::snapshot_device()
int Tester::snapshot_device() {
	cout << "Creating snapshot of " << record_device_path << endl;
	string command = "dd if=" + record_device_path + " of="
	       	+ MNT_POINT_SNAPSHOT + "/" + SNAPSHOT_NAME + " bs=1M "
		+ "count=" + to_string(device_size);
	cout << "Snapshot dev command is : " << command << endl;
	if (system(command.c_str()) != 0) {
		return SNAP_ERR;
	}
	return SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdi, %rbx
movq 0xda0a(%rip), %rdi      # 0x19fc0
leaq 0x5a9b(%rip), %rsi      # 0x12058
callq 0x5480
leaq 0x50(%rbx), %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x5410
movq %rax, %rdi
callq 0x5240
leaq 0x5a8e(%rip), %rsi      # 0x1206e
leaq -0x138(%rbp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0xbd84
leaq 0x5af1(%rip), %rdx      # 0x120ea
leaq -0x78(%rbp), %rdi
movq %r15, %rsi
callq 0x739c
leaq 0x5a69(%rip), %rdx      # 0x12075
leaq -0x98(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x739c
leaq 0x5ff7(%rip), %rdx      # 0x1261a
leaq -0xb8(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x739c
leaq 0x5a45(%rip), %rdx      # 0x12082
leaq -0xd8(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x739c
leaq 0x5a39(%rip), %rdx      # 0x12090
leaq -0xf8(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x739c
leaq 0x5a85(%rip), %rdx      # 0x120f6
leaq -0x118(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x739c
movq 0x90(%rbx), %rsi
leaq -0x58(%rbp), %rdi
callq 0xd8a4
leaq -0x38(%rbp), %rdi
leaq -0x118(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0xd833
leaq -0x58(%rbp), %rdi
callq 0x58a8
leaq -0x118(%rbp), %rdi
callq 0x58a8
leaq -0xf8(%rbp), %rdi
callq 0x58a8
leaq -0xd8(%rbp), %rdi
callq 0x58a8
leaq -0xb8(%rbp), %rdi
callq 0x58a8
leaq -0x98(%rbp), %rdi
callq 0x58a8
leaq -0x78(%rbp), %rdi
callq 0x58a8
leaq -0x138(%rbp), %rdi
callq 0x58a8
movq 0xd8b7(%rip), %rdi      # 0x19fc0
leaq 0x5988(%rip), %rsi      # 0x12098
callq 0x5480
leaq -0x38(%rbp), %rsi
movq %rax, %rdi
callq 0x5410
movq %rax, %rdi
callq 0x5240
movq -0x38(%rbp), %rdi
callq 0x53e0
xorl %ebx, %ebx
negl %eax
sbbl %ebx, %ebx
leaq -0x38(%rbp), %rdi
callq 0x58a8
movl %ebx, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x58a8
jmp 0xc762
movq %rax, %rbx
leaq -0x118(%rbp), %rdi
callq 0x58a8
jmp 0xc773
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
callq 0x58a8
jmp 0xc784
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
callq 0x58a8
jmp 0xc795
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x58a8
leaq -0x98(%rbp), %rdi
callq 0x58a8
leaq -0x78(%rbp), %rdi
callq 0x58a8
leaq -0x138(%rbp), %rdi
jmp 0xc7d5
movq %rax, %rbx
jmp 0xc7a1
movq %rax, %rbx
jmp 0xc7ad
movq %rax, %rbx
jmp 0xc7b6
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x58a8
movq %rbx, %rdi
callq 0x5780