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

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

  string base_path = "/mnt/pmem0" + path;

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

  string compare_disk_mount_point(compare_disk.get_mount_point());
  string compare_path = compare_disk_mount_point + path;

  fileAttributes base_fa, compare_fa;
  bool failed_stat = false;
  struct stat base_statbuf, compare_statbuf;
  if (stat(base_path.c_str(), &base_statbuf) == -1) {
    diff_file << "Failed stating the file " << base_path << endl;
    failed_stat = true;
  }
  if (stat(compare_path.c_str(), &compare_statbuf) == -1) {
    diff_file << "Failed stating the file " << compare_path << endl;
    failed_stat = true;
  }

  if (failed_stat) {
    //compare_disk.unmount_and_delete_mount_point();
    return false;
  }

  base_fa.set_stat_attr(base_path, false);
  compare_fa.set_stat_attr(compare_path, false);
  if (!(base_fa.compare_stat_attr(compare_fa.stat_attr))) {
    diff_file << "DIFF: Content Mismatch " << path << endl << endl;
    diff_file << base_path << ":" << endl;
    diff_file << base_fa << endl << endl;
    diff_file << compare_path << ":" << endl;
    diff_file << compare_fa << endl << endl;
    //compare_disk.unmount_and_delete_mount_point();
    return false;
  }

  if (base_fa.is_regular_file()) {
    base_fa.set_md5sum(base_path);
    compare_fa.set_md5sum(compare_path);
    if (base_fa.compare_md5sum(compare_fa.md5sum) != 0) {
      diff_file << "DIFF : Data Mismatch of " << path << endl;
      diff_file << base_path << " has md5sum " << base_fa.md5sum << endl;
      diff_file << compare_path << " has md5sum " << compare_fa.md5sum;
      diff_file << endl << endl;
      //compare_disk.unmount_and_delete_mount_point();
      return 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 $0x5b8, %rsp            # imm = 0x5B8
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
addq $0x8, %rdi
addq $0x8, %rsi
callq 0x5050
testl %eax, %eax
je 0x1221e
leaq 0x3285(%rip), %rsi      # 0x151e2
leaq -0x48(%rbp), %rdi
movq %r14, %rdx
callq 0xd1df
leaq -0x80(%rbp), %r13
movq %r13, -0x10(%r13)
movq 0x28(%r15), %rsi
movq 0x30(%r15), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %rdi
callq 0x7fc8
leaq -0x68(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movq %r14, %rdx
callq 0x13967
leaq -0x2f8(%rbp), %rdi
callq 0x106a4
leaq -0x4c0(%rbp), %rdi
callq 0x106a4
movq -0x48(%rbp), %rdi
leaq -0x5e0(%rbp), %rsi
callq 0x5410
cmpl $-0x1, %eax
je 0x12226
movq -0x68(%rbp), %rdi
leaq -0x550(%rbp), %rsi
callq 0x5410
cmpl $-0x1, %eax
je 0x1228d
leaq -0x120(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x130(%rbp), %rdi
callq 0x7fc8
movq -0x130(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x5410
movq -0x130(%rbp), %rdi
cmpq %r15, %rdi
je 0x1202b
callq 0x5460
leaq -0x100(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
leaq -0x110(%rbp), %rdi
callq 0x7fc8
movq -0x110(%rbp), %rdi
leaq -0x3a8(%rbp), %rsi
callq 0x5410
movq -0x110(%rbp), %rdi
cmpq %r15, %rdi
je 0x12071
callq 0x5460
movq -0x1d8(%rbp), %rax
cmpq -0x3a0(%rbp), %rax
jne 0x1249e
movl -0x390(%rbp), %eax
cmpl %eax, -0x1c8(%rbp)
jne 0x1249e
movq -0x398(%rbp), %rcx
cmpq %rcx, -0x1d0(%rbp)
jne 0x1249e
movl -0x38c(%rbp), %ecx
cmpl %ecx, -0x1c4(%rbp)
jne 0x1249e
movl -0x388(%rbp), %ecx
cmpl %ecx, -0x1c0(%rbp)
jne 0x1249e
movq -0x378(%rbp), %rcx
cmpq %rcx, -0x1b0(%rbp)
jne 0x1249e
movq -0x370(%rbp), %rcx
cmpq %rcx, -0x1a8(%rbp)
jne 0x1249e
movq -0x368(%rbp), %rcx
cmpq %rcx, -0x1a0(%rbp)
jne 0x1249e
andl $0xf000, %eax           # imm = 0xF000
movb $0x1, %r15b
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x1243c
leaq -0xe0(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0xf0(%rbp), %rdi
callq 0x7fc8
leaq -0x2f8(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x107d2
movq -0xf0(%rbp), %rdi
cmpq %r12, %rdi
je 0x12165
callq 0x5460
leaq -0xc0(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
leaq -0xd0(%rbp), %rdi
callq 0x7fc8
leaq -0x4c0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x107d2
movq -0xd0(%rbp), %rdi
cmpq %r12, %rdi
je 0x121ac
callq 0x5460
leaq -0xa0(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0x318(%rbp), %rsi
movq -0x310(%rbp), %rdx
addq %rsi, %rdx
leaq -0xb0(%rbp), %rdi
callq 0x7fc8
movq %rbx, -0x70(%rbp)
movq -0x148(%rbp), %r13
movq -0xb0(%rbp), %r12
movq -0xa8(%rbp), %rbx
cmpq %r13, %rbx
movq %r13, %rdx
cmovbq %rbx, %rdx
testq %rdx, %rdx
je 0x122cd
movq -0x150(%rbp), %rdi
movq %r12, %rsi
callq 0x54b0
testl %eax, %eax
je 0x122cd
xorl %ebx, %ebx
jmp 0x122d3
movb $0x1, %r15b
jmp 0x12489
leaq 0x3491(%rip), %rsi      # 0x156be
movl $0x18, %edx
movq %rbx, %rdi
callq 0x54f0
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %rbx, %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 -0x68(%rbp), %rdi
leaq -0x550(%rbp), %rsi
callq 0x5410
cmpl $-0x1, %eax
jne 0x12439
leaq 0x342a(%rip), %rsi      # 0x156be
movl $0x18, %edx
movq %rbx, %rdi
callq 0x54f0
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq %rbx, %rdi
callq 0x54f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5470
jmp 0x12426
cmpq %rbx, %r13
sete %bl
leaq -0xa0(%rbp), %rax
cmpq %rax, %r12
leaq -0x80(%rbp), %r13
je 0x122eb
movq %r12, %rdi
callq 0x5460
testb %bl, %bl
jne 0x1243c
leaq 0x339e(%rip), %rsi      # 0x15698
movl $0x18, %edx
movq -0x70(%rbp), %rbx
movq %rbx, %rdi
callq 0x54f0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %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 -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %rbx, %rdi
callq 0x54f0
movq %rax, %r14
leaq 0x3353(%rip), %rsi      # 0x156b1
movl $0xc, %edx
movq %rax, %rdi
callq 0x54f0
movq -0x150(%rbp), %rsi
movq -0x148(%rbp), %rdx
movq %r14, %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 -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq %rbx, %rdi
callq 0x54f0
movq %rax, %r14
leaq 0x32ec(%rip), %rsi      # 0x156b1
movl $0xc, %edx
movq %rax, %rdi
callq 0x54f0
movq -0x318(%rbp), %rsi
movq -0x310(%rbp), %rdx
movq %r14, %rdi
callq 0x54f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
xorl %r15d, %r15d
leaq -0x4c0(%rbp), %rdi
callq 0x10746
leaq -0x2f8(%rbp), %rdi
callq 0x10746
leaq -0x58(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x12466
callq 0x5460
movq -0x90(%rbp), %rdi
cmpq %r13, %rdi
je 0x12477
callq 0x5460
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x12489
callq 0x5460
movl %r15d, %eax
addq $0x5b8, %rsp            # imm = 0x5B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x31db(%rip), %rsi      # 0x15680
movl $0x17, %edx
movq %rbx, %rdi
callq 0x54f0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %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 -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %rbx, %rdi
callq 0x54f0
movq %rax, %r14
leaq 0x3130(%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 -0x2f8(%rbp), %rsi
movq %rbx, %rdi
callq 0x109a7
movq %rax, %rbx
movq -0xd0(%rbp), %rdi
jmp 0x12588
movq %rax, %rbx
movq -0xf0(%rbp), %rdi
cmpq %r12, %rdi
je 0x125ab
callq 0x5460
jmp 0x125ab
movq %rax, %rbx
jmp 0x125b7
movq %rax, %rbx
jmp 0x125c3
movq %rax, %rbx
jmp 0x125d5
movq %rax, %rbx
jmp 0x125e6
movq %rax, %rbx
leaq -0x4c0(%rbp), %rdi
callq 0x10746
leaq -0x2f8(%rbp), %rdi
callq 0x10746
leaq -0x58(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x125d5
callq 0x5460
movq -0x90(%rbp), %rdi
cmpq %r13, %rdi
je 0x125e6
callq 0x5460
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x125f8
callq 0x5460
movq %rbx, %rdi
callq 0x57c0