// File: /workspace/github_cpp_makefile_star2_O3/williewillus[P]panda_scratchpad/src/checker/DiskContents.cpp
// Function: DiskContents::compare_disk_contents(DiskContents&, std::basic_ofstream<char, std::char_traits<char>>&)
bool DiskContents::compare_disk_contents(DiskContents &compare_disk, ofstream &diff_file) {
  bool retValue = true;

  if (disk_path.compare(compare_disk.disk_path) == 0) {
    return retValue;
  }

  string base_path = "/mnt/pmem0";
  get_contents(base_path.c_str());

 /* if (compare_disk.mount_disk() != 0) {
    cout << "Mounting " << compare_disk.disk_path << " failed" << endl;
  }*/

  compare_disk.get_contents(compare_disk.get_mount_point().c_str());

  // Compare the size of contents
  if (contents.size() != compare_disk.contents.size()) {
    diff_file << "DIFF: Mismatch" << endl;
    diff_file << "Unequal #entries in " << disk_path << ", " << compare_disk.disk_path;
    diff_file << endl << endl;
    diff_file << disk_path << " contains:" << endl;
    for (auto &i : contents) {
      diff_file << i.first << endl;
    }
    diff_file << endl;

    diff_file << compare_disk.disk_path << " contains:" << endl;
    for (auto &i : compare_disk.contents) {
      diff_file << i.first << endl;
    }
    diff_file << endl;
    retValue = false;
  }

  // entry-wise comparision
  for (auto &i : contents) {
    fileAttributes i_fa = i.second;
    if (compare_disk.contents.find((i.first)) == compare_disk.contents.end()) {
      diff_file << "DIFF: Missing " << i.first << endl;
      diff_file << "Found in " << disk_path << " only" << endl;
      diff_file << i_fa << endl << endl;
      retValue = false;
      continue;
    }
    fileAttributes j_fa = compare_disk.contents[(i.first)];
    if (!(i_fa.compare_dir_attr(j_fa.dir_attr)) ||
          !(i_fa.compare_stat_attr(j_fa.stat_attr))) {
        diff_file << "DIFF: Content Mismatch " << i.first << endl << endl;
        diff_file << disk_path << ":" << endl;
        diff_file << i_fa << endl << endl;
        diff_file << compare_disk.disk_path << ":" << endl;
        diff_file << j_fa << endl << endl;
        retValue = false;
        continue;
    }
    // compare user data if the entry corresponds to a regular files
    if (i_fa.is_regular_file()) {
      // check md5sum of the file contents
      if (i_fa.compare_md5sum(j_fa.md5sum) != 0) {
        diff_file << "DIFF : Data Mismatch of " << (i.first) << endl;
        diff_file << disk_path << " has md5sum " << i_fa.md5sum << endl;
        diff_file << compare_disk.disk_path << " has md5sum " << j_fa.md5sum;
        diff_file << endl << endl;
        retValue = false;
      }
    }
  }
  //compare_disk.unmount_and_delete_mount_point();
  return retValue;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x538, %rsp            # imm = 0x538
movq %rdx, -0x30(%rbp)
movq %rsi, %r15
movq %rdi, %r14
addq $0x8, %rdi
addq $0x8, %rsi
callq 0x5050
testl %eax, %eax
je 0x11cfb
movq %r15, -0x40(%rbp)
leaq -0x58(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x3c7a(%rip), %rsi      # 0x151e2
leaq 0x3c7d(%rip), %rdx      # 0x151ec
movq %r14, %r15
leaq -0x68(%rbp), %r14
movq %r14, %rdi
callq 0x8066
movq (%r14), %rsi
movq %r15, -0x38(%rbp)
movq %r15, %rdi
callq 0x10f38
leaq -0x270(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x40(%rbp), %r15
movq 0x28(%r15), %rsi
movq 0x30(%r15), %rdx
addq %rsi, %rdx
leaq -0x280(%rbp), %rdi
callq 0x7fc8
movq -0x280(%rbp), %rsi
movq %r15, %rdi
callq 0x10f38
movq -0x280(%rbp), %rdi
cmpq %r14, %rdi
je 0x115d3
callq 0x5460
movq -0x38(%rbp), %rax
movq 0x90(%rax), %rax
movq -0x40(%rbp), %rcx
cmpq 0x90(%rcx), %rax
sete %al
movl %eax, -0x44(%rbp)
je 0x1189d
leaq 0x4033(%rip), %rsi      # 0x1562f
movl $0xe, %edx
movq -0x30(%rbp), %rdi
callq 0x54f0
movq -0x30(%rbp), %rcx
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq -0x30(%rbp), %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
leaq 0x4001(%rip), %rsi      # 0x1563e
movl $0x14, %edx
movq -0x30(%rbp), %rdi
callq 0x54f0
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq -0x30(%rbp), %rdi
callq 0x54f0
movq %rax, %r14
leaq 0x3fe9(%rip), %rsi      # 0x15653
movl $0x2, %edx
movq %rax, %rdi
callq 0x54f0
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %r14, %rdi
callq 0x54f0
movq -0x30(%rbp), %rcx
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq -0x30(%rbp), %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq -0x30(%rbp), %rdi
callq 0x54f0
movq %rax, %r14
leaq 0x3f56(%rip), %rsi      # 0x15656
movl $0xa, %edx
movq %rax, %rdi
callq 0x54f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
movq -0x38(%rbp), %rax
movq 0x80(%rax), %r14
leaq 0x70(%rax), %r12
cmpq %r12, %r14
je 0x11793
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
movq -0x30(%rbp), %rdi
callq 0x54f0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq %r15, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
movq %r14, %rdi
callq 0x5310
movq %rax, %r14
cmpq %r12, %rax
jne 0x11748
movq -0x30(%rbp), %rcx
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq -0x30(%rbp), %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq -0x30(%rbp), %rdi
callq 0x54f0
movq %rax, %r14
leaq 0x3e78(%rip), %rsi      # 0x15656
movl $0xa, %edx
movq %rax, %rdi
callq 0x54f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
movq -0x40(%rbp), %rax
movq 0x80(%rax), %r14
leaq 0x70(%rax), %r12
cmpq %r12, %r14
je 0x11871
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
movq -0x30(%rbp), %rdi
callq 0x54f0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq %r15, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
movq %r14, %rdi
callq 0x5310
movq %rax, %r14
cmpq %r12, %rax
jne 0x11826
movq -0x30(%rbp), %rcx
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq -0x30(%rbp), %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
movq -0x38(%rbp), %rax
movq 0x80(%rax), %r13
addq $0x70, %rax
movq %rax, -0x98(%rbp)
cmpq %rax, %r13
je 0x11ce4
movq -0x40(%rbp), %rcx
leaq 0x68(%rcx), %r14
movl $0x1a8, %eax            # imm = 0x1A8
leaq -0x280(%rbp), %r12
leaq (%r12,%rax), %rdx
movq %rdx, -0x90(%rbp)
movl $0x1b8, %edx            # imm = 0x1B8
leaq (%r12,%rdx), %rsi
movq %rsi, -0x88(%rbp)
addq $0x70, %rcx
movq %rcx, -0x80(%rbp)
leaq -0x448(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x70(%rbp)
addq %rcx, %rdx
movq %rdx, -0x78(%rbp)
leaq 0x40(%r13), %rsi
movl $0x1a8, %edx            # imm = 0x1A8
movq %r12, %rdi
callq 0x53b0
movq -0x88(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq 0x1e8(%r13), %rsi
movq 0x1f0(%r13), %rdx
addq %rsi, %rdx
movq -0x90(%rbp), %rdi
callq 0x7fc8
leaq 0x20(%r13), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x13df6
cmpq -0x80(%rbp), %rax
je 0x11dee
movq %r14, %rdi
movq %r15, %rsi
callq 0x138e8
leaq -0x448(%rbp), %rbx
movq %rax, %r15
movl $0x1a8, %edx            # imm = 0x1A8
movq %rbx, %rdi
movq %rax, %rsi
callq 0x53b0
movq -0x78(%rbp), %rax
movq %rax, -0x2a0(%rbp)
movq 0x1a8(%r15), %rsi
movq 0x1b0(%r15), %rdx
addq %rsi, %rdx
movq -0x70(%rbp), %rdi
callq 0x7fc8
movl $0x118, %edx            # imm = 0x118
leaq -0x560(%rbp), %rdi
movq %rbx, %rsi
callq 0x53b0
movq -0x280(%rbp), %rax
cmpq -0x560(%rbp), %rax
jne 0x11d11
movq -0x278(%rbp), %rax
cmpq -0x558(%rbp), %rax
jne 0x11d11
movzwl -0x270(%rbp), %eax
cmpw -0x550(%rbp), %ax
jne 0x11d11
movb -0x26e(%rbp), %al
cmpb -0x54e(%rbp), %al
jne 0x11d11
leaq -0x26d(%rbp), %rdi
leaq -0x54d(%rbp), %rsi
callq 0x55c0
testl %eax, %eax
jne 0x11d11
movq -0x160(%rbp), %rax
cmpq -0x328(%rbp), %rax
jne 0x11d11
movl -0x318(%rbp), %eax
cmpl %eax, -0x150(%rbp)
jne 0x11d11
movq -0x320(%rbp), %rcx
cmpq %rcx, -0x158(%rbp)
jne 0x11d11
movl -0x314(%rbp), %ecx
cmpl %ecx, -0x14c(%rbp)
jne 0x11d11
movl -0x310(%rbp), %ecx
cmpl %ecx, -0x148(%rbp)
jne 0x11d11
movq -0x300(%rbp), %rcx
cmpq %rcx, -0x138(%rbp)
jne 0x11d11
movq -0x2f8(%rbp), %rcx
cmpq %rcx, -0x130(%rbp)
jne 0x11d11
movq -0x2f0(%rbp), %rcx
cmpq %rcx, -0x128(%rbp)
jne 0x11d11
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x11cb8
leaq -0xa8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x2a0(%rbp), %rsi
movq -0x298(%rbp), %rdx
addq %rsi, %rdx
leaq -0xb8(%rbp), %rdi
callq 0x7fc8
movq -0xd0(%rbp), %rbx
movq -0xb8(%rbp), %r15
movq -0xb0(%rbp), %r12
cmpq %rbx, %r12
movq %rbx, %rdx
cmovbq %r12, %rdx
testq %rdx, %rdx
je 0x11b34
movq -0xd8(%rbp), %rdi
movq %r15, %rsi
callq 0x54b0
testl %eax, %eax
je 0x11b34
xorl %ebx, %ebx
jmp 0x11b3a
cmpq %r12, %rbx
sete %bl
leaq -0xa8(%rbp), %rax
cmpq %rax, %r15
leaq -0x280(%rbp), %r12
je 0x11b55
movq %r15, %rdi
callq 0x5460
testb %bl, %bl
jne 0x11cb8
movl $0x18, %edx
movq -0x30(%rbp), %rdi
leaq 0x3b2b(%rip), %rsi      # 0x15698
callq 0x54f0
movq 0x20(%r13), %rsi
movq 0x28(%r13), %rdx
movq -0x30(%rbp), %rdi
callq 0x54f0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq %r15, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq -0x30(%rbp), %rdi
callq 0x54f0
movq %rax, %r15
movl $0xc, %edx
movq %rax, %rdi
leaq 0x3add(%rip), %rsi      # 0x156b1
callq 0x54f0
movq -0xd8(%rbp), %rsi
movq -0xd0(%rbp), %rdx
movq %r15, %rdi
callq 0x54f0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq %r15, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq -0x30(%rbp), %rdi
callq 0x54f0
movq %rax, %r15
movl $0xc, %edx
movq %rax, %rdi
leaq 0x3a71(%rip), %rsi      # 0x156b1
callq 0x54f0
movq -0x2a0(%rbp), %rsi
movq -0x298(%rbp), %rdx
movq %r15, %rdi
callq 0x54f0
movq -0x30(%rbp), %rcx
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq -0x30(%rbp), %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq %r15, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
movl $0x0, -0x44(%rbp)
leaq -0x448(%rbp), %rdi
callq 0x10746
movq %r12, %rdi
callq 0x10746
movq %r13, %rdi
callq 0x5310
movq %rax, %r13
cmpq -0x98(%rbp), %rax
jne 0x11908
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x11cf6
callq 0x5460
movl -0x44(%rbp), %eax
jmp 0x11cfd
movb $0x1, %al
andb $0x1, %al
addq $0x538, %rsp            # imm = 0x538
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3968(%rip), %rsi      # 0x15680
movl $0x17, %edx
movq -0x30(%rbp), %rdi
callq 0x54f0
movq 0x20(%r13), %rsi
movq 0x28(%r13), %rdx
movq -0x30(%rbp), %rdi
callq 0x54f0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq -0x30(%rbp), %rdi
callq 0x54f0
movq %rax, %r14
leaq 0x38b5(%rip), %rsi      # 0x1565f
movl $0x1, %edx
movq %rax, %rdi
callq 0x54f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
leaq -0x280(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x109a7
leaq 0x386c(%rip), %rsi      # 0x15661
movl $0xe, %edx
movq -0x30(%rbp), %rdi
callq 0x54f0
movq 0x20(%r13), %rsi
movq 0x28(%r13), %rdx
movq -0x30(%rbp), %rdi
callq 0x54f0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
leaq 0x382b(%rip), %rsi      # 0x15670
movl $0x9, %edx
movq -0x30(%rbp), %rdi
callq 0x54f0
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq -0x30(%rbp), %rdi
callq 0x54f0
movq %rax, %r14
leaq 0x3808(%rip), %rsi      # 0x1567a
movl $0x5, %edx
movq %rax, %rdi
callq 0x54f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
leaq -0x280(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x109a7
movq %rax, %rbx
movq -0x280(%rbp), %rdi
cmpq %r14, %rdi
je 0x11f0e
callq 0x5460
jmp 0x11f0e
jmp 0x11ee8
jmp 0x11ee8
movq %rax, %rbx
leaq -0x58(%rbp), %r13
jmp 0x11f0e
jmp 0x11edd
jmp 0x11edd
movq %rax, %rbx
leaq -0x58(%rbp), %r13
jmp 0x11f02
jmp 0x11ee8
movq %rax, %rbx
jmp 0x11f0e
jmp 0x11eef
movq %rax, %rbx
leaq -0x58(%rbp), %r13
leaq -0x448(%rbp), %rdi
callq 0x10746
leaq -0x280(%rbp), %rdi
callq 0x10746
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x11f1c
callq 0x5460
movq %rbx, %rdi
callq 0x57c0