// File: ahupp[P]mural/tags.cpp
// Function: read_ctags_file(std::basic_ifstream<char, std::char_traits<char>>&, std::vector<TagInfo, std::allocator<TagInfo>>&)
void read_ctags_file(ifstream& tag_stream, vector<TagInfo>& tags) {

  set<string> seen_files;

  while (!tag_stream.eof()) {
    string line;
    getline(tag_stream, line);

    if (line[0] == '!') {
      continue;
    }

    vector<string> splat = split(line, '\t');
    if (splat.size() != 4) {
      continue;
    }

    string row = splat[2];
    if (row.length() > 2 && row.substr(row.length()-2, row.length()) == ";\"") {
      row = row.substr(0, row.length() - 2);
    }

    string filename = splat[1];
    if (seen_files.find(filename) == seen_files.end()) {
      seen_files.insert(filename);
      tags.push_back(TagInfo(filename, filename, 0));
    }

    tags.push_back(TagInfo(splat[0], filename, atoi(row.c_str())));
  }
}

// Assembly:
subq $0x278, %rsp            # imm = 0x278
movq %rdi, 0x270(%rsp)
movq %rsi, 0x268(%rsp)
leaq 0x238(%rsp), %rdi
callq 0x7e60
movq 0x270(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3450
movb %al, 0x6f(%rsp)
jmp 0x72c1
movb 0x6f(%rsp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x72d0
jmp 0x7791
leaq 0x208(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0x3350
movq 0x60(%rsp), %rsi
movq 0x270(%rsp), %rdi
callq 0x3070
jmp 0x72f6
xorl %eax, %eax
movl %eax, %esi
leaq 0x208(%rsp), %rdi
callq 0x3490
movq %rax, 0x58(%rsp)
jmp 0x730e
movq 0x58(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x21, %eax
jne 0x735d
movl $0x2, 0x204(%rsp)
jmp 0x7719
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x230(%rsp)
movl %eax, 0x22c(%rsp)
jmp 0x77a6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x230(%rsp)
movl %eax, 0x22c(%rsp)
jmp 0x7782
leaq 0x1e8(%rsp), %rdi
leaq 0x208(%rsp), %rsi
movl $0x9, %edx
callq 0x70e0
jmp 0x7379
leaq 0x1e8(%rsp), %rdi
callq 0x7e70
cmpq $0x4, %rax
je 0x739c
movl $0x2, 0x204(%rsp)
jmp 0x770c
leaq 0x1e8(%rsp), %rdi
movl $0x2, %esi
callq 0x7e90
movq %rax, %rsi
leaq 0x1c8(%rsp), %rdi
callq 0x30f0
jmp 0x73c0
leaq 0x1c8(%rsp), %rdi
callq 0x3390
movq %rax, %rcx
movb $0x0, 0x1a7(%rsp)
xorl %eax, %eax
cmpq $0x2, %rcx
movb %al, 0x57(%rsp)
jbe 0x7451
leaq 0x1c8(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x3390
movq 0x40(%rsp), %rdi
addq $-0x2, %rax
movq %rax, 0x48(%rsp)
callq 0x3390
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq %rax, %rcx
leaq 0x1a8(%rsp), %rdi
callq 0x3260
jmp 0x7425
movb $0x1, 0x1a7(%rsp)
leaq 0x2cb6(%rip), %rsi      # 0xa0ea
leaq 0x1a8(%rsp), %rdi
callq 0x7eb0
movb %al, 0x3f(%rsp)
jmp 0x7447
movb 0x3f(%rsp), %al
movb %al, 0x57(%rsp)
jmp 0x7451
movb 0x57(%rsp), %al
movb %al, 0x3e(%rsp)
testb $0x1, 0x1a7(%rsp)
jne 0x7465
jmp 0x7472
leaq 0x1a8(%rsp), %rdi
callq 0x3170
movb 0x3e(%rsp), %al
testb $0x1, %al
jne 0x747f
jmp 0x7538
leaq 0x1c8(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x3390
movq 0x30(%rsp), %rsi
movq %rax, %rcx
addq $-0x2, %rcx
xorl %eax, %eax
movl %eax, %edx
leaq 0x180(%rsp), %rdi
callq 0x3260
jmp 0x74b0
leaq 0x1c8(%rsp), %rdi
leaq 0x180(%rsp), %rsi
callq 0x32f0
leaq 0x180(%rsp), %rdi
callq 0x3170
jmp 0x7538
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x230(%rsp)
movl %eax, 0x22c(%rsp)
jmp 0x7775
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x230(%rsp)
movl %eax, 0x22c(%rsp)
jmp 0x7768
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x230(%rsp)
movl %eax, 0x22c(%rsp)
testb $0x1, 0x1a7(%rsp)
jne 0x7526
jmp 0x7533
leaq 0x1a8(%rsp), %rdi
callq 0x3170
jmp 0x7768
leaq 0x1e8(%rsp), %rdi
movl $0x1, %esi
callq 0x7e90
movq %rax, %rsi
leaq 0x160(%rsp), %rdi
callq 0x30f0
jmp 0x755c
leaq 0x238(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x7f00
movq %rax, 0x28(%rsp)
jmp 0x7578
movq 0x28(%rsp), %rax
movq %rax, 0x158(%rsp)
leaq 0x238(%rsp), %rdi
callq 0x7f40
movq %rax, 0x150(%rsp)
leaq 0x158(%rsp), %rdi
leaq 0x150(%rsp), %rsi
callq 0x7ee0
testb $0x1, %al
jne 0x75b8
jmp 0x767b
leaq 0x238(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x7f70
movb %dl, 0x1f(%rsp)
movq %rax, 0x20(%rsp)
jmp 0x75d8
movb 0x1f(%rsp), %al
movq 0x20(%rsp), %rcx
movq %rcx, 0x140(%rsp)
movb %al, 0x148(%rsp)
movq 0x268(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0xd8(%rsp), %rdi
leaq 0x160(%rsp), %rdx
xorl %ecx, %ecx
movq %rdx, %rsi
callq 0x8000
jmp 0x7619
movq 0x10(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x7fd0
jmp 0x762d
leaq 0xd8(%rsp), %rdi
callq 0x4140
jmp 0x767b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x230(%rsp)
movl %eax, 0x22c(%rsp)
jmp 0x775b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x230(%rsp)
movl %eax, 0x22c(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0x4140
jmp 0x775b
movq 0x268(%rsp), %rax
movq %rax, (%rsp)
xorl %eax, %eax
movl %eax, %esi
leaq 0x1e8(%rsp), %rdi
callq 0x7e90
movq %rax, 0x8(%rsp)
leaq 0x1c8(%rsp), %rdi
callq 0x30e0
movq %rax, %rdi
callq 0x33b0
movq 0x8(%rsp), %rsi
movl %eax, %ecx
leaq 0x70(%rsp), %rdi
leaq 0x160(%rsp), %rdx
callq 0x8000
jmp 0x76cd
movq (%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x7fd0
jmp 0x76dd
leaq 0x70(%rsp), %rdi
callq 0x4140
leaq 0x160(%rsp), %rdi
callq 0x3170
leaq 0x1c8(%rsp), %rdi
callq 0x3170
movl $0x0, 0x204(%rsp)
leaq 0x1e8(%rsp), %rdi
callq 0x7e00
leaq 0x208(%rsp), %rdi
callq 0x3170
movl 0x204(%rsp), %eax
testl %eax, %eax
je 0x7738
jmp 0x7733
jmp 0x72a4
jmp 0x72a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x230(%rsp)
movl %eax, 0x22c(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x4140
leaq 0x160(%rsp), %rdi
callq 0x3170
leaq 0x1c8(%rsp), %rdi
callq 0x3170
leaq 0x1e8(%rsp), %rdi
callq 0x7e00
leaq 0x208(%rsp), %rdi
callq 0x3170
jmp 0x77a6
leaq 0x238(%rsp), %rdi
callq 0x80d0
addq $0x278, %rsp            # imm = 0x278
retq
leaq 0x238(%rsp), %rdi
callq 0x80d0
movq 0x230(%rsp), %rdi
callq 0x33f0