// File: /workspace/github_cpp_makefile_star2_O1/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 $0x548, %rsp            # imm = 0x548
movq %rdx, -0x30(%rbp)
movq %rsi, %r15
movq %rdi, %r14
addq $0x8, %rdi
addq $0x8, %rsi
callq 0x5050
testl %eax, %eax
je 0x11e0b
movq %r15, -0x40(%rbp)
leaq -0x60(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x3b9a(%rip), %rsi      # 0x151f2
leaq 0x3b9d(%rip), %rdx      # 0x151fc
movq %r14, %r15
leaq -0x70(%rbp), %r14
movq %r14, %rdi
callq 0x80ec
movq (%r14), %rsi
movq %r15, -0x38(%rbp)
movq %r15, %rdi
callq 0x11016
leaq -0x278(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x40(%rbp), %r15
movq 0x28(%r15), %rsi
movq 0x30(%r15), %rdx
addq %rsi, %rdx
leaq -0x288(%rbp), %r12
movq %r12, %rdi
callq 0x8052
movq -0x288(%rbp), %rsi
movq %r15, %rdi
callq 0x11016
movq -0x288(%rbp), %rdi
cmpq %r14, %rdi
je 0x116c6
callq 0x5460
movq -0x38(%rbp), %rcx
movq 0x90(%rcx), %rax
movb $0x1, %sil
movq -0x40(%rbp), %rdx
cmpq 0x90(%rdx), %rax
je 0x1199a
leaq 0x3f56(%rip), %rsi      # 0x15642
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 0x3f24(%rip), %rsi      # 0x15651
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 0x3f0c(%rip), %rsi      # 0x15666
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 0x3e79(%rip), %rsi      # 0x15669
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 0x11883
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 0x11838
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 0x3d9b(%rip), %rsi      # 0x15669
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 0x11961
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 0x11916
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
xorl %esi, %esi
movq -0x38(%rbp), %rcx
leaq -0x288(%rbp), %r12
movl %esi, -0x44(%rbp)
movq 0x80(%rcx), %r13
leaq 0x70(%rcx), %r14
cmpq %r14, %r13
je 0x11df4
movq -0x40(%rbp), %rcx
leaq 0x68(%rcx), %rax
movq %rax, -0x50(%rbp)
movl $0x1a8, %eax            # imm = 0x1A8
leaq (%r12,%rax), %rdx
movq %rdx, -0xa0(%rbp)
movl $0x1b8, %edx            # imm = 0x1B8
leaq (%r12,%rdx), %rsi
movq %rsi, -0x98(%rbp)
addq $0x70, %rcx
movq %rcx, -0x90(%rbp)
leaq -0x450(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
addq %rcx, %rdx
movq %rdx, -0x88(%rbp)
movq %r14, -0x78(%rbp)
leaq 0x40(%r13), %rsi
movl $0x1a8, %edx            # imm = 0x1A8
movq %r12, %rdi
callq 0x53b0
movq -0x98(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq 0x1e8(%r13), %rsi
movq 0x1f0(%r13), %rdx
addq %rsi, %rdx
movq -0xa0(%rbp), %rdi
callq 0x8052
leaq 0x20(%r13), %r15
movq -0x50(%rbp), %rdi
movq %r15, %rsi
callq 0x13f12
cmpq -0x90(%rbp), %rax
je 0x11efe
movq -0x50(%rbp), %rdi
movq %r15, %rsi
callq 0x139fa
leaq -0x450(%rbp), %rbx
movq %rax, %r15
movl $0x1a8, %edx            # imm = 0x1A8
movq %rbx, %rdi
movq %rax, %rsi
callq 0x53b0
movq -0x88(%rbp), %rax
movq %rax, -0x2a8(%rbp)
movq 0x1a8(%r15), %rsi
movq 0x1b0(%r15), %rdx
addq %rsi, %rdx
movq -0x80(%rbp), %rdi
callq 0x8052
movl $0x118, %edx            # imm = 0x118
leaq -0x568(%rbp), %rdi
movq %rbx, %rsi
callq 0x53b0
movq -0x288(%rbp), %rax
cmpq -0x568(%rbp), %rax
jne 0x11e21
movq -0x280(%rbp), %rax
cmpq -0x560(%rbp), %rax
jne 0x11e21
movzwl -0x278(%rbp), %eax
cmpw -0x558(%rbp), %ax
jne 0x11e21
movb -0x276(%rbp), %al
cmpb -0x556(%rbp), %al
jne 0x11e21
leaq -0x275(%rbp), %rdi
leaq -0x555(%rbp), %rsi
callq 0x55c0
testl %eax, %eax
jne 0x11e21
movq -0x168(%rbp), %rax
cmpq -0x330(%rbp), %rax
jne 0x11e21
movl -0x320(%rbp), %eax
cmpl %eax, -0x158(%rbp)
jne 0x11e21
movq -0x328(%rbp), %rax
cmpq %rax, -0x160(%rbp)
jne 0x11e21
movl -0x31c(%rbp), %eax
cmpl %eax, -0x154(%rbp)
jne 0x11e21
movl -0x318(%rbp), %eax
cmpl %eax, -0x150(%rbp)
jne 0x11e21
movq -0x308(%rbp), %rax
cmpq %rax, -0x140(%rbp)
jne 0x11e21
movq -0x300(%rbp), %rax
cmpq %rax, -0x138(%rbp)
jne 0x11e21
movq -0x2f8(%rbp), %rax
cmpq %rax, -0x130(%rbp)
jne 0x11e21
movl -0x158(%rbp), %eax
movl $0xf000, %ecx           # imm = 0xF000
andl %ecx, %eax
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x11dcc
leaq -0xb0(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x2a8(%rbp), %rsi
movq -0x2a0(%rbp), %rdx
addq %rsi, %rdx
leaq -0xc0(%rbp), %rdi
callq 0x8052
movq %r12, %r14
movq -0xd8(%rbp), %r15
movq -0xb8(%rbp), %rbx
cmpq %r15, %rbx
movq %r15, %rdx
cmovbq %rbx, %rdx
testq %rdx, %rdx
je 0x11c40
movq -0xc0(%rbp), %rsi
movq -0xe0(%rbp), %rdi
callq 0x54b0
testl %eax, %eax
sete %r12b
jmp 0x11c43
movb $0x1, %r12b
cmpq %rbx, %r15
sete %bl
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x11c61
callq 0x5460
andb %bl, %r12b
movq %r14, %r12
movq -0x78(%rbp), %r14
jne 0x11dcc
movl $0x18, %edx
movq -0x30(%rbp), %rdi
leaq 0x3a2a(%rip), %rsi      # 0x156ab
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 0x39dc(%rip), %rsi      # 0x156c4
callq 0x54f0
movq -0xe0(%rbp), %rsi
movq -0xd8(%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 0x3970(%rip), %rsi      # 0x156c4
callq 0x54f0
movq -0x2a8(%rbp), %rsi
movq -0x2a0(%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 -0x450(%rbp), %rdi
callq 0x10812
movq %r12, %rdi
callq 0x10812
movq %r13, %rdi
callq 0x5310
movq %rax, %r13
cmpq %r14, %rax
jne 0x11a04
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x11e06
callq 0x5460
movl -0x44(%rbp), %eax
jmp 0x11e0d
movb $0x1, %al
andb $0x1, %al
addq $0x548, %rsp            # imm = 0x548
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x386b(%rip), %rsi      # 0x15693
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 0x37b8(%rip), %rsi      # 0x15672
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 -0x288(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x10a73
leaq 0x376f(%rip), %rsi      # 0x15674
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 0x372e(%rip), %rsi      # 0x15683
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 0x370b(%rip), %rsi      # 0x1568d
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 -0x288(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x10a73
movq %rax, %rbx
movq -0x288(%rbp), %rdi
cmpq %r14, %rdi
je 0x1201e
callq 0x5460
jmp 0x1201e
jmp 0x11ff8
jmp 0x11ff8
movq %rax, %rbx
leaq -0x60(%rbp), %r13
jmp 0x1201e
jmp 0x11fed
jmp 0x11fed
movq %rax, %rbx
leaq -0x60(%rbp), %r13
jmp 0x12012
jmp 0x11ff8
movq %rax, %rbx
jmp 0x1201e
jmp 0x11fff
movq %rax, %rbx
leaq -0x60(%rbp), %r13
leaq -0x450(%rbp), %rdi
callq 0x10812
leaq -0x288(%rbp), %rdi
callq 0x10812
movq -0x70(%rbp), %rdi
cmpq %r13, %rdi
je 0x1202c
callq 0x5460
movq %rbx, %rdi
callq 0x57c0