// File: LiuYinCarl[P]headerFileAnalysis/headerFileAnalysis.cpp
// Function: WalkMan::get_include_lines(std::filesystem::__cxx11::path const&)
std::vector<std::string> WalkMan::get_include_lines(const fs::path& path) {
  // regex expression from:
  // https://stackoverflow.com/questions/26492513/write-c-regular-expression-to-match-a-include-preprocessing-directive
  static std::regex re{"^\\s*#\\s*include\\s+[<\"][^>\"]*[>\"]\\s*"};
  //static std::regex re_filename{"\"(.*?)\"|(<.*?>)"};
  static std::regex re_filename{"[<\"](.*?)[>\"]"};
  std::vector<std::string> include_info{ path.filename() };

  std::ifstream is { path.c_str() };
  std::string s;
  while (std::getline(is, s)) {
    if (std::regex_search(begin(s), end(s), re)) {
      std::smatch matchRes;
      std::regex_search(s, matchRes, re_filename);
      std::string filename = matchRes[1].str();
      assert(filename.size() > 0);
      if (headers.count(filename) == 0) { // filter stdlib headers
	continue;
      }
      include_info.emplace_back(std::move(filename));
    }
  }
  assert(include_info.size() > 0);
  return include_info;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3b0, %rsp            # imm = 0x3B0
movq %rdi, -0x328(%rbp)
movq %rdi, %rax
movq %rax, -0x320(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x318(%rbp)
cmpb $0x0, 0x5c66e(%rip)     # 0x64878
jne 0x825d
leaq 0x5c665(%rip), %rdi     # 0x64878
callq 0x67b0
cmpl $0x0, %eax
je 0x825d
leaq 0x5c634(%rip), %rdi     # 0x64858
leaq 0x3b270(%rip), %rsi     # 0x4349b
movl $0x10, %edx
callq 0x9ec0
jmp 0x8237
leaq 0x1d22(%rip), %rdi      # 0x9f60
leaq 0x5c613(%rip), %rsi     # 0x64858
leaq 0x5c1ec(%rip), %rdx     # 0x64438
callq 0x6430
leaq 0x5c620(%rip), %rdi     # 0x64878
callq 0x6360
cmpb $0x0, 0x5c63c(%rip)     # 0x648a0
jne 0x82b7
leaq 0x5c633(%rip), %rdi     # 0x648a0
callq 0x67b0
cmpl $0x0, %eax
je 0x82b7
leaq 0x5c602(%rip), %rdi     # 0x64880
leaq 0x3b23a(%rip), %rsi     # 0x434bf
movl $0x10, %edx
callq 0x9ec0
jmp 0x8291
leaq 0x1cc8(%rip), %rdi      # 0x9f60
leaq 0x5c5e1(%rip), %rsi     # 0x64880
leaq 0x5c192(%rip), %rdx     # 0x64438
callq 0x6430
leaq 0x5c5ee(%rip), %rdi     # 0x648a0
callq 0x6360
movb $0x0, -0x25(%rbp)
movb $0x1, -0x89(%rbp)
leaq -0x58(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0x9d20
jmp 0x82dc
leaq -0x58(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x9f90
jmp 0x82ee
movb $0x0, -0x89(%rbp)
leaq -0x58(%rbp), %rax
movq %rax, -0x38(%rbp)
movq $0x1, -0x30(%rbp)
leaq -0x8a(%rbp), %rdi
movq %rdi, -0x330(%rbp)
callq 0x9fc0
movq -0x328(%rbp), %rdi
movq -0x330(%rbp), %rcx
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x9fe0
jmp 0x8335
leaq -0x8a(%rbp), %rdi
callq 0xa060
leaq -0x58(%rbp), %rax
movq %rax, -0x340(%rbp)
addq $0x20, %rax
movq %rax, -0x338(%rbp)
movq -0x338(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x348(%rbp)
callq 0x6310
movq -0x340(%rbp), %rcx
movq -0x348(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x338(%rbp)
jne 0x8357
leaq -0x88(%rbp), %rdi
callq 0x97c0
movq -0x18(%rbp), %rdi
callq 0x97f0
movq %rax, %rsi
leaq -0x298(%rbp), %rdi
movl $0x8, %edx
callq 0x67d0
jmp 0x83b3
leaq -0x2b8(%rbp), %rdi
callq 0x6650
leaq -0x298(%rbp), %rdi
leaq -0x2b8(%rbp), %rsi
callq 0x6090
movq %rax, -0x350(%rbp)
jmp 0x83db
movq -0x350(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x65f0
movb %al, -0x351(%rbp)
jmp 0x83f9
movb -0x351(%rbp), %al
testb $0x1, %al
jne 0x8408
jmp 0x870f
leaq -0x2b8(%rbp), %rdi
callq 0xa110
movq %rax, -0x360(%rbp)
jmp 0x841d
movq -0x360(%rbp), %rax
movq %rax, -0x2c0(%rbp)
leaq -0x2b8(%rbp), %rdi
callq 0xa140
movq %rax, -0x368(%rbp)
jmp 0x8440
movq -0x368(%rbp), %rax
movq %rax, -0x2c8(%rbp)
movq -0x2c0(%rbp), %rdi
movq -0x2c8(%rbp), %rsi
leaq 0x5c3f5(%rip), %rdx     # 0x64858
xorl %ecx, %ecx
callq 0xa080
movb %al, -0x369(%rbp)
jmp 0x8472
movb -0x369(%rbp), %al
testb $0x1, %al
jne 0x8481
jmp 0x870a
leaq -0x2e8(%rbp), %rdi
callq 0xa170
jmp 0x848f
leaq 0x5c3ea(%rip), %rdx     # 0x64880
leaq -0x2b8(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
xorl %ecx, %ecx
callq 0xa1b0
jmp 0x84ad
leaq -0x2e8(%rbp), %rdi
movl $0x1, %esi
callq 0xa210
movq %rax, -0x378(%rbp)
jmp 0x84c7
movq -0x378(%rbp), %rsi
leaq -0x308(%rbp), %rdi
callq 0xa280
jmp 0x84dc
leaq -0x308(%rbp), %rdi
callq 0x63a0
cmpq $0x0, %rax
jbe 0x84f3
jmp 0x865c
leaq 0x3afd3(%rip), %rdi     # 0x434cd
leaq 0x3acda(%rip), %rsi     # 0x431db
movl $0x123, %edx            # imm = 0x123
leaq 0x3afd4(%rip), %rcx     # 0x434e1
callq 0x6370
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq 0x5c353(%rip), %rdi     # 0x64878
callq 0x6340
jmp 0x87b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq 0x5c35e(%rip), %rdi     # 0x648a0
callq 0x6340
jmp 0x87b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x85d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x85c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x8a(%rbp), %rdi
callq 0xa060
leaq -0x58(%rbp), %rax
movq %rax, -0x388(%rbp)
addq $0x20, %rax
movq %rax, -0x380(%rbp)
movq -0x380(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x390(%rbp)
callq 0x6310
movq -0x388(%rbp), %rcx
movq -0x390(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x380(%rbp)
jne 0x8596
jmp 0x85c9
leaq -0x88(%rbp), %rdi
callq 0x97c0
testb $0x1, -0x89(%rbp)
jne 0x85e0
jmp 0x8624
movq -0x60(%rbp), %rax
leaq -0x58(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x398(%rbp)
je 0x8622
movq -0x398(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x3a0(%rbp)
callq 0x6310
movq -0x3a0(%rbp), %rax
leaq -0x58(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x398(%rbp)
jne 0x85f4
jmp 0x8624
jmp 0x87b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x87a6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x8770
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x86fc
movq -0x318(%rbp), %rdi
addq $0x108, %rdi            # imm = 0x108
leaq -0x308(%rbp), %rsi
callq 0xa340
movq %rax, -0x3a8(%rbp)
jmp 0x867f
movq -0x3a8(%rbp), %rax
cmpq $0x0, %rax
jne 0x86b2
movl $0x2, -0x30c(%rbp)
jmp 0x86d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x308(%rbp), %rdi
callq 0x6310
jmp 0x86fc
movq -0x328(%rbp), %rdi
leaq -0x308(%rbp), %rsi
callq 0xa3a0
jmp 0x86c7
movl $0x0, -0x30c(%rbp)
leaq -0x308(%rbp), %rdi
callq 0x6310
leaq -0x2e8(%rbp), %rdi
callq 0xa420
movl -0x30c(%rbp), %eax
testl %eax, %eax
je 0x86fa
jmp 0x86f5
jmp 0x83bf
jmp 0x870a
leaq -0x2e8(%rbp), %rdi
callq 0xa420
jmp 0x8770
jmp 0x83bf
movq -0x328(%rbp), %rdi
callq 0xa440
cmpq $0x0, %rax
jbe 0x8723
jmp 0x8742
leaq 0x3adfd(%rip), %rdi     # 0x43527
leaq 0x3aaaa(%rip), %rsi     # 0x431db
movl $0x12a, %edx            # imm = 0x12A
leaq 0x3ada4(%rip), %rcx     # 0x434e1
callq 0x6370
movb $0x1, -0x25(%rbp)
movl $0x1, -0x30c(%rbp)
leaq -0x2b8(%rbp), %rdi
callq 0x6310
leaq -0x298(%rbp), %rdi
callq 0x60e0
testb $0x1, -0x25(%rbp)
jne 0x8796
jmp 0x878a
leaq -0x2b8(%rbp), %rdi
callq 0x6310
leaq -0x298(%rbp), %rdi
callq 0x60e0
jmp 0x87a6
movq -0x328(%rbp), %rdi
callq 0xa460
movq -0x320(%rbp), %rax
addq $0x3b0, %rsp            # imm = 0x3B0
popq %rbp
retq
movq -0x328(%rbp), %rdi
callq 0xa460
movq -0x20(%rbp), %rdi
callq 0x6780
nopl (%rax,%rax)