// File: /workspace/github_cpp_makefile_star2_O2/ncbi[P]amr/mutate.cpp
// Function: (anonymous namespace)::ThisApplication::body() const
void body () const final
  {
	  const string inFName  = getArg ("in");
	  const string mutFName = getArg ("mut");
	  const bool aa         = getFlag ("aa");
	  const bool orig       = getFlag ("orig");
  
  
    map <string/*seqId*/,Vector<AmrMutation>> id2mutation;
    {
      LineInput in (mutFName);
      Istringstream iss;
      while (in. nextLine ())
      {
        iss. reset (in. line);
        string seqId;
        size_t pos;
        string mutation_std;
        string mutation_report;
        iss >> seqId >> pos >> mutation_std >> mutation_report;
        QC_ASSERT (! mutation_report. empty ());
        AmrMutation mut (pos, mutation_std, mutation_report, "X", "X", "X");
        mut. qc ();
        id2mutation [seqId] << std::move (mut);
      }
    }
  
  
	  Multifasta fIn (inFName, aa);
	  while (fIn. next ())
	  {
 	    unique_ptr<const Seq> seq;
	    try
  	  {
  	    if (aa)
  	    {
  	      auto pep = new Peptide (fIn, 1000, false);  // PAR
  	      pep->pseudo = true;
  	      seq. reset (pep);  
  	    }
  	    else
  	      seq. reset (new Dna     (fIn, 100000, false));  // PAR
  	    seq->qc ();
  	    if (orig)
  	      seq->saveText (cout);
  	    if (const Vector<AmrMutation>* muts = findPtr (id2mutation, seq->getId ()))
  	      for (const AmrMutation& mut : *muts)
    	    {
    	      unique_ptr<Seq> seq1 (seq->copy ());
    	      mut. apply (seq1->seq);
    	      if (! aa)
    	        strLower (seq1->seq);
      	    seq1->name += ":" + to_string (mut. pos_real + 1) + ":" + mut. geneMutation;
      	    seq1->qc ();
      	    seq1->saveText (cout);
    	    }
  	  }
  	  catch (const exception &e)
  	  {
  	    if (seq)
  	      throw runtime_error (seq->name + "\n" + e. what ());
  	    throw;
  	  }
  	}
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x788, %rsp            # imm = 0x788
movq %rdi, %rbx
leaq 0x56578(%rip), %rsi     # 0x636c1
leaq 0x490(%rsp), %rdi
leaq 0x1e8(%rsp), %rdx
callq 0xdbbe
leaq 0x178(%rsp), %rdi
leaq 0x490(%rsp), %rdx
movq %rbx, %rsi
callq 0x242c0
leaq 0x490(%rsp), %rdi
callq 0xcbe8
leaq 0x50e9f(%rip), %rsi     # 0x5e029
leaq 0x490(%rsp), %rdi
leaq 0x1e8(%rsp), %rdx
callq 0xdbbe
leaq 0x158(%rsp), %rdi
leaq 0x490(%rsp), %rdx
movq %rbx, %rsi
callq 0x242c0
leaq 0x490(%rsp), %rdi
callq 0xcbe8
leaq 0x56206(%rip), %rsi     # 0x633d1
leaq 0x490(%rsp), %rdi
leaq 0x1e8(%rsp), %rdx
callq 0xdbbe
leaq 0x490(%rsp), %rsi
movq %rbx, %rdi
callq 0x243cc
movb %al, 0x16(%rsp)
leaq 0x490(%rsp), %rdi
callq 0xcbe8
leaq 0x50e7c(%rip), %rsi     # 0x5e084
leaq 0x490(%rsp), %rdi
leaq 0x1e8(%rsp), %rdx
callq 0xdbbe
leaq 0x490(%rsp), %rsi
movq %rbx, %rdi
callq 0x243cc
movb %al, 0x17(%rsp)
leaq 0x490(%rsp), %rdi
callq 0xcbe8
leaq 0x1a0(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0x490(%rsp), %rdi
leaq 0x158(%rsp), %rsi
xorl %edx, %edx
callq 0xe17c
leaq 0x1e8(%rsp), %rdi
callq 0xe1d2
leaq 0x50(%rsp), %rbx
leaq 0x78(%rsp), %r13
leaq 0xd8(%rsp), %r14
leaq 0x368(%rsp), %r12
leaq 0x490(%rsp), %rdi
callq 0xf6a8
testb %al, %al
je 0xd440
leaq 0x1e8(%rsp), %rdi
leaq 0x6f8(%rsp), %rsi
callq 0xe224
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
andq $0x0, 0x30(%rsp)
leaq 0x60(%rsp), %rax
movq %rax, 0x50(%rsp)
andq $0x0, 0x58(%rsp)
xorl %ecx, %ecx
movb %cl, 0x38(%rsp)
movb %cl, 0x60(%rsp)
leaq 0x88(%rsp), %rax
movq %rax, 0x78(%rsp)
andq $0x0, 0x80(%rsp)
movb %cl, 0x88(%rsp)
leaq 0x1e8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0xc760
movq %rax, %rdi
leaq 0x70(%rsp), %rsi
callq 0xc370
movq %rax, %rdi
movq %rbx, %rsi
callq 0xc760
movq %rax, %rdi
movq %r13, %rsi
callq 0xc760
movq %r13, %rbp
movq %rbx, %r13
callq 0xc070
andl $0x0, (%rax)
cmpq $0x0, 0x80(%rsp)
je 0xd6b3
movq 0x70(%rsp), %rbx
leaq 0xb8(%rsp), %rdi
leaq 0x5413a(%rip), %r15     # 0x614aa
movq %r15, %rsi
leaq 0x138(%rsp), %rdx
callq 0xdbbe
leaq 0x98(%rsp), %rdi
movq %r15, %rsi
leaq 0x118(%rsp), %rdx
callq 0xdbbe
movq %r14, %rdi
movq %r15, %rsi
leaq 0xf8(%rsp), %rdx
callq 0xdbbe
movq %r14, (%rsp)
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %rbx
movq %r13, %rdx
movq %rbp, %r13
movq %rbp, %rcx
leaq 0xb8(%rsp), %rbp
movq %rbp, %r8
leaq 0x98(%rsp), %r15
movq %r15, %r9
callq 0x3be1c
movq %r14, %rdi
callq 0xcbe8
movq %r15, %rdi
callq 0xcbe8
movq %rbp, %rdi
callq 0xcbe8
movq %r12, %rdi
callq 0x3d4ca
leaq 0x198(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0xe32e
movq %rax, %rdi
movq %r12, %rsi
callq 0xe394
movq %r12, %rdi
callq 0xe3be
movq %r13, %rdi
callq 0xcbe8
movq %rbx, %rdi
callq 0xcbe8
leaq 0x28(%rsp), %rdi
callq 0xcbe8
jmp 0xd299
leaq 0x1e8(%rsp), %rdi
callq 0xe41a
leaq 0x490(%rsp), %rdi
callq 0xe438
movzbl 0x16(%rsp), %edx
leaq 0x490(%rsp), %rdi
leaq 0x178(%rsp), %rsi
movl $0x3e8, %ecx            # imm = 0x3E8
callq 0xe468
leaq 0x490(%rsp), %r15
leaq 0x1e8(%rsp), %r12
leaq 0x50(%rsp), %rbx
movq %r15, %rdi
callq 0xe4e4
testb %al, %al
je 0xd66d
cmpb $0x0, 0x16(%rsp)
je 0xd4c9
pushq $0x50
popq %rdi
callq 0xc5b0
movq %rax, %r14
movl $0x3e8, %edx            # imm = 0x3E8
movq %rax, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x4f730
movb $0x1, 0x49(%r14)
jmp 0xd4ef
movq $0x0, 0x18(%rsp)
pushq $0x50
popq %rdi
callq 0xc5b0
movq %rax, %r14
movl $0x186a0, %edx          # imm = 0x186A0
movq %rax, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x49f12
movq (%r14), %rax
movq %r14, 0x18(%rsp)
movq %r14, %rdi
callq *0x18(%rax)
cmpb $0x0, 0x17(%rsp)
je 0xd516
movq 0x18(%rsp), %rdi
movq (%rdi), %rax
movq 0x7ba7d(%rip), %rsi     # 0x88f90
callq *0x20(%rax)
movq %r12, %rdi
movq 0x18(%rsp), %rsi
callq 0xe516
leaq 0x198(%rsp), %rdi
movq %r12, %rsi
callq 0xe4f7
movq %rax, %r15
movq %r12, %rdi
callq 0xcbe8
testq %r15, %r15
leaq 0x28(%rsp), %r12
je 0xd64d
movq (%r15), %r14
movq 0x8(%r15), %rax
movq %rax, 0x48(%rsp)
cmpq 0x48(%rsp), %r14
je 0xd64d
movq 0x18(%rsp), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq %rax, %r15
leaq 0x28(%rax), %rbp
movq %r14, %rdi
movq %rbp, %rsi
callq 0xe544
cmpb $0x0, 0x16(%rsp)
jne 0xd58f
movq %rbp, %rdi
callq 0x11c18
movq 0x8(%r14), %rsi
incq %rsi
movq %rbx, %rbp
movq %rbx, %rdi
callq 0xe83d
movq %r12, %rdi
movq %r12, %r13
leaq 0x5534d(%rip), %r12     # 0x628fb
movq %r12, %rsi
movq %rbp, %rdx
callq 0xe819
leaq 0x368(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0xe24f
addq $0xa8, %r14
leaq 0x1e8(%rsp), %r12
movq %r12, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0xe7fa
leaq 0x8(%r15), %rdi
movq %r12, %rsi
callq 0xcb70
movq %r12, %rdi
callq 0xcbe8
leaq 0x368(%rsp), %rdi
callq 0xcbe8
leaq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0xcbe8
movq %rbx, %rdi
callq 0xcbe8
movq (%r15), %rax
movq %r15, %rdi
callq *0x18(%rax)
movq (%r15), %rax
movq %r15, %rdi
movq 0x7b958(%rip), %rsi     # 0x88f90
callq *0x20(%rax)
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
subq $-0x80, %r14
jmp 0xd558
movq 0x18(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x490(%rsp), %r15
leaq 0x1e8(%rsp), %r12
jmp 0xd48e
leaq 0x490(%rsp), %rdi
callq 0xe8b8
leaq 0x198(%rsp), %rdi
callq 0xf31e
leaq 0x158(%rsp), %rdi
callq 0xcbe8
leaq 0x178(%rsp), %rdi
callq 0xcbe8
addq $0x788, %rsp            # imm = 0x788
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xc6d0
testl %eax, %eax
jne 0xd79d
leaq 0x50af6(%rip), %rsi     # 0x5e1bd
leaq 0x138(%rsp), %rdi
leaq 0x27(%rsp), %rdx
callq 0xdbbe
leaq 0x118(%rsp), %rdi
pushq $0x58
popq %rsi
callq 0xe2d5
leaq 0xd8(%rsp), %rdi
leaq 0x138(%rsp), %rsi
leaq 0x118(%rsp), %rdx
callq 0xe26e
leaq 0x50ac4(%rip), %rdx     # 0x5e1d1
leaq 0x98(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0xe24f
leaq 0x50aae(%rip), %rsi     # 0x5e1d7
leaq 0x1c8(%rsp), %rdi
leaq 0x26(%rsp), %rdx
callq 0xdbbe
leaq 0x5118a(%rip), %rdx     # 0x5e8cc
leaq 0xf8(%rsp), %rdi
leaq 0x1c8(%rsp), %rsi
callq 0xe24f
leaq 0xb8(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0xf8(%rsp), %rdx
callq 0xe26e
leaq 0x50a9e(%rip), %rdx     # 0x5e219
leaq 0x368(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0xe24f
leaq 0x368(%rsp), %rdi
callq 0x101d0
pushq $0x1
popq %rdi
callq 0xc6f0
movq %rax, %rbx
leaq 0x368(%rsp), %rdi
callq 0xcbe8
jmp 0xd7ba
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0xcbe8
jmp 0xd7cc
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0xcbe8
jmp 0xd7de
movq %rax, %rbx
leaq 0x1c8(%rsp), %rdi
callq 0xcbe8
jmp 0xd7f0
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0xcbe8
jmp 0xd802
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0xcbe8
jmp 0xd877
jmp 0xd81b
movq %rax, %rbx
jmp 0xd965
movq %rax, %rbx
jmp 0xdada
jmp 0xd827
jmp 0xd83c
movq %rax, %rbx
leaq 0x490(%rsp), %rdi
callq 0xcbe8
jmp 0xdae7
movq %rax, %rbx
jmp 0xdae7
movq %rax, %rbx
leaq 0x490(%rsp), %rdi
jmp 0xdaef
movq %rax, %rbx
jmp 0xdaf4
movq %rax, %rbx
leaq 0x490(%rsp), %rdi
jmp 0xdafc
movq %rax, %rbx
jmp 0xdb01
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0xcbe8
jmp 0xd889
movq %rax, %rbx
leaq 0x138(%rsp), %rdi
jmp 0xd90f
jmp 0xd937
movq %rdx, %r12
movq %rax, %rbx
jmp 0xd8b3
jmp 0xd8a2
movq %rdx, %r12
movq %rax, %rbx
pushq $0x50
popq %rsi
movq %r14, %rdi
callq 0xc5c0
movq $0x0, 0x18(%rsp)
jmp 0xd9e3
jmp 0xd977
movq %rdx, %r12
movq %rax, %rbx
leaq 0x1e8(%rsp), %rdi
callq 0xcbe8
jmp 0xd9e3
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0xcbe8
jmp 0xd8fa
movq %rax, %rbx
jmp 0xd907
jmp 0xd937
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0xcbe8
leaq 0xb8(%rsp), %rdi
callq 0xcbe8
jmp 0xd93a
movq %rax, %rbx
jmp 0xdacd
jmp 0xd977
movq %rax, %rbx
jmp 0xd958
movq %rax, %rbx
leaq 0x368(%rsp), %rdi
callq 0xe3be
jmp 0xd93a
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0xcbe8
leaq 0x50(%rsp), %rdi
callq 0xcbe8
leaq 0x28(%rsp), %rdi
callq 0xcbe8
leaq 0x1e8(%rsp), %rdi
callq 0xe41a
leaq 0x490(%rsp), %rdi
callq 0xe438
jmp 0xdada
movq %rdx, %r12
movq %rax, %rbx
jmp 0xd9e3
jmp 0xd9cf
movq %rdx, %r12
movq %rax, %rbx
jmp 0xd9c3
movq %rdx, %r12
movq %rax, %rbx
jmp 0xd9b9
movq %rdx, %r12
movq %rax, %rbx
jmp 0xd9ac
movq %rdx, %r12
movq %rax, %rbx
leaq 0x1e8(%rsp), %rdi
callq 0xcbe8
leaq 0x368(%rsp), %rdi
callq 0xcbe8
leaq 0x28(%rsp), %rdi
callq 0xcbe8
leaq 0x50(%rsp), %rdi
callq 0xcbe8
jmp 0xd9d5
movq %rdx, %r12
movq %rax, %rbx
testq %r15, %r15
je 0xd9e3
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
cmpl $0x1, %r12d
jne 0xda02
movq %rbx, %rdi
callq 0xc290
movq 0x18(%rsp), %r15
testq %r15, %r15
jne 0xda0c
callq 0xc880
jmp 0xda7e
movq 0x18(%rsp), %r15
jmp 0xdabf
movq %rax, %rbx
pushq $0x10
popq %rdi
callq 0xc310
movq %rax, %r14
leaq 0x8(%r15), %rsi
leaq 0x52e71(%rip), %rdx     # 0x60896
leaq 0x368(%rsp), %rdi
callq 0xe87f
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
leaq 0x1e8(%rsp), %rdi
leaq 0x368(%rsp), %rsi
movq %rax, %rdx
callq 0xe24f
movb $0x1, %bpl
leaq 0x1e8(%rsp), %rsi
movq %r14, %rdi
callq 0xc990
xorl %ebp, %ebp
movq 0x7b581(%rip), %rsi     # 0x88ff0
movq 0x7b4f2(%rip), %rdx     # 0x88f68
movq %r14, %rdi
callq 0xca40
movq %rax, %rbx
leaq 0x1e8(%rsp), %rdi
callq 0xcbe8
jmp 0xda96
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x368(%rsp), %rdi
callq 0xcbe8
testb %bpl, %bpl
jne 0xdaad
jmp 0xdaba
movq %rax, %rbx
movq %r14, %rdi
callq 0xc470
jmp 0xdaba
movq %rax, %rbx
callq 0xc9c0
testq %r15, %r15
je 0xdacd
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
leaq 0x490(%rsp), %rdi
callq 0xe8b8
leaq 0x198(%rsp), %rdi
callq 0xf31e
leaq 0x158(%rsp), %rdi
callq 0xcbe8
leaq 0x178(%rsp), %rdi
callq 0xcbe8
movq %rbx, %rdi
callq 0xcaa0
movq %rax, %rdi
callq 0xdf79
nop