// File: /workspace/github_cpp_makefile_star2_O2/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, %r14
leaq 0x2e120(%rip), %rsi     # 0x3904b
leaq 0x160(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0xb4b6
leaq 0x80(%rsp), %rdi
leaq 0x160(%rsp), %rdx
movq %r14, %rsi
callq 0x20f70
leaq 0x160(%rsp), %rdi
callq 0xaab8
leaq 0x2e2ec(%rip), %rsi     # 0x39255
leaq 0x18(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0xb4b6
leaq 0x160(%rsp), %rdi
leaq 0x18(%rsp), %rdx
movq %r14, %rsi
callq 0x20f70
leaq 0x160(%rsp), %rdi
callq 0xba73
movq %rax, %rbx
leaq 0x160(%rsp), %rdi
callq 0xaab8
leaq 0x18(%rsp), %rdi
callq 0xaab8
leaq 0x2e0ba(%rip), %rsi     # 0x39075
leaq 0x160(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0xb4b6
leaq 0x18(%rsp), %rdi
leaq 0x160(%rsp), %rdx
movq %r14, %rsi
callq 0x20f70
leaq 0x160(%rsp), %rdi
callq 0xaab8
cmpq $0x1, %rbx
jbe 0xb19f
leaq 0x80(%rsp), %rdi
callq 0xfab2
xorl %edx, %edx
movq %rbx, 0x10(%rsp)
divq %rbx
movq %rax, 0x38(%rsp)
andq $0x0, 0x8(%rsp)
leaq 0x160(%rsp), %rdi
leaq 0x80(%rsp), %rsi
xorl %edx, %edx
callq 0xbbac
leaq 0x3c8(%rsp), %r15
xorl %r13d, %r13d
leaq 0x160(%rsp), %r12
xorl %r14d, %r14d
movq %r12, %rdi
callq 0xc358
testb %al, %al
je 0xb15a
movq %r15, %rdi
callq 0xdf2f
cmpq $0x0, 0x3d0(%rsp)
je 0xb048
movq 0x3c8(%rsp), %rax
cmpb $0x3e, (%rax)
sete %al
cmpq 0x38(%rsp), %r14
seta %cl
movq 0x8(%rsp), %rbp
cmpq 0x10(%rsp), %rbp
setb %dl
andb %cl, %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0xb0b0
testq %r13, %r13
je 0xb0ab
movq (%r13), %rax
movq %r13, %rdi
callq *0x8(%rax)
movq 0x8(%rsp), %rbp
xorl %r14d, %r14d
jmp 0xb0b9
testq %r13, %r13
jne 0xb13a
incq %rbp
movq %rbp, 0x8(%rsp)
callq 0xa060
andl $0x0, (%rax)
cmpq 0x10(%rsp), %rbp
ja 0xb1cf
movl $0x200, %edi            # imm = 0x200
xorl %r13d, %r13d
callq 0xa540
movq %rax, %rbp
leaq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xbce1
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
leaq 0x306a3(%rip), %rsi     # 0x3b7a5
leaq 0xa0(%rsp), %rdx
callq 0xb4b6
movq %rbp, %rdi
leaq 0x18(%rsp), %rsi
leaq 0x40(%rsp), %r13
movq %r13, %rdx
movq %rbx, %rcx
callq 0xbd48
movq %rbx, %rdi
callq 0xaab8
movq %r13, %rdi
callq 0xaab8
movq %rbp, %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0xa4d0
movq %rax, %rdi
callq 0xa2d0
addq 0x3d0(%rsp), %r14
jmp 0xb048
leaq 0x160(%rsp), %rdi
callq 0xbdd6
testq %r13, %r13
je 0xb176
movq (%r13), %rax
movq %r13, %rdi
callq *0x8(%rax)
leaq 0x18(%rsp), %rdi
callq 0xaab8
leaq 0x80(%rsp), %rdi
callq 0xaab8
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0xa2e0
movq %rax, %r14
leaq 0x2e01e(%rip), %rsi     # 0x391cf
movq %rax, %rdi
callq 0xa250
movq 0x49e28(%rip), %rsi     # 0x54fe8
movq 0x49da1(%rip), %rdx     # 0x54f68
movq %r14, %rdi
callq 0xa930
callq 0xa660
testl %eax, %eax
jne 0xb2ad
leaq 0x2e009(%rip), %rsi     # 0x391ec
leaq 0x120(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0xb4b6
leaq 0x100(%rsp), %rdi
pushq $0x5e
popq %rsi
callq 0xbc88
leaq 0x140(%rsp), %rdi
leaq 0x120(%rsp), %rsi
leaq 0x100(%rsp), %rdx
callq 0xbc21
leaq 0x2dfdc(%rip), %rdx     # 0x39205
leaq 0xa0(%rsp), %rdi
leaq 0x140(%rsp), %rsi
callq 0xbc02
leaq 0x2dfc6(%rip), %rsi     # 0x3920b
leaq 0xc0(%rsp), %rdi
leaq 0x6(%rsp), %rdx
callq 0xb4b6
leaq 0x2e56e(%rip), %rdx     # 0x397cc
leaq 0xe0(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0xbc02
leaq 0x60(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
leaq 0xe0(%rsp), %rdx
callq 0xbc21
leaq 0x2dfb9(%rip), %rdx     # 0x3924d
leaq 0x40(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0xbc02
leaq 0x40(%rsp), %rdi
callq 0xce80
pushq $0x1
popq %rdi
callq 0xa670
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0xaab8
jmp 0xb2c7
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0xaab8
jmp 0xb2d6
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0xaab8
jmp 0xb2e8
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0xaab8
jmp 0xb2fa
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xaab8
jmp 0xb30c
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
callq 0xaab8
jmp 0xb31e
movq %rax, %rbx
leaq 0x100(%rsp), %rdi
callq 0xaab8
jmp 0xb330
movq %rax, %rbx
leaq 0x120(%rsp), %rdi
callq 0xaab8
jmp 0xb384
movq %rax, %rbx
jmp 0xb384
jmp 0xb3ae
movq %rax, %rbx
movq %r14, %rdi
callq 0xa430
jmp 0xb3eb
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0xaab8
jmp 0xb368
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0xaab8
jmp 0xb377
movq %rax, %rbx
movl $0x200, %esi            # imm = 0x200
movq %rbp, %rdi
callq 0xa550
xorl %r13d, %r13d
jmp 0xb3cf
jmp 0xb3ae
jmp 0xb3ae
movq %rax, %rbx
leaq 0x160(%rsp), %rdi
jmp 0xb3f0
jmp 0xb3b3
movq %rax, %rbx
leaq 0x160(%rsp), %rdi
callq 0xaab8
jmp 0xb3eb
movq %rax, %rbx
jmp 0xb3eb
movq %rax, %rbx
jmp 0xb3f5
movq %rax, %rbx
leaq 0x160(%rsp), %rdi
jmp 0xb3fd
movq %rax, %rbx
jmp 0xb402
jmp 0xb3cc
movq %rax, %rbx
leaq 0x160(%rsp), %rdi
callq 0xbdd6
testq %r13, %r13
je 0xb3eb
movq (%r13), %rax
movq %r13, %rdi
callq *0x8(%rax)
leaq 0x18(%rsp), %rdi
callq 0xaab8
leaq 0x80(%rsp), %rdi
callq 0xaab8
movq %rbx, %rdi
callq 0xa980