// File: /workspace/github_cpp_makefile_star2_O2/Altius[P]hotspot2/src/resolveOverlapsInSummit-CenteredPeaks.cpp
// Function: parseInputWriteOutput()
bool parseInputWriteOutput(void)
{
  const int BUFSIZE(500000);
  char buf[BUFSIZE], *p;
  long linenum(0);

  while (cin.getline(buf, BUFSIZE))
    {
      list<Peak> Peaks;
      vector<string> vec; // this vector is used for parsing/extracting Peak data
      linenum++;
      if (!(p = strtok(buf, "|")))
	{
	  cerr << "Error:  Failed to find |-delimited input on line " << linenum
	       << " of the input file." << endl << endl;
	  return false;
	}
      while ((p = strtok(NULL, ";")))
	vec.push_back(string(p));
      for (int i = 0; i < static_cast<int>(vec.size()); i++)
	{
	  Peak d;
	  char s[1000];
	  strcpy(s,vec[i].c_str());
	  if (!PeakfromString(s, d))
	    return false;
	  Peaks.push_back(d);
	}
      resolveOverlaps(Peaks);
      for (list<Peak>::const_iterator it = Peaks.begin();
	   it != Peaks.end(); it++)
	cout << it->chrom << '\t'
	     << it->beg << '\t'
	     << it->end << '\t'
	     << it->id << '\t'
	     << it->score_string << endl; // write the score exactly as we received it (same # of digits, etc.)
    }
  
  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x7a5d8, %rsp          # imm = 0x7A5D8
xorl %r15d, %r15d
movq 0x3982(%rip), %rdi      # 0x5fd8
leaq 0x4b0(%rsp), %rbp
leaq 0xc0(%rsp), %r13
leaq 0x48(%rsp), %r14
pushq $0x9
popq %rbx
xorl %r12d, %r12d
movl $0x7a120, %edx          # imm = 0x7A120
movq %rbp, %rsi
callq 0x2060
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x20(%rax,%rcx), %eax
testb $0x5, %al
jne 0x28a8
movl %eax, 0x4(%rsp)
leaq 0x8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %rax, 0x8(%rsp)
andq $0x0, 0x18(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
andq $0x0, 0x30(%rsp)
incq %r12
movq %rbp, %rdi
leaq 0x1982(%rip), %rsi      # 0x4047
callq 0x2220
testq %rax, %rax
leaq 0x19bb(%rip), %rbp      # 0x408f
je 0x28bf
xorl %edi, %edi
movq %rbp, %rsi
callq 0x2220
testq %rax, %rax
je 0x270e
movq %r13, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x2b58
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
callq 0x2edc
movq %r13, %rdi
callq 0x20c0
jmp 0x26da
movq %r12, 0x40(%rsp)
xorl %r12d, %r12d
xorl %ebp, %ebp
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
subq %rax, %rcx
shrq $0x5, %rcx
movslq %ecx, %rcx
cmpq %rcx, %rbp
jge 0x27c9
leaq 0x58(%rsp), %rcx
movq %rcx, 0x48(%rsp)
andq $0x0, 0x50(%rsp)
movb %r15b, 0x58(%rsp)
leaq 0x88(%rsp), %rcx
movq %rcx, 0x78(%rsp)
andq $0x0, 0x80(%rsp)
movb %r15b, 0x88(%rsp)
leaq 0xb0(%rsp), %rcx
movq %rcx, 0xa0(%rsp)
andq $0x0, 0xa8(%rsp)
movb %r15b, 0xb0(%rsp)
movq (%rax,%r12), %rsi
movq %r13, %rdi
callq 0x2150
movq %r13, %rdi
movq %r14, %rsi
callq 0x249a
testb %al, %al
je 0x2886
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x2b94
movq %r14, %rdi
callq 0x2ba0
incq %rbp
addq $0x20, %r12
jmp 0x2718
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x2436
leaq 0x8(%rsp), %rbp
movq (%r12), %r12
cmpq %rbp, %r12
je 0x285b
leaq 0x10(%r12), %rsi
movq 0x37d8(%rip), %rdi      # 0x5fc8
callq 0x2140
movq %rax, %rdi
movl %ebx, %esi
callq 0x21a0
movq 0x30(%r12), %rsi
movq %rax, %rdi
callq 0x2160
movq %rax, %rdi
movl %ebx, %esi
callq 0x21a0
movq 0x38(%r12), %rsi
movq %rax, %rdi
callq 0x2160
movq %rax, %rdi
movl %ebx, %esi
callq 0x21a0
leaq 0x40(%r12), %rsi
movq %rax, %rdi
callq 0x2140
movq %rax, %rdi
movl %ebx, %esi
callq 0x21a0
leaq 0x68(%r12), %rsi
movq %rax, %rdi
callq 0x2140
movq %rax, %rdi
callq 0x20d0
jmp 0x27db
leaq 0x20(%rsp), %rdi
callq 0x2bc0
movq %rbp, %rdi
callq 0x2bec
movq 0x40(%rsp), %r12
leaq 0x4b0(%rsp), %rbp
movq 0x3757(%rip), %rdi      # 0x5fd8
jmp 0x2671
leaq 0x48(%rsp), %rdi
callq 0x2ba0
leaq 0x20(%rsp), %rdi
callq 0x2bc0
leaq 0x8(%rsp), %rdi
callq 0x2bec
movl 0x4(%rsp), %eax
testb $0x5, %al
setne %al
addq $0x7a5d8, %rsp          # imm = 0x7A5D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x372a(%rip), %rdi      # 0x5ff0
leaq 0x177c(%rip), %rsi      # 0x4049
callq 0x2170
movq %rax, %rdi
movq %r12, %rsi
callq 0x2160
leaq 0x1797(%rip), %rsi      # 0x407b
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x20d0
jmp 0x2890
jmp 0x2925
jmp 0x2925
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x2ba0
jmp 0x2928
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x20c0
jmp 0x2928
jmp 0x2925
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x2bc0
leaq 0x8(%rsp), %rdi
callq 0x2bec
movq %rbx, %rdi
callq 0x2260