// File: /workspace/github_cpp_makefile_star2_O1/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, -0xa0(%rbp)
movq %rsi, %rdi
callq 0x5660
testq %rax, %rax
je 0x1151e
movq %rax, %r12
movq %rax, %rdi
callq 0x5690
testq %rax, %rax
je 0x11516
movq %rax, %rbx
leaq -0x88(%rbp), %r15
movq -0x58(%rbp), %rax
addq $0x68, %rax
movq %rax, -0x50(%rbp)
leaq -0x328(%rbp), %r13
leaq -0xe0(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movq %r13, %rdx
callq 0x51c0
leaq 0x13(%rbx), %r14
movq %r15, -0x98(%rbp)
movq %r14, %rdi
callq 0x51f0
leaq (%rbx,%rax), %rdx
addq $0x13, %rdx
leaq -0x98(%rbp), %rdi
movq %r14, %rsi
callq 0x80ec
leaq -0x318(%rbp), %r15
movq %r15, -0x328(%rbp)
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x8052
movq %r13, %rdi
leaq 0x4532(%rip), %rsi      # 0x1561a
callq 0x5860
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
movq %r13, %rdi
callq 0x5160
leaq -0x38(%rbp), %rsi
movq %rsi, -0x48(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x11127
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0x1112d
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
cmpq %r15, %rdi
je 0x11155
callq 0x5460
leaq -0x68(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x78(%rbp), %r15
movq %r15, %rdi
callq 0x8052
movq -0x58(%rbp), %rax
movq 0x30(%rax), %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x50c0
movq %r13, %rdi
callq 0x10770
movq -0x48(%rbp), %rdi
leaq -0x448(%rbp), %rsi
callq 0x5410
cmpl $-0x1, %eax
je 0x114a6
movzbl 0x12(%rbx), %r15d
cmpl $0xa, %r15d
je 0x11380
cmpl $0x8, %r15d
je 0x112d2
cmpl $0x4, %r15d
jne 0x11420
movq %r14, %rdi
leaq 0x446c(%rip), %rsi      # 0x15640
callq 0x55c0
testl %eax, %eax
je 0x114a6
movq %r14, %rdi
leaq 0x4454(%rip), %rsi      # 0x1563f
callq 0x55c0
testl %eax, %eax
je 0x114a6
movq (%rbx), %rax
movq %rax, -0x328(%rbp)
movq 0x8(%rbx), %rax
movq %rax, -0x320(%rbp)
movzwl 0x10(%rbx), %eax
movw %ax, -0x318(%rbp)
movb %r15b, -0x316(%rbp)
movl $0x100, %edx            # imm = 0x100
leaq -0x315(%rbp), %rdi
movq %r14, %rsi
callq 0x5250
movb $0x0, -0x216(%rbp)
leaq -0x130(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x140(%rbp), %rdi
callq 0x8052
movq -0x140(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x5410
movq -0x140(%rbp), %rdi
leaq -0x130(%rbp), %rax
cmpq %rax, %rdi
je 0x1128a
callq 0x5460
movq -0x50(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x139fa
movq %rax, %rbx
movl $0x1a8, %edx            # imm = 0x1A8
movq %rax, %rdi
movq %r13, %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 0x11016
jmp 0x114a6
leaq -0xb0(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0xc0(%rbp), %rdi
callq 0x8052
movq %r13, %rdi
leaq -0xc0(%rbp), %rsi
callq 0x1089e
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x1131e
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 0x8052
movq -0x120(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x5410
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x1136e
callq 0x5460
movq -0x50(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x139fa
jmp 0x1147d
movq -0x48(%rbp), %rdi
leaq -0x3b8(%rbp), %rsi
callq 0x5880
cmpl $-0x1, %eax
je 0x114a6
leaq -0x150(%rbp), %rbx
movq %rbx, -0x160(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x160(%rbp), %rdi
callq 0x8052
movq -0x160(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x5880
movq -0x160(%rbp), %rdi
cmpq %rbx, %rdi
leaq -0x78(%rbp), %rbx
je 0x113e6
callq 0x5460
movq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0x139fa
movq %rax, %rbx
movl $0x1a8, %edx            # imm = 0x1A8
movq %rax, %rdi
movq %r13, %rsi
callq 0x53b0
addq $0x1a8, %rbx            # imm = 0x1A8
movq %rbx, %rdi
leaq -0x180(%rbp), %rsi
callq 0x5280
jmp 0x114a6
leaq -0xf0(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x100(%rbp), %rdi
callq 0x8052
movq -0x100(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x5410
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x11470
callq 0x5460
movq -0x50(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x139fa
movq %rax, %rbx
movl $0x1a8, %edx            # imm = 0x1A8
movq %rax, %rdi
movq %r13, %rsi
callq 0x53b0
addq $0x1a8, %rbx            # imm = 0x1A8
movq %rbx, %rdi
leaq -0x180(%rbp), %rsi
callq 0x5280
movq %r13, %rdi
callq 0x10812
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x114c0
callq 0x5460
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
leaq -0x88(%rbp), %r15
je 0x114d9
callq 0x5460
movq -0x98(%rbp), %rdi
cmpq %r15, %rdi
je 0x114ea
callq 0x5460
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x11502
callq 0x5460
movq %r12, %rdi
callq 0x5690
movq %rax, %rbx
testq %rax, %rax
jne 0x11077
movq %r12, %rdi
callq 0x56f0
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x1157b
callq 0x5460
jmp 0x1157b
jmp 0x11578
movq %rax, %rbx
jmp 0x115c3
movq %rax, %rbx
jmp 0x115ab
jmp 0x1155b
movq %rax, %rbx
movq -0x328(%rbp), %rdi
cmpq %r15, %rdi
jne 0x115a6
jmp 0x115ab
movq %rax, %rbx
jmp 0x11599
jmp 0x11573
movq %rax, %rbx
jmp 0x11587
movq %rax, %rbx
leaq -0x328(%rbp), %rdi
callq 0x10812
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x11599
callq 0x5460
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x115ab
callq 0x5460
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x115c3
callq 0x5460
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x115db
callq 0x5460
movq %rbx, %rdi
callq 0x57c0
nop