// File: /workspace/github_cpp_makefile_star2_O2/ncbi[P]amr/tsv.cpp
// Function: Common_sp::TextTable::TextTable(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, unsigned int)
TextTable::TextTable (const string &tableFName,
                      const string &columnSynonymsFName,
                      bool headerP,
                      uint displayPeriod)
: Named (tableFName)
{  
  {
    LineInput f (tableFName, displayPeriod);
    bool dataExists = true;
    // header
    while (f. nextLine ())
    {
      if (verbose ())
        cerr << f. lineNum << endl;
      trimTrailing (f. line);
      if (f. line. empty ())
        continue;
      const bool thisPound = (f. line. front () == '#');
      if (thisPound)
      {
        pound = true;
        f. line. erase (0, 1);
      }
      if (f. line. empty ())
        continue;
      if (header. empty () || thisPound)
      {
        header. clear ();
        StringVector h (f. line, '\t', true);
        for (string& s : h)
          header << std::move (Header (std::move (s)));
      }
      ASSERT (! header. empty ());
      if (headerP)
      {
        if (! thisPound)
        {
          if (! pound)
            dataExists = f. nextLine ();
          break;
        }
      }
      else
      {
        FFOR (size_t, i, header. size ())
          header [i]. name = to_string (i + 1);
        dataExists = true;
        pound = true;
        break;
      }
    }
    if (header. empty ())
      throw Error (*this, "Cannot read the table header");
    // dataExists <=> f.line is valid
    // rows[]
    while (dataExists)
    {
      trimTrailing (f. line);
      if (! f. line. empty ())
      {
        StringVector row (f. line, '\t', true);
        FFOR_START (size_t, i, row. size (), header. size ())
          row << noString;        
        rows << std::move (row);
        ASSERT (row. empty ());
      }
      dataExists = f. nextLine ();
    }
  }
  
  if (! columnSynonymsFName. empty ())
  {
    LineInput colF (columnSynonymsFName);
    string mainSyn;
    while (colF. nextLine ())
    {
      trim (colF. line);
      const string& syn = colF. line;
      if (syn. empty ())
        mainSyn. clear ();
      else
      {
        if (mainSyn. empty ())
          mainSyn = syn;
        else
          if (mainSyn != syn)
          {
            const ColNum i = col2num_ (syn);
            if (i != no_index)
            {
              if (hasColumn (mainSyn))
                throw runtime_error ("Table " + strQuote (name) + ": Column " + strQuote (mainSyn) + " already exists");
              else
                header [i]. name = mainSyn;
            }
          }
      }
    }
  }
  
  setHeader ();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x468, %rsp            # imm = 0x468
movl %r8d, %ebx
movl %ecx, 0x2c(%rsp)
movq %rdx, 0xf8(%rsp)
movq %rsi, %r15
movq %rdi, %r14
callq 0x3d200
leaq 0x32cdc(%rip), %rax     # 0x83bc0
movq %rax, (%r14)
movw $0x100, 0x28(%r14)      # imm = 0x100
leaq 0x30(%r14), %rax
movq %rax, 0x20(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%r14)
movups %xmm0, 0x39(%r14)
leaq 0x50(%r14), %rax
movq %rax, 0x50(%rsp)
movups %xmm0, 0x50(%r14)
movq %r14, 0x10(%rsp)
movups %xmm0, 0x59(%r14)
leaq 0x1c0(%rsp), %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x1d20a
leaq 0x428(%rsp), %r13
leaq 0x1c0(%rsp), %rbx
leaq 0x120(%rsp), %r12
movb $0x1, %bpl
movq %rbx, %rdi
callq 0x219d4
testb %al, %al
je 0x510eb
xorl %edi, %edi
callq 0x280a3
testb %al, %al
je 0x50f7f
movl 0x420(%rsp), %esi
movq 0x3306e(%rip), %rdi     # 0x83fe0
callq 0xb410
movq %rax, %rdi
callq 0xb2f0
movq %r13, %rdi
callq 0x235ab
cmpq $0x0, 0x430(%rsp)
je 0x50f49
movq 0x428(%rsp), %rax
movb (%rax), %r15b
cmpb $0x23, %r15b
jne 0x50fc4
movq 0x10(%rsp), %rax
movb $0x1, 0x28(%rax)
movq %r13, %rdi
xorl %esi, %esi
pushq $0x1
popq %rdx
callq 0xb100
cmpq $0x0, 0x430(%rsp)
je 0x50f49
cmpb $0x23, %r15b
setne %al
movq 0x10(%rsp), %rcx
movq 0x30(%rcx), %rbx
movq 0x38(%rcx), %r14
cmpq %r14, %rbx
setne %cl
testb %cl, %al
jne 0x5104b
movq 0x20(%rsp), %rdi
callq 0x55286
leaq 0x30(%rsp), %rdi
movq %r13, %rsi
pushq $0x9
popq %rdx
pushq $0x1
popq %rcx
callq 0x29cba
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %r14
cmpq %r14, %rbx
je 0x51034
movq %r12, %rdi
movq %rbx, %rsi
callq 0x552b0
movq 0x20(%rsp), %rdi
movq %r12, %rsi
callq 0x5528e
movq %r12, %rdi
callq 0x552f8
addq $0x20, %rbx
jmp 0x51009
leaq 0x30(%rsp), %rdi
callq 0x20bee
movq 0x10(%rsp), %rax
movq 0x30(%rax), %rbx
movq 0x38(%rax), %r14
callq 0xb060
andl $0x0, (%rax)
cmpq %r14, %rbx
je 0x513dc
cmpb $0x0, 0x2c(%rsp)
je 0x51091
cmpb $0x23, %r15b
leaq 0x1c0(%rsp), %rbx
je 0x50f49
movq 0x10(%rsp), %rax
cmpb $0x0, 0x28(%rax)
jne 0x510eb
leaq 0x1c0(%rsp), %rdi
callq 0x219d4
movl %eax, %ebp
jmp 0x510eb
subq %rbx, %r14
sarq $0x7, %r14
xorl %r12d, %r12d
leaq 0x120(%rsp), %rbx
subq $0x1, %r14
jb 0x510e2
leaq 0x1(%r12), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1c047
movq 0x20(%rsp), %rdi
movq %r12, %rsi
callq 0x55318
addq $0x8, %rax
movq %rax, %rdi
movq %rbx, %rsi
callq 0xb6f0
movq %rbx, %rdi
callq 0xbb68
movq %r15, %r12
jmp 0x510a3
movq 0x10(%rsp), %rax
movb $0x1, 0x28(%rax)
movq 0x10(%rsp), %rcx
movq 0x30(%rcx), %rax
cmpq 0x38(%rcx), %rax
je 0x51588
leaq 0x1c0(%rsp), %r15
leaq 0x120(%rsp), %r12
leaq 0x339e3(%rip), %rbx     # 0x84af8
testb $0x1, %bpl
je 0x511bf
movq %r13, %rdi
callq 0x235ab
cmpq $0x0, 0x430(%rsp)
je 0x511b0
movq %r12, %rdi
movq %r13, %rsi
pushq $0x9
popq %rdx
pushq $0x1
popq %rcx
callq 0x29cba
movq 0x128(%rsp), %r14
subq 0x120(%rsp), %r14
sarq $0x5, %r14
movq 0x10(%rsp), %rax
movq 0x38(%rax), %rbp
subq 0x30(%rax), %rbp
sarq $0x7, %rbp
cmpq %rbp, %r14
jae 0x5117d
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1d1d0
incq %r14
jmp 0x51168
movq 0x50(%rsp), %rdi
movq %r12, %rsi
callq 0x55382
callq 0xb060
andl $0x0, (%rax)
movq 0x120(%rsp), %rax
cmpq 0x128(%rsp), %rax
jne 0x51302
movq %r12, %rdi
callq 0x20bee
movq %r15, %rdi
callq 0x219d4
movl %eax, %ebp
jmp 0x51115
leaq 0x1c0(%rsp), %rdi
callq 0x1d368
movq 0xf8(%rsp), %rsi
cmpq $0x0, 0x8(%rsi)
je 0x512e6
leaq 0x1c0(%rsp), %rdi
xorl %edx, %edx
callq 0x1d20a
leaq 0x130(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x428(%rsp), %r15
leaq 0x1c0(%rsp), %r12
leaq 0x120(%rsp), %r13
movq %r12, %rdi
callq 0x219d4
testb %al, %al
je 0x512cc
movq %r15, %rdi
callq 0x3c32f
cmpq $0x0, 0x430(%rsp)
je 0x512a3
cmpq $0x0, 0x128(%rsp)
je 0x512bc
movq %r13, %rdi
movq %r15, %rsi
callq 0x1d401
testb %al, %al
je 0x5121a
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x5182a
movq %rax, %rbx
cmpq $-0x1, %rax
je 0x5121a
movq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x553a2
testb %al, %al
jne 0x514c1
movq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x55318
addq $0x8, %rax
movq %rax, %rdi
movq %r13, %rsi
callq 0xb350
jmp 0x5121a
andq $0x0, 0x128(%rsp)
movq 0x120(%rsp), %rax
movb $0x0, (%rax)
jmp 0x5121a
movq %r13, %rdi
movq %r15, %rsi
callq 0xb350
jmp 0x5121a
leaq 0x120(%rsp), %rdi
callq 0xbb68
leaq 0x1c0(%rsp), %rdi
callq 0x1d368
movq 0x10(%rsp), %rdi
callq 0x51882
addq $0x468, %rsp            # imm = 0x468
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xb6c0
testl %eax, %eax
jne 0x514b9
leaq 0xe293(%rip), %rsi      # 0x5f5a9
leaq 0x78(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x1b7b6
leaq 0x58(%rsp), %rdi
movl $0xc6, %esi
callq 0x1caa3
leaq 0x98(%rsp), %rdi
leaq 0x78(%rsp), %rsi
leaq 0x58(%rsp), %rdx
callq 0x1ca3c
leaq 0x8891(%rip), %rdx      # 0x59be3
leaq 0xb8(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x1b92d
leaq 0xe282(%rip), %rsi      # 0x5f5f0
leaq 0x1a0(%rsp), %rdi
leaq 0x1f(%rsp), %rdx
callq 0x1b7b6
leaq 0xa5b7(%rip), %rdx      # 0x5b93e
leaq 0x100(%rsp), %rdi
leaq 0x1a0(%rsp), %rsi
callq 0x1b92d
leaq 0xd8(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
leaq 0x100(%rsp), %rdx
callq 0x1ca3c
leaq 0xe2ac(%rip), %rdx      # 0x5f66c
leaq 0x30(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x1b92d
leaq 0x30(%rsp), %rdi
callq 0x224fc
callq 0xb6c0
testl %eax, %eax
jne 0x514b9
leaq 0xe1b9(%rip), %rsi      # 0x5f5a9
leaq 0x98(%rsp), %rdi
leaq 0x1a0(%rsp), %rdx
callq 0x1b7b6
leaq 0x78(%rsp), %rdi
movl $0xa6, %esi
callq 0x1caa3
leaq 0xb8(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0x78(%rsp), %rdx
callq 0x1ca3c
leaq 0x87ae(%rip), %rdx      # 0x59be3
leaq 0xd8(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x1b92d
leaq 0xe19f(%rip), %rsi      # 0x5f5f0
leaq 0x100(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x1b7b6
leaq 0xa4d4(%rip), %rdx      # 0x5b93e
leaq 0x58(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x1b92d
leaq 0x30(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
leaq 0x58(%rsp), %rdx
callq 0x1ca3c
leaq 0xe1a2(%rip), %rdx      # 0x5f63c
leaq 0x120(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x1b92d
leaq 0x120(%rsp), %rdi
callq 0x224fc
pushq $0x1
popq %rdi
callq 0xb6d0
pushq $0x10
popq %rdi
callq 0xb300
movq %rax, %r13
movq 0x10(%rsp), %rax
leaq 0x8(%rax), %rsi
leaq 0x78(%rsp), %rdi
pushq $0x22
popq %rdx
callq 0x243b1
leaq 0xe191(%rip), %rsi      # 0x5f67a
leaq 0x98(%rsp), %rdi
leaq 0x78(%rsp), %rdx
callq 0x1b94c
leaq 0xe17f(%rip), %rdx      # 0x5f681
leaq 0xb8(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x1b92d
leaq 0x58(%rsp), %rdi
leaq 0x120(%rsp), %rsi
pushq $0x22
popq %rdx
callq 0x243b1
leaq 0xd8(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
leaq 0x58(%rsp), %rdx
callq 0x1ca3c
leaq 0xe13e(%rip), %rdx      # 0x5f68b
leaq 0x30(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x1b92d
movb $0x1, %bl
leaq 0x30(%rsp), %rsi
movq %r13, %rdi
callq 0xb940
xorl %ebx, %ebx
movq 0x32a71(%rip), %rsi     # 0x83fe8
movq 0x329e2(%rip), %rdx     # 0x83f60
movq %r13, %rdi
callq 0xb9d0
jmp 0x515dc
pushq $0x10
popq %rdi
callq 0xb300
movq %rax, %rbx
leaq 0xe0b5(%rip), %rsi      # 0x5f64f
leaq 0x120(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x1b7b6
movb $0x1, %bpl
leaq 0x120(%rsp), %rdx
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
callq 0x20ac0
xorl %ebp, %ebp
leaq 0x313cb(%rip), %rsi     # 0x82998
movq 0x3299c(%rip), %rdx     # 0x83f70
movq %rbx, %rdi
callq 0xb9d0
movq %rax, %r12
leaq 0x120(%rsp), %rdi
callq 0xbb68
jmp 0x515f1
movq %rax, %r12
leaq 0x30(%rsp), %rdi
callq 0xbb68
jmp 0x51600
movq %rax, %r12
leaq 0x58(%rsp), %rdi
callq 0xbb68
jmp 0x51653
movq %rax, %r12
leaq 0x30(%rsp), %rdi
callq 0xbb68
jmp 0x51620
movq %rax, %r12
movb $0x1, %bl
leaq 0xd8(%rsp), %rdi
callq 0xbb68
jmp 0x51667
movq %rax, %r12
leaq 0x30(%rsp), %rdi
callq 0xbb68
jmp 0x51641
movq %rax, %r12
leaq 0xd8(%rsp), %rdi
callq 0xbb68
jmp 0x51676
movq %rax, %r12
leaq 0x100(%rsp), %rdi
callq 0xbb68
jmp 0x5168d
movq %rax, %r12
movb $0x1, %bl
leaq 0x58(%rsp), %rdi
callq 0xbb68
jmp 0x516a1
movq %rax, %r12
leaq 0x100(%rsp), %rdi
callq 0xbb68
jmp 0x516b3
jmp 0x517c6
movq %rax, %r12
leaq 0xd8(%rsp), %rdi
callq 0xbb68
jmp 0x516c5
movq %rax, %r12
movb $0x1, %bl
leaq 0xb8(%rsp), %rdi
callq 0xbb68
jmp 0x516d9
movq %rax, %r12
leaq 0x1a0(%rsp), %rdi
callq 0xbb68
jmp 0x516eb
movq %rax, %r12
leaq 0xb8(%rsp), %rdi
callq 0xbb68
jmp 0x516fd
movq %rax, %r12
movb $0x1, %bl
leaq 0x98(%rsp), %rdi
callq 0xbb68
jmp 0x51738
movq %rax, %r12
leaq 0xb8(%rsp), %rdi
callq 0xbb68
jmp 0x5174b
movq %rax, %r12
leaq 0x78(%rsp), %rdi
callq 0xbb68
jmp 0x51761
movq %rax, %r12
leaq 0x120(%rsp), %rdi
callq 0xbb68
testb %bpl, %bpl
jne 0x51726
jmp 0x517f7
movq %rax, %r12
movq %rbx, %rdi
callq 0xb470
jmp 0x517f7
movq %rax, %r12
movb $0x1, %bl
leaq 0x78(%rsp), %rdi
callq 0xbb68
testb %bl, %bl
jne 0x51776
jmp 0x517b5
movq %rax, %r12
leaq 0x98(%rsp), %rdi
callq 0xbb68
jmp 0x51783
jmp 0x5176b
jmp 0x5176b
movq %rax, %r12
leaq 0x98(%rsp), %rdi
jmp 0x517bd
movq %rax, %r12
jmp 0x51804
movq %rax, %r12
movq %r13, %rdi
callq 0xb470
jmp 0x517b5
movq %rax, %r12
leaq 0x58(%rsp), %rdi
callq 0xbb68
jmp 0x51794
jmp 0x517c6
movq %rax, %r12
leaq 0x78(%rsp), %rdi
callq 0xbb68
jmp 0x517ea
jmp 0x517c6
jmp 0x517b2
jmp 0x517e7
jmp 0x517c6
jmp 0x517c6
jmp 0x517b2
jmp 0x517b2
jmp 0x517e7
jmp 0x517c6
movq %rax, %r12
leaq 0x120(%rsp), %rdi
callq 0xbb68
jmp 0x517f7
jmp 0x517c6
movq %rax, %r12
jmp 0x517f7
movq %rax, %r12
jmp 0x517e0
movq %rax, %r12
leaq 0x120(%rsp), %rdi
callq 0x552f8
leaq 0x30(%rsp), %rdi
jmp 0x517f2
movq %rax, %r12
leaq 0x120(%rsp), %rdi
callq 0x20bee
leaq 0x1c0(%rsp), %rdi
callq 0x1d368
movq 0x50(%rsp), %rdi
callq 0x20a04
movq 0x20(%rsp), %rdi
callq 0x20a26
movq 0x10(%rsp), %rdi
callq 0x1bfc2
movq %r12, %rdi
callq 0xba30