// File: /workspace/github_cpp_makefile_star2_O1/ncbi[P]amr/fasta2parts.cpp
// Function: (anonymous namespace)::ThisApplication::body() const
void body () const final
  {
    const string fName     =               getArg ("in");
    const size_t parts_max = str2<size_t> (getArg ("parts_max"));
    const string dirName   =               getArg ("dir");
    
    if (parts_max <= 1)
      throw runtime_error ("Number of parts must be >= 2");
      

    const size_t chunk_min = (size_t) getFileSize (fName) / parts_max + 1;

    size_t part = 0;
    unique_ptr<OFStream> out;
    size_t seqSize = 0;
    LineInput f (fName); 
    while (f. nextLine ())
    {
      trimTrailing (f. line);
      if (f. line. empty ())
      	continue;
    	if (   f. line [0] == '>'
    	    && seqSize >= chunk_min
    	    && part < parts_max
    	   )
    	{
    	  out. reset ();
    	  seqSize = 0;
    	}
    	if (! out. get ())
    	{
    	  part++;
    	  ASSERT (part <= parts_max);
    	  out. reset (new OFStream (dirName, toString (part), ""));
    	}
   		*out << f. line << endl;
   		seqSize += f. line. size ();
	  }
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdi, %rbx
leaq 0x170(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x47e82(%rip), %rsi     # 0x5204b
leaq 0x47e7d(%rip), %rdx     # 0x5204d
leaq 0x160(%rsp), %rdi
callq 0xaf52
leaq 0xa0(%rsp), %rdi
leaq 0x160(%rsp), %rdx
movq %rbx, %rsi
callq 0x321d0
movq 0x160(%rsp), %rdi
cmpq %r15, %rdi
je 0xa212
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x9530
leaq 0x48(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x48032(%rip), %rsi     # 0x52255
leaq 0x48034(%rip), %rdx     # 0x5225e
leaq 0x38(%rsp), %rdi
callq 0xaf52
leaq 0x160(%rsp), %rdi
leaq 0x38(%rsp), %rdx
movq %rbx, %rsi
callq 0x321d0
leaq 0x160(%rsp), %rdi
callq 0xb355
movq %rax, %r14
movq 0x160(%rsp), %rdi
cmpq %r15, %rdi
je 0xa276
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x9530
movq 0x38(%rsp), %rdi
cmpq %r12, %rdi
je 0xa28d
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x9530
leaq 0x160(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x47dd6(%rip), %rsi     # 0x52075
leaq 0x47dd2(%rip), %rdx     # 0x52078
callq 0xaf52
leaq 0x38(%rsp), %rdi
leaq 0x160(%rsp), %rdx
movq %rbx, %rsi
callq 0x321d0
movq 0x160(%rsp), %rdi
cmpq %r15, %rdi
je 0xa2dd
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x9530
cmpq $0x1, %r14
jbe 0xa60b
leaq 0xa0(%rsp), %rdi
callq 0x129f6
xorl %edx, %edx
divq %r14
movq %rax, 0x78(%rsp)
movq $0x0, 0x10(%rsp)
leaq 0x160(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
xorl %edx, %edx
callq 0xb90a
leaq 0x5f68b(%rip), %rax     # 0x699b0
leaq 0x3c8(%rsp), %r12
movq %rax, -0x268(%r12)
movl $0x0, -0x8(%r12)
leaq 0x3d8(%rsp), %rax
movq %rax, -0x10(%rax)
xorl %ebx, %ebx
movq %rbx, -0x8(%rax)
movb %bl, (%rax)
leaq 0x3f8(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rbx, -0x8(%rax)
movb %bl, (%rax)
leaq 0x160(%rsp), %r13
xorl %r15d, %r15d
movq %r13, %rdi
callq 0xc2c6
testb %al, %al
je 0xa4e2
movq %r12, %rdi
callq 0xf982
cmpq $0x0, 0x3d0(%rsp)
je 0xa36f
movq 0x3c8(%rsp), %rax
cmpb $0x3e, (%rax)
jne 0xa3cd
cmpq 0x78(%rsp), %r15
jbe 0xa3cd
cmpq %r14, 0x10(%rsp)
jae 0xa3cd
movl $0x0, %edi
movl $0x0, %r15d
testq %rbx, %rbx
je 0xa3d0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
xorl %edi, %edi
xorl %r15d, %r15d
jmp 0xa3d0
movq %rbx, %rdi
testq %rdi, %rdi
jne 0xa48c
movq %rdi, 0x8(%rsp)
movq 0x10(%rsp), %rbx
incq %rbx
movq %rbx, 0x10(%rsp)
callq 0x9070
movl $0x0, (%rax)
cmpq %r14, %rbx
ja 0xa63d
movl $0x200, %edi            # imm = 0x200
callq 0x9520
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xb679
leaq 0x68(%rsp), %rax
movq %rax, 0x58(%rsp)
leaq 0x58(%rsp), %rbp
movq %rbp, %rdi
leaq 0x4a35c(%rip), %rdx     # 0x54790
movq %rdx, %rsi
callq 0xaf52
movq %rbx, %rdi
leaq 0x38(%rsp), %rsi
leaq 0x18(%rsp), %rdx
movq %rbp, %rcx
callq 0xb702
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0xa46d
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x9530
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0xa489
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x9530
movq %rbx, %rdi
movq 0x3c8(%rsp), %rsi
movq 0x3d0(%rsp), %rdx
movq %rdi, 0x8(%rsp)
callq 0x95d0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x9500
movsbl %al, %esi
movq %rbx, %rdi
callq 0x9040
movq %rax, %rdi
callq 0x93c0
addq 0x3d0(%rsp), %r15
movq 0x8(%rsp), %rbx
jmp 0xa36f
leaq 0x5f4c7(%rip), %rax     # 0x699b0
movq %rax, 0x160(%rsp)
movq 0x3e8(%rsp), %rdi
leaq 0x3f8(%rsp), %rax
cmpq %rax, %rdi
je 0xa516
movq 0x3f8(%rsp), %rsi
incq %rsi
callq 0x9530
movq 0x3c8(%rsp), %rdi
leaq 0x3d8(%rsp), %rax
cmpq %rax, %rdi
leaq 0x48(%rsp), %r12
je 0xa540
movq 0x3d8(%rsp), %rsi
incq %rsi
callq 0x9530
leaq 0x5f521(%rip), %rax     # 0x69a68
leaq 0x380(%rsp), %r14
movq %rax, -0x220(%r14)
movq %r14, %rdi
callq 0x1c036
leaq 0x5f563(%rip), %rax     # 0x69ac8
movq %rax, -0x218(%r14)
leaq 0x268(%rsp), %r14
leaq 0x5f575(%rip), %rax     # 0x69af0
movq %rax, (%r14)
leaq 0x178(%rsp), %r15
movq %r15, %rdi
callq 0x9460
leaq 0x5f583(%rip), %rax     # 0x69b18
movq %rax, -0x10(%r15)
leaq 0x5f5a0(%rip), %rax     # 0x69b40
movq %rax, (%r14)
movq $0x0, -0x8(%r15)
movq %r14, %rdi
callq 0x91b0
testq %rbx, %rbx
je 0xa5c1
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movq 0x38(%rsp), %rdi
cmpq %r12, %rdi
je 0xa5d8
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x9530
leaq 0xb0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xa5f9
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x9530
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x92a0
movq %rax, %rbx
leaq 0x47bb0(%rip), %rsi     # 0x521cf
movq %rax, %rdi
callq 0x9220
movq 0x609c2(%rip), %rsi     # 0x6aff0
movq 0x6093b(%rip), %rdx     # 0x6af70
movq %rbx, %rdi
callq 0x9900
callq 0x9640
testl %eax, %eax
jne 0xa6d8
leaq 0x110(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x47b8f(%rip), %rsi     # 0x521ec
leaq 0x47ba0(%rip), %rdx     # 0x52204
leaq 0x100(%rsp), %rdi
callq 0xaf52
leaq 0x120(%rsp), %rdi
movl $0x5e, %esi
callq 0xb5d7
leaq 0x140(%rsp), %rdi
leaq 0x100(%rsp), %rsi
leaq 0x120(%rsp), %rdx
callq 0xb52f
leaq 0x47b5e(%rip), %rsi     # 0x52205
leaq 0x140(%rsp), %rdi
callq 0x9a00
leaq 0x90(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0xa6e2
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0xa6f5
movl $0x1, %edi
callq 0x9650
movq %rdx, 0x80(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x90(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x88(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xf0(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x47ae7(%rip), %rsi     # 0x5220b
leaq 0x47b21(%rip), %rdx     # 0x5224c
leaq 0xe0(%rsp), %rdi
callq 0xaf52
leaq 0x48062(%rip), %rsi     # 0x527a1
leaq 0xe0(%rsp), %rdi
callq 0x9a00
leaq 0xd0(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0xa771
movups (%rcx), %xmm0
movups %xmm0, (%r13)
jmp 0xa784
movq %rdx, 0xc0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xd0(%rsp)
movq 0x8(%rax), %rsi
leaq 0xc0(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x58(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0xb52f
leaq 0x47a91(%rip), %rsi     # 0x5224d
leaq 0x58(%rsp), %rdi
callq 0x9a00
leaq 0x28(%rsp), %rcx
movq %rcx, 0x18(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0xa7ec
movups (%rcx), %xmm0
leaq 0x28(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0xa7f9
movq %rdx, 0x18(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x28(%rsp)
movq 0x8(%rax), %rdx
leaq 0x18(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0xd6d7
movq %rax, %r14
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0xa83e
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x9530
jmp 0xa83e
movq %rax, %r14
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0xa85f
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x9530
jmp 0xa85f
movq %rax, %r14
movq 0xc0(%rsp), %rdi
cmpq %r13, %rdi
je 0xa881
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x9530
jmp 0xa881
movq %rax, %r14
movq 0xe0(%rsp), %rdi
cmpq %r12, %rdi
je 0xa8a3
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x9530
jmp 0xa8a3
movq %rax, %r14
movq 0x80(%rsp), %rdi
cmpq %r15, %rdi
je 0xa8c5
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x9530
jmp 0xa8c5
movq %rax, %r14
leaq 0x150(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xa8eb
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x9530
jmp 0xa8eb
movq %rax, %r14
leaq 0x130(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xa911
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x9530
jmp 0xa911
movq %rax, %r14
movq 0x100(%rsp), %rdi
cmpq %rbx, %rdi
je 0xaa3b
movq 0x110(%rsp), %rsi
incq %rsi
jmp 0xa981
jmp 0xaa2e
movq %rax, %r14
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0xa95d
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x9530
jmp 0xa95d
movq %rax, %r14
jmp 0xa979
movq %rax, %r14
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0xa979
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x9530
movl $0x200, %esi            # imm = 0x200
movq %rbx, %rdi
callq 0x9530
jmp 0xaa3b
jmp 0xa9ae
movq %rax, %r14
movq %rbx, %rdi
callq 0x9400
jmp 0xaa5b
movq %rax, %r14
movq $0x0, 0x8(%rsp)
jmp 0xaa48
movq %rax, %r14
jmp 0xaa5b
movq %rax, %r14
movq 0x160(%rsp), %rdi
cmpq %r15, %rdi
je 0xaa77
movq 0x170(%rsp), %rsi
jmp 0xaa6f
jmp 0xaa0a
movq %rax, %r14
movq 0x160(%rsp), %rdi
cmpq %r15, %rdi
je 0xa9fe
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x9530
jmp 0xa9fe
movq %rax, %r14
movq 0x38(%rsp), %rdi
cmpq %r12, %rdi
jne 0xaa6a
jmp 0xaa77
movq %rax, %r14
jmp 0xaa77
movq %rax, %r14
movq 0x160(%rsp), %rdi
cmpq %r15, %rdi
je 0xaa98
movq 0x170(%rsp), %rsi
jmp 0xaa90
movq %rax, %r14
jmp 0xaa98
movq %rax, %r14
jmp 0xaa3b
movq %rax, %r14
movq %rbx, 0x8(%rsp)
leaq 0x160(%rsp), %rdi
callq 0xb7de
cmpq $0x0, 0x8(%rsp)
je 0xaa5b
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0xaa77
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x9530
leaq 0xb0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaa98
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x9530
movq %r14, %rdi
callq 0x9950