// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/sspliced_alignment_parsing.c
// Function: parse_input_line
static int parse_input_line(GtSSplicedAlignment **alignment, const char *line,
                            GtUword line_length, GtError *err)
{
  GtWord leftpos, rightpos;
  GtUword i = 0;
  GtRange exon;
  GtStr *id;
  int had_err = 0;
  gt_error_check(err);

#define CHECKLINELENGTH\
        if (!had_err && i >= line_length) {        \
          gt_error_set(err, "incomplete input line\n" \
                       "line=%s", line);           \
          return had_err = -1;                     \
        }

  /* init */
  id = gt_str_new();
  *alignment = NULL;

  /* parsing id */
  while (!had_err) {
    CHECKLINELENGTH;
    if (line[i] == DELIMITER) {
      /* reference id has been saved, skip this character and break */
      i++;
      CHECKLINELENGTH;
      break;
    }
    else {
      /* save this character of the reference id */
      gt_str_append_char(id, line[i]);
    }

    /* increase counter */
    i++;
  }

  /* parsing orientation */
  if (line[i] == FORWARDSTRANDCHAR)
    *alignment = gt_sspliced_alignment_new(gt_str_get(id), true);
  else if (line[i] == REVERSESTRANDCHAR)
    *alignment = gt_sspliced_alignment_new(gt_str_get(id), false);
  else {
    gt_error_set(err,
                 "wrong formatted input line, orientation must be %c or %c\n"
                 "line=%s", FORWARDSTRANDCHAR, REVERSESTRANDCHAR, line);
    had_err = -1;
  }
  i++;
  CHECKLINELENGTH;

  if (!had_err && line[i] != DELIMITER) {
    gt_error_set(err, "incomplete input line\nline=%s", line);
    had_err = -1;
  }

  while (!had_err) {
    if (line[i] == DELIMITER) {
      i++;
      CHECKLINELENGTH;
      if (!had_err &&
          sscanf(line+i, "" GT_WD "-" GT_WD "", &leftpos, &rightpos) != 2) {
        gt_error_set(err, "incomplete input line\nline=%s", line);
        had_err = -1;
      }
      if (!had_err) {
        /* save exon */
        exon.start = leftpos;
        exon.end   = rightpos;
        gt_sspliced_alignment_add_exon(*alignment, exon);
      }
    }
    i++;
    if (i >= line_length)
      break;
  }

  if (had_err)
    gt_sspliced_alignment_delete(*alignment);
  else {
    /* alignment contains at least one exon */
    gt_assert(gt_sspliced_alignment_num_of_exons(*alignment));
  }
  gt_str_delete(id);

  return had_err;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq %rdx, 0x48(%rsp)
movq %rcx, 0x40(%rsp)
movq $0x0, 0x28(%rsp)
movl $0x0, 0xc(%rsp)
cmpq $0x0, 0x40(%rsp)
je 0x1e2579
movq 0x40(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x1e2541
jmp 0x1e2579
movq 0x459a58(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x333ac1(%rip), %rsi    # 0x516013
leaq 0x333c66(%rip), %rdx    # 0x5161bf
leaq 0x384cdc(%rip), %rcx    # 0x56723c
leaq 0x384cab(%rip), %r8     # 0x567212
movl $0x23, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1e257b
callq 0x11d4a0
movq %rax, 0x10(%rsp)
movq 0x58(%rsp), %rax
movq $0x0, (%rax)
cmpl $0x0, 0xc(%rsp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1e25a4
jmp 0x1e2672
cmpl $0x0, 0xc(%rsp)
jne 0x1e25e4
movq 0x28(%rsp), %rax
cmpq 0x48(%rsp), %rax
jb 0x1e25e4
movq 0x40(%rsp), %rdi
movq 0x50(%rsp), %rdx
leaq 0x384c85(%rip), %rsi    # 0x56724d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
movl $0xffffffff, 0x64(%rsp) # imm = 0xFFFFFFFF
jmp 0x1e2927
movq 0x50(%rsp), %rax
movq 0x28(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2c, %eax
jne 0x1e2647
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
cmpl $0x0, 0xc(%rsp)
jne 0x1e2645
movq 0x28(%rsp), %rax
cmpq 0x48(%rsp), %rax
jb 0x1e2645
movq 0x40(%rsp), %rdi
movq 0x50(%rsp), %rdx
leaq 0x384c24(%rip), %rsi    # 0x56724d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
movl $0xffffffff, 0x64(%rsp) # imm = 0xFFFFFFFF
jmp 0x1e2927
jmp 0x1e2672
movq 0x10(%rsp), %rdi
movq 0x50(%rsp), %rax
movq 0x28(%rsp), %rcx
movsbl (%rax,%rcx), %esi
callq 0x11da70
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x1e2591
movq 0x50(%rsp), %rax
movq 0x28(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2b, %eax
jne 0x1e26a9
movq 0x10(%rsp), %rdi
callq 0x11dee0
movq %rax, %rdi
movl $0x1, %esi
callq 0x1e1ec0
movq %rax, %rcx
movq 0x58(%rsp), %rax
movq %rcx, (%rax)
jmp 0x1e2709
movq 0x50(%rsp), %rax
movq 0x28(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2d, %eax
jne 0x1e26dd
movq 0x10(%rsp), %rdi
callq 0x11dee0
movq %rax, %rdi
xorl %esi, %esi
callq 0x1e1ec0
movq %rax, %rcx
movq 0x58(%rsp), %rax
movq %rcx, (%rax)
jmp 0x1e2707
movq 0x40(%rsp), %rdi
movq 0x50(%rsp), %r8
leaq 0x384b7d(%rip), %rsi    # 0x56726b
movl $0x2b, %edx
movl $0x2d, %ecx
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
jmp 0x1e2709
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
cmpl $0x0, 0xc(%rsp)
jne 0x1e2757
movq 0x28(%rsp), %rax
cmpq 0x48(%rsp), %rax
jb 0x1e2757
movq 0x40(%rsp), %rdi
movq 0x50(%rsp), %rdx
leaq 0x384b12(%rip), %rsi    # 0x56724d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
movl $0xffffffff, 0x64(%rsp) # imm = 0xFFFFFFFF
jmp 0x1e2927
cmpl $0x0, 0xc(%rsp)
jne 0x1e2791
movq 0x50(%rsp), %rax
movq 0x28(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2c, %eax
je 0x1e2791
movq 0x40(%rsp), %rdi
movq 0x50(%rsp), %rdx
leaq 0x384acb(%rip), %rsi    # 0x56724d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
jmp 0x1e2793
cmpl $0x0, 0xc(%rsp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1e27a6
jmp 0x1e28ae
movq 0x50(%rsp), %rax
movq 0x28(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2c, %eax
jne 0x1e288d
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
cmpl $0x0, 0xc(%rsp)
jne 0x1e280b
movq 0x28(%rsp), %rax
cmpq 0x48(%rsp), %rax
jb 0x1e280b
movq 0x40(%rsp), %rdi
movq 0x50(%rsp), %rdx
leaq 0x384a5e(%rip), %rsi    # 0x56724d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
movl $0xffffffff, 0x64(%rsp) # imm = 0xFFFFFFFF
jmp 0x1e2927
cmpl $0x0, 0xc(%rsp)
jne 0x1e2859
movq 0x50(%rsp), %rdi
addq 0x28(%rsp), %rdi
leaq 0x384a89(%rip), %rsi    # 0x5672ac
leaq 0x38(%rsp), %rdx
leaq 0x30(%rsp), %rcx
movb $0x0, %al
callq 0x19770
cmpl $0x2, %eax
je 0x1e2859
movq 0x40(%rsp), %rdi
movq 0x50(%rsp), %rdx
leaq 0x384a03(%rip), %rsi    # 0x56724d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
cmpl $0x0, 0xc(%rsp)
jne 0x1e288b
movq 0x38(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x58(%rsp), %rax
movq (%rax), %rdi
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
callq 0x1e2020
jmp 0x1e288d
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x48(%rsp), %rax
jb 0x1e28a9
jmp 0x1e28ae
jmp 0x1e2793
cmpl $0x0, 0xc(%rsp)
je 0x1e28c4
movq 0x58(%rsp), %rax
movq (%rax), %rdi
callq 0x1e1f70
jmp 0x1e2915
jmp 0x1e28c6
movq 0x58(%rsp), %rax
movq (%rax), %rdi
callq 0x1e2090
cmpq $0x0, %rax
jne 0x1e2911
movq 0x4596c0(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x333729(%rip), %rsi    # 0x516013
leaq 0x3849c3(%rip), %rdx    # 0x5672b4
leaq 0x384944(%rip), %rcx    # 0x56723c
leaq 0x384913(%rip), %r8     # 0x567212
movl $0x6e, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1e2913
jmp 0x1e2915
movq 0x10(%rsp), %rdi
callq 0x11f560
movl 0xc(%rsp), %eax
movl %eax, 0x64(%rsp)
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq