// File: /workspace/github_cpp_makefile_star2_O3/williewillus[P]panda_scratchpad/src/checker/DiskContents.cpp
// Function: DiskContents::get_contents(char const*)
void DiskContents::get_contents(const char* path) {
  DIR *directory;
  struct dirent *dir_entry;
  // open both the directories
  if (!(directory = opendir(path))) {
    return;
  }
  // get the contents in both the directories
  if (!(dir_entry = readdir(directory))) {
    closedir(directory);
    return;
  }
  do {
    string parent_path(path);
    string filename(dir_entry->d_name);
    string current_path = parent_path + "/" + filename;
    string relative_path = current_path;
    relative_path.erase(0, mount_point.length());
    struct stat statbuf;
    fileAttributes fa;
    if (stat(current_path.c_str(), &statbuf) == -1) {
      continue;
    }
    if (dir_entry->d_type == DT_DIR) {
      if ((strcmp(dir_entry->d_name, ".") == 0) || (strcmp(dir_entry->d_name, "..") == 0)) {
        continue;
      }
      fa.set_dir_attr(dir_entry);
      fa.set_stat_attr(current_path, false);
      contents[relative_path] = fa;
      // If the entry is a directory and not . or .. make a recursive call
      get_contents(current_path.c_str());
    } else if (dir_entry->d_type == DT_LNK) {
      // compare lstat outputs
      struct stat lstatbuf;
      if (lstat(current_path.c_str(), &lstatbuf) == -1) {
        continue;
      }
      fa.set_stat_attr(current_path, true);
      contents[relative_path] = fa;
    } else if (dir_entry->d_type == DT_REG) {
      fa.set_md5sum(current_path);
      fa.set_stat_attr(current_path, false);
      contents[relative_path] = fa;
    } else {
      fa.set_stat_attr(current_path, false);
      contents[relative_path] = fa;
    }
  } while (dir_entry = readdir(directory));
  closedir(directory);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x428, %rsp            # imm = 0x428
movq %rdi, -0x58(%rbp)
movq %rsi, -0x80(%rbp)
movq %rsi, %rdi
callq 0x5660
testq %rax, %rax
je 0x11413
movq %rax, %r15
movq %rax, %rdi
callq 0x5690
testq %rax, %rax
je 0x11425
movq %rax, %rbx
movq -0x58(%rbp), %rax
addq $0x68, %rax
movq %rax, -0x50(%rbp)
leaq -0x328(%rbp), %r12
leaq -0xc0(%rbp), %r13
leaq -0xe0(%rbp), %rdi
movq -0x80(%rbp), %rsi
movq %r12, %rdx
callq 0x51c0
leaq 0x13(%rbx), %r14
leaq -0x68(%rbp), %rax
movq %rax, -0x78(%rbp)
movq %r14, %rdi
callq 0x51f0
leaq (%rbx,%rax), %rdx
addq $0x13, %rdx
leaq -0x78(%rbp), %rdi
movq %r14, %rsi
callq 0x8066
leaq -0x318(%rbp), %rax
movq %rax, -0x328(%rbp)
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x7fc8
movq %r12, %rdi
leaq 0x4608(%rip), %rsi      # 0x1560a
callq 0x5860
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq %r12, %rdi
callq 0x5160
leaq -0x38(%rbp), %rsi
movq %rsi, -0x48(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1103b
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0x11041
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, -0x40(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x328(%rbp), %rdi
leaq -0x318(%rbp), %rax
cmpq %rax, %rdi
je 0x11070
callq 0x5460
leaq -0xb0(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x7fc8
movq -0x58(%rbp), %rax
movq 0x30(%rax), %rdx
movq %r13, %rdi
xorl %esi, %esi
callq 0x50c0
movq %r12, %rdi
callq 0x106a4
movq -0x48(%rbp), %rdi
leaq -0x448(%rbp), %rsi
callq 0x5410
cmpl $-0x1, %eax
je 0x1139b
movzbl 0x12(%rbx), %eax
cmpl $0xa, %eax
je 0x11273
cmpl $0x8, %eax
je 0x111dc
cmpl $0x4, %eax
jne 0x11316
cmpb $0x2e, (%r14)
jne 0x11103
cmpb $0x0, 0x14(%rbx)
je 0x1139b
cmpb $0x2e, 0x14(%rbx)
jne 0x11103
cmpb $0x0, 0x15(%rbx)
je 0x1139b
movq (%rbx), %rax
movq %rax, -0x328(%rbp)
movq 0x8(%rbx), %rax
movq %rax, -0x320(%rbp)
movzwl 0x10(%rbx), %eax
movw %ax, -0x318(%rbp)
movb $0x4, -0x316(%rbp)
movl $0x100, %edx            # imm = 0x100
leaq -0x315(%rbp), %rdi
movq %r14, %rsi
callq 0x5250
movb $0x0, -0x216(%rbp)
leaq -0x150(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x160(%rbp), %rdi
callq 0x7fc8
movq -0x160(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x5410
movq -0x160(%rbp), %rdi
leaq -0x150(%rbp), %rax
cmpq %rax, %rdi
je 0x11195
callq 0x5460
movq -0x50(%rbp), %rdi
movq %r13, %rsi
callq 0x138e8
movq %rax, %rbx
movl $0x1a8, %edx            # imm = 0x1A8
movq %rax, %rdi
movq %r12, %rsi
callq 0x53b0
addq $0x1a8, %rbx            # imm = 0x1A8
movq %rbx, %rdi
leaq -0x180(%rbp), %rsi
callq 0x5280
movq -0x48(%rbp), %rsi
movq -0x58(%rbp), %rdi
callq 0x10f38
jmp 0x1139b
leaq -0x90(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0xa0(%rbp), %rdi
callq 0x7fc8
movq %r12, %rdi
leaq -0xa0(%rbp), %rsi
callq 0x107d2
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x11228
callq 0x5460
leaq -0x110(%rbp), %rax
movq %rax, -0x120(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x120(%rbp), %rdi
callq 0x7fc8
movq -0x120(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x5410
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
jmp 0x1135c
movq -0x48(%rbp), %rdi
leaq -0x3b8(%rbp), %rsi
callq 0x5880
cmpl $-0x1, %eax
je 0x1139b
leaq -0x130(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x140(%rbp), %rdi
callq 0x7fc8
movq -0x140(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x5880
movq -0x140(%rbp), %rdi
leaq -0x130(%rbp), %rax
cmpq %rax, %rdi
je 0x112dc
callq 0x5460
movq -0x50(%rbp), %rdi
movq %r13, %rsi
callq 0x138e8
movq %rax, %rbx
movl $0x1a8, %edx            # imm = 0x1A8
movq %rax, %rdi
movq %r12, %rsi
callq 0x53b0
addq $0x1a8, %rbx            # imm = 0x1A8
movq %rbx, %rdi
leaq -0x180(%rbp), %rsi
callq 0x5280
jmp 0x1139b
leaq -0xf0(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x100(%rbp), %rdi
callq 0x7fc8
movq -0x100(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x5410
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x11366
callq 0x5460
movq -0x50(%rbp), %rdi
movq %r13, %rsi
callq 0x138e8
movq %rax, %rbx
movl $0x1a8, %edx            # imm = 0x1A8
movq %rax, %rdi
movq %r12, %rsi
callq 0x53b0
addq $0x1a8, %rbx            # imm = 0x1A8
movq %rbx, %rdi
leaq -0x180(%rbp), %rsi
callq 0x5280
movq %r12, %rdi
callq 0x10746
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x113bb
callq 0x5460
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x113cd
callq 0x5460
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x113df
callq 0x5460
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x113f7
callq 0x5460
movq %r15, %rdi
callq 0x5690
movq %rax, %rbx
testq %rax, %rax
jne 0x10f96
movq %r15, %rdi
callq 0x56f0
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x56f0
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x1148b
callq 0x5460
jmp 0x1148b
jmp 0x11488
movq %rax, %rbx
jmp 0x114d3
movq %rax, %rbx
jmp 0x114c1
jmp 0x11469
movq %rax, %rbx
movq -0x328(%rbp), %rdi
leaq -0x318(%rbp), %rax
jmp 0x114b7
movq %rax, %rbx
jmp 0x114af
jmp 0x11483
movq %rax, %rbx
jmp 0x11497
movq %rax, %rbx
leaq -0x328(%rbp), %rdi
callq 0x10746
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x114af
callq 0x5460
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x114c1
callq 0x5460
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x114d3
callq 0x5460
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x114eb
callq 0x5460
movq %rbx, %rdi
callq 0x57c0
nop