// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/chainofin.c
// Function: gt_chain_analyzeopenformatfile
GtChain2Dimmatchtable *gt_chain_analyzeopenformatfile(double weightfactor,
                                                  const char *matchfile,
                                                  GtError *err)
{
  GtChain2Dimmatchtable *matchtable;
  GtUword linenum;
  GtWord storeinteger[GT_CHAININPUT_READNUMS];
  FILE *matchfp;
  bool haserr = false;
  GtChain2Dimmatchvalues fragment;

  if (numberoflinesinfile(&linenum,matchfile,err) != 0)
  {
    return NULL;
  }
  matchfp = gt_fa_fopen(matchfile,"r",err);
  if (matchfp == NULL)
  {
    return NULL;
  }
  matchtable = gt_chain_matchtable_new(linenum);
  for (linenum = 0; fscanf(matchfp,""GT_WD" "GT_WD" "GT_WD" "GT_WD" "GT_WD"\n",
                           &storeinteger[0],
                           &storeinteger[1],
                           &storeinteger[2],
                           &storeinteger[3],
                           &storeinteger[4]) == GT_CHAININPUT_READNUMS;
                    linenum++)
  {
    GtUword countcolumns;

    for (countcolumns = 0; countcolumns < (GtUword) (GT_CHAININPUT_READNUMS-1);
         countcolumns++)
    {
      if (storeinteger[countcolumns] < 0)
      {
        CANNOTPARSELINE("non-negative integer expected");
        haserr = true;
      }
    }
    if (storeinteger[0] > storeinteger[1])
    {
      CANNOTPARSELINE("startpos1 <= endpos1 expected");
      haserr = true;
      break;
    }
    if (storeinteger[2] > storeinteger[3])
    {
      CANNOTPARSELINE("startpos2 <= endpos2 expected");
      haserr = true;
      break;
    }
    fragment.startpos[0] = (GtChain2Dimpostype) storeinteger[0];
    fragment.endpos[0] = (GtChain2Dimpostype) storeinteger[1];
    fragment.startpos[1] = (GtChain2Dimpostype) storeinteger[2];
    fragment.endpos[1] = (GtChain2Dimpostype) storeinteger[3];
    fragment.weight
      = (GtChain2Dimscoretype) (weightfactor * (double) storeinteger[4]);
    gt_chain_matchtable_add(matchtable,&fragment);
    /*gt_chain_printchainelem(stdout,&fragment); */
  }
  gt_fa_fclose(matchfp);
  if (haserr)
  {
    gt_chain_matchtable_delete(matchtable);
    return NULL;
  }
  gt_chain_fillthegapvalues(matchtable);
  return matchtable;
}

// Assembly:
subq $0xa8, %rsp
movsd %xmm0, 0x98(%rsp)
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movb $0x0, 0x47(%rsp)
movq 0x90(%rsp), %rsi
movq 0x88(%rsp), %rdx
leaq 0x78(%rsp), %rdi
callq 0x20b7b0
cmpl $0x0, %eax
je 0x20b535
movq $0x0, 0xa0(%rsp)
jmp 0x20b796
movq 0x90(%rsp), %rdi
movq 0x88(%rsp), %r8
leaq 0x320a8e(%rip), %rsi    # 0x52bfda
leaq 0x36661d(%rip), %rdx    # 0x571b70
movl $0x46, %ecx
callq 0xd8df0
movq %rax, 0x48(%rsp)
cmpq $0x0, 0x48(%rsp)
jne 0x20b57b
movq $0x0, 0xa0(%rsp)
jmp 0x20b796
movq 0x78(%rsp), %rdi
callq 0x207510
movq %rax, 0x80(%rsp)
movq $0x0, 0x78(%rsp)
movq 0x48(%rsp), %rdi
leaq 0x50(%rsp), %rdx
leaq 0x50(%rsp), %rcx
addq $0x8, %rcx
leaq 0x50(%rsp), %r8
addq $0x10, %r8
leaq 0x50(%rsp), %r9
addq $0x18, %r9
leaq 0x50(%rsp), %rax
addq $0x20, %rax
leaq 0x3665bb(%rip), %rsi    # 0x571b86
movq %rax, (%rsp)
movb $0x0, %al
callq 0x19db0
cmpl $0x5, %eax
jne 0x20b74d
movq $0x0, 0x10(%rsp)
cmpq $0x4, 0x10(%rsp)
jae 0x20b64b
movq 0x10(%rsp), %rax
cmpq $0x0, 0x50(%rsp,%rax,8)
jge 0x20b639
movq 0x88(%rsp), %rdi
movq 0x90(%rsp), %rdx
movq 0x78(%rsp), %rcx
addq $0x1, %rcx
movq 0x10(%rsp), %r8
addq $0x1, %r8
leaq 0x366575(%rip), %rsi    # 0x571b9b
leaq 0x34e22f(%rip), %r9     # 0x55985c
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x47(%rsp)
jmp 0x20b63b
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x20b5e8
movq 0x50(%rsp), %rax
cmpq 0x58(%rsp), %rax
jle 0x20b698
movq 0x88(%rsp), %rdi
movq 0x90(%rsp), %rdx
movq 0x78(%rsp), %rcx
addq $0x1, %rcx
movq 0x10(%rsp), %r8
addq $0x1, %r8
leaq 0x36651b(%rip), %rsi    # 0x571b9b
leaq 0x36653d(%rip), %r9     # 0x571bc4
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x47(%rsp)
jmp 0x20b74d
movq 0x60(%rsp), %rax
cmpq 0x68(%rsp), %rax
jle 0x20b6e2
movq 0x88(%rsp), %rdi
movq 0x90(%rsp), %rdx
movq 0x78(%rsp), %rcx
addq $0x1, %rcx
movq 0x10(%rsp), %r8
addq $0x1, %r8
leaq 0x3664ce(%rip), %rsi    # 0x571b9b
leaq 0x36650e(%rip), %r9     # 0x571be2
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x47(%rsp)
jmp 0x20b74d
movq 0x50(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x30(%rsp)
movsd 0x98(%rsp), %xmm0
cvtsi2sdq 0x70(%rsp), %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movq %rax, 0x38(%rsp)
movq 0x80(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x2076d0
movq 0x78(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x78(%rsp)
jmp 0x20b596
movq 0x48(%rsp), %rdi
callq 0xd9390
testb $0x1, 0x47(%rsp)
je 0x20b779
movq 0x80(%rsp), %rdi
callq 0x2075d0
movq $0x0, 0xa0(%rsp)
jmp 0x20b796
movq 0x80(%rsp), %rdi
callq 0x2078a0
movq 0x80(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rax
addq $0xa8, %rsp
retq
nopw %cs:(%rax,%rax)