// File: /workspace/github_cpp_makefile_star2_O1/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
leaq 0xd0(%rsp), %rbx
xorl %r14d, %r14d
movq 0x3881(%rip), %rbp      # 0x5fd8
leaq 0x4b0(%rsp), %r15
leaq 0xc0(%rsp), %r13
xorl %r12d, %r12d
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %ecx
movl $0x7a120, %edx          # imm = 0x7A120
movq %rbp, %rdi
movq %r15, %rsi
callq 0x2260
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x20(%rax,%rcx), %eax
testb $0x5, %al
jne 0x2b32
movl %eax, 0x1c(%rsp)
movq %rsp, %rax
movq %rax, 0x8(%rsp)
movq %rax, (%rsp)
movq %r14, 0x10(%rsp)
movq %r14, 0x30(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
incq %r12
movq %r15, %rdi
leaq 0x1873(%rip), %rsi      # 0x4047
callq 0x21e0
testq %rax, %rax
je 0x2b49
xorl %edi, %edi
leaq 0x18a4(%rip), %rbp      # 0x408f
movq %rbp, %rsi
callq 0x21e0
movq %rax, %r15
testq %rax, %rax
je 0x2848
movq %rbx, 0xc0(%rsp)
movq %r15, %rdi
callq 0x20a0
leaq (%rax,%r15), %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x30fe
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
callq 0x318e
movq 0xc0(%rsp), %rdi
cmpq %rbx, %rdi
je 0x2844
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x2160
xorl %edi, %edi
jmp 0x27eb
movq %r12, 0xb8(%rsp)
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
subq %rax, %rcx
shrq $0x5, %rcx
testl %ecx, %ecx
jle 0x298d
xorl %r12d, %r12d
xorl %ebp, %ebp
leaq 0x50(%rsp), %rcx
movq %rcx, 0x40(%rsp)
movq %r14, 0x48(%rsp)
movb %r14b, 0x50(%rsp)
leaq 0x80(%rsp), %rcx
movq %rcx, 0x70(%rsp)
movq %r14, 0x78(%rsp)
movb %r14b, 0x80(%rsp)
leaq 0xa8(%rsp), %rcx
movq %rcx, 0x98(%rsp)
movq %r14, 0xa0(%rsp)
movb %r14b, 0xa8(%rsp)
movq (%rax,%r12), %rsi
movq %r13, %rdi
callq 0x2120
movq %r13, %rdi
leaq 0x40(%rsp), %rsi
callq 0x249e
movl %eax, %r15d
testb %al, %al
je 0x2ab9
movq %rsp, %rdi
leaq 0x40(%rsp), %rsi
callq 0x33f6
movq %rax, %rdi
movq %rsp, %rsi
callq 0x2050
incq 0x10(%rsp)
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x2922
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x2944
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x2960
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2160
testb %r15b, %r15b
je 0x2b1c
incq %rbp
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
subq %rax, %rcx
shrq $0x5, %rcx
movslq %ecx, %rcx
addq $0x20, %r12
cmpq %rcx, %rbp
jl 0x286e
movq %rsp, %r12
movq %r12, %rdi
callq 0x2438
movq 0x3639(%rip), %rbp      # 0x5fd8
movq (%r12), %r12
movq %rsp, %rax
cmpq %rax, %r12
je 0x2a92
movq 0x10(%r12), %rsi
movq 0x18(%r12), %rdx
movq 0x3608(%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 0x299f
leaq 0x20(%rsp), %rdi
callq 0x2f08
movq %rsp, %rdi
callq 0x2f6e
movq 0xb8(%rsp), %r12
leaq 0x4b0(%rsp), %r15
jmp 0x276a
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x2ade
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x2b00
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x2b1c
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2160
leaq 0x20(%rsp), %rdi
callq 0x2f08
movq %rsp, %rdi
callq 0x2f6e
movl 0x1c(%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 %r12, %rbx
movq 0x349d(%rip), %rdi      # 0x5ff0
leaq 0x14ef(%rip), %rsi      # 0x4049
movl $0x31, %edx
callq 0x2180
movq 0x3485(%rip), %rdi      # 0x5ff0
movq %rbx, %rsi
callq 0x2130
movq %rax, %rbx
leaq 0x14fe(%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 0x2b1c
jmp 0x2c17
jmp 0x2c17
movq %rax, %r14
leaq 0x40(%rsp), %rdi
callq 0x2eba
jmp 0x2c1a
jmp 0x2c17
movq %rax, %r14
movq 0xc0(%rsp), %rdi
cmpq %rbx, %rdi
je 0x2c1a
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x2160
jmp 0x2c1a
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x2f08
movq %rsp, %rdi
callq 0x2f6e
movq %r14, %rdi
callq 0x2230