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

  bool expecting_filename = false;
  string current_filename;
  while (!tag_stream.eof()) {
    string line;
    getline(tag_stream, line);

    if (expecting_filename) {
      expecting_filename = false;

      size_t comma = line.find(',');
      if (comma != string::npos) {
        current_filename = line.substr(0, comma);
        tags.push_back(TagInfo(current_filename, current_filename, 0));
      }
    } else if (line[0] == 0x0C) {
      expecting_filename = true;
      continue;
    } else {

      size_t tag_start = line.find(0x7F);
      if (tag_start == string::npos) {
        continue;
      }
      size_t tag_end = line.find(0x01, tag_start);
      if (tag_end == string::npos) {
        continue;
      }
      size_t row_end = line.find(',', tag_end);
      if (row_end == string::npos) {
        continue;
      }

      string symbol = line.substr(tag_start + 1, tag_end-tag_start-1);
      string row = line.substr(tag_end+1, row_end);

      tags.push_back(TagInfo(symbol, current_filename, atoi(row.c_str())));
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rsi, 0x28(%rsp)
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq (%rdi), %rax
movq -0x18(%rax), %rcx
testb $0x2, 0x20(%rdi,%rcx)
jne 0x42bd
movq %rdi, %r14
addq $-0x18, %rax
leaq 0x18(%rsp), %r13
leaq 0xa0(%rsp), %rbp
xorl %r12d, %r12d
movq %r13, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movq (%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %edx
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
callq 0x2370
testb $0x1, %r12b
je 0x40e9
xorl %ebx, %ebx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movl $0x2c, %esi
xorl %edx, %edx
callq 0x2270
cmpq $-0x1, %rax
je 0x428c
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x2210
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0x2250
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x4068
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x21f0
movq %rbx, %rdi
leaq 0x30(%rsp), %rdx
movq %rdx, %rsi
xorl %ecx, %ecx
callq 0x455a
movq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0x4b70
movq 0x90(%rsp), %rdi
cmpq %rbp, %rdi
je 0x40a4
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x40c6
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x40e2
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x21f0
xorl %ebx, %ebx
jmp 0x428c
movq 0x8(%rsp), %rax
movb $0x1, %bl
cmpb $0xc, (%rax)
je 0x428c
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movl $0x7f, %esi
xorl %edx, %edx
callq 0x2270
cmpq $-0x1, %rax
je 0x4272
movq %rax, %rbx
movq %r15, %rdi
movl $0x1, %esi
movq %rax, %rdx
callq 0x2270
cmpq $-0x1, %rax
je 0x4277
movq %rax, %rbp
movq %r15, %rdi
movl $0x2c, %esi
movq %rax, %rdx
callq 0x2270
cmpq $-0x1, %rax
je 0x427c
movq %rax, %r13
leaq 0x1(%rbx), %rdx
notq %rbx
addq %rbp, %rbx
leaq 0xd8(%rsp), %rdi
movq %r15, %rsi
movq %rbx, %rcx
callq 0x2210
incq %rbp
leaq 0xb8(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
movq %r13, %rcx
callq 0x2210
movq 0xb8(%rsp), %rdi
callq 0x22d0
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
leaq 0xd8(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movl %eax, %ecx
leaq 0x18(%rsp), %r13
callq 0x455a
movq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0x4b70
leaq 0xa0(%rsp), %rbp
movq 0x90(%rsp), %rdi
cmpq %rbp, %rdi
je 0x41ea
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x420c
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x4228
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x424d
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x4272
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x21f0
movl %r12d, %ebx
jmp 0x428c
movl %r12d, %ebx
jmp 0x4284
movl %r12d, %ebx
leaq 0x18(%rsp), %r13
leaq 0xa0(%rsp), %rbp
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x42a3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21f0
movq (%r14), %rax
movq -0x18(%rax), %rcx
addq $-0x18, %rax
testb $0x2, 0x20(%r14,%rcx)
movl %ebx, %r12d
je 0x3fcd
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x42d9
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x21f0
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x4610
jmp 0x42fd
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x4327
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x21f0
jmp 0x4327
movq %rax, %rbx
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x4366
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x21f0
jmp 0x4366
jmp 0x4363
jmp 0x4363
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x4610
jmp 0x4366
jmp 0x4363
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x4382
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x439e
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x21f0
movq %rbx, %rdi
callq 0x2330