// File: /workspace/github_cpp_makefile_star2_O3/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 %ebp, %ebp
movq 0x3881(%rip), %r15      # 0x5fd8
leaq 0x4b0(%rsp), %r14
leaq 0x28(%rsp), %rbx
leaq 0xc0(%rsp), %r13
xorl %r12d, %r12d
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %ecx
movl $0x7a120, %edx          # imm = 0x7A120
movq %r15, %rdi
movq %r14, %rsi
callq 0x2260
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x20(%rax,%rcx), %eax
testb $0x5, %al
jne 0x2b2b
movl %eax, 0xc(%rsp)
movq %rbx, 0x30(%rsp)
movq %rbx, 0x28(%rsp)
movq %rbp, 0x38(%rsp)
movq %rbp, 0x20(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
incq %r12
movq %r14, %rdi
leaq 0x1871(%rip), %rsi      # 0x4047
callq 0x21e0
testq %rax, %rax
je 0x2b42
xorl %edi, %edi
leaq 0x18a2(%rip), %rsi      # 0x408f
callq 0x21e0
movq %rax, %r15
testq %rax, %rax
je 0x2855
leaq 0xd0(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq %r15, %rdi
callq 0x20a0
leaq (%rax,%r15), %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x30e4
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x317a
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x27e4
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x2160
jmp 0x27e4
movq %r12, 0xb8(%rsp)
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
subq %rax, %rcx
shrq $0x5, %rcx
testl %ecx, %ecx
jle 0x298f
xorl %r15d, %r15d
xorl %r12d, %r12d
leaq 0x50(%rsp), %rcx
movq %rcx, 0x40(%rsp)
movq %rbp, 0x48(%rsp)
movb %bpl, 0x50(%rsp)
leaq 0x80(%rsp), %rcx
movq %rcx, 0x70(%rsp)
movq %rbp, 0x78(%rsp)
movb %bpl, 0x80(%rsp)
leaq 0xa8(%rsp), %rcx
movq %rcx, 0x98(%rsp)
movq %rbp, 0xa0(%rsp)
movb %bpl, 0xa8(%rsp)
movq (%rax,%r15), %rsi
movq %r13, %rdi
callq 0x2120
movq %r13, %rdi
leaq 0x40(%rsp), %rsi
callq 0x24a7
testb %al, %al
je 0x2ab0
movq %rbx, %rdi
leaq 0x40(%rsp), %rsi
callq 0x33ea
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2050
incq 0x38(%rsp)
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x292d
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x294f
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x296b
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2160
incq %r12
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
subq %rax, %rcx
shrq $0x5, %rcx
movslq %ecx, %rcx
addq $0x20, %r15
cmpq %rcx, %r12
jl 0x287c
movq %rbx, %rdi
callq 0x2438
movq %rbx, %r12
movq (%r12), %r12
cmpq %rbx, %r12
je 0x2a8a
movq 0x10(%r12), %rsi
movq 0x18(%r12), %rdx
movq 0x3610(%rip), %rdi      # 0x5fc8
callq 0x2180
movb $0x9, 0xc0(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2180
movq 0x30(%r12), %rsi
movq %rax, %rdi
callq 0x2130
movb $0x9, 0xc0(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2180
movq 0x38(%r12), %rsi
movq %rax, %rdi
callq 0x2130
movb $0x9, 0xc0(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2180
movq 0x40(%r12), %rsi
movq 0x48(%r12), %rdx
movq %rax, %rdi
callq 0x2180
movb $0x9, 0xc0(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2180
movq 0x68(%r12), %rsi
movq 0x70(%r12), %rdx
movq %rax, %rdi
callq 0x2180
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
jmp 0x299a
leaq 0x10(%rsp), %rdi
callq 0x2eea
movq %rbx, %rdi
callq 0x2f54
movq 0xb8(%rsp), %r12
movq 0x352d(%rip), %r15      # 0x5fd8
jmp 0x276f
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x2ad5
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x2af7
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x2b13
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2160
leaq 0x10(%rsp), %rdi
callq 0x2eea
leaq 0x28(%rsp), %rdi
callq 0x2f54
movl 0xc(%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 0x34a7(%rip), %rdi      # 0x5ff0
leaq 0x14f9(%rip), %rsi      # 0x4049
movl $0x31, %edx
callq 0x2180
movq 0x348f(%rip), %rdi      # 0x5ff0
movq %r12, %rsi
callq 0x2130
movq %rax, %rbx
leaq 0x1508(%rip), %rsi      # 0x407b
movl $0x13, %edx
movq %rax, %rdi
callq 0x2180
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
jmp 0x2b13
jmp 0x2c15
jmp 0x2c15
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x2e9c
jmp 0x2c18
jmp 0x2c15
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x2c18
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x2160
jmp 0x2c18
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2eea
leaq 0x28(%rsp), %rdi
callq 0x2f54
movq %rbx, %rdi
callq 0x2230