// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/gap_str.c
// Function: gt_gap_str_parse
static int gt_gap_str_parse(GtGapStr *gap_str, const char *str, GtError *err)
{
  int had_err = 0;
  char *mystr = gt_cstr_dup(str),
       *token = NULL,
       code;
  GtUword nof_tokens, i;
  GtSplitter *splitter;
  gt_assert(gap_str && str);
  gt_error_check(err);

  splitter = gt_splitter_new();
  gt_splitter_reset(splitter);
  gt_splitter_split(splitter, mystr, strlen(mystr), ' ');
  nof_tokens = gt_splitter_size(splitter);

  for (i = 0; !had_err && i < nof_tokens; i++) {
    int toklen;
    token = gt_splitter_get_token(splitter, i);
    toklen = strlen(token);
    if (toklen < 2) {
      if (token[0] != ' ' && token[0] != '\n') {
        gt_error_set(err, "edit operation too short: \"%s\"", token);
        had_err = -1;
        break;
      }
    }
    if (!had_err) {
      gt_assert(toklen > 1);
      switch (token[0]) {
        case 'M':
        case 'I':
        case 'D':
          break;
        case 'F':
        case 'R':
          if (!gap_str->is_protein_alignment) {
            gt_error_set(err, "invalid edit operation code '%c' (only allowed "
                              "in nucleotide-protein matches)",
                         token[0]);
            had_err = -1;
          }
          break;
        default:
          gt_error_set(err, "invalid edit operation code '%c' encountered",
                       token[0]);
          had_err = -1;
          break;
      }
    }
    if (!had_err) {
      GtUword oplen;
      code = (token++)[0];
      if (0 != gt_parse_uword(&oplen, token)) {
        gt_error_set(err, "cannot parse edit length from string: \"%s\"",
                     token);
        had_err = -1;
        break;
      }
      switch (code) {
        case 'M':
          gap_str->ref_len += gap_str->step * oplen;
          gap_str->ali_len += gap_str->step * oplen;
          gap_str->tar_len += gap_str->step * oplen;
          break;
        case 'I':
          gap_str->ali_len += gap_str->step * oplen;
          gap_str->tar_len += gap_str->step * oplen;
          break;
        case 'D':
          gap_str->ref_len += gap_str->step * oplen;
          gap_str->ali_len += gap_str->step * oplen;
          break;
        case 'F':
          gap_str->ref_len += oplen;
          gap_str->ali_len += oplen;
          break;
        case 'R':
          if (gap_str->ref_len < oplen || gap_str->ali_len < oplen) {
            gt_error_set(err, "reverse frameshift is too long (" GT_WU ")",
                         oplen);
            had_err = -1;
          }
          gap_str->ref_len -= oplen;
          gap_str->ali_len -= oplen;
          break;
        default:
        gt_assert(false);   /* cannot happen */
      }
    }
  }

  gt_free(mystr);
  gt_splitter_delete(splitter);
  return had_err;
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
movl $0x0, 0x6c(%rsp)
movq 0x78(%rsp), %rdi
callq 0x7c400
movq %rax, 0x60(%rsp)
movq $0x0, 0x58(%rsp)
cmpq $0x0, 0x80(%rsp)
je 0xa6b1c
cmpq $0x0, 0x78(%rsp)
jne 0xa6b54
movq 0x10d4b5(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0xb7539(%rip), %rsi     # 0x15e066
leaq 0xcbca0(%rip), %rdx     # 0x1727d4
leaq 0xcbca8(%rip), %rcx     # 0x1727e3
leaq 0xcbc46(%rip), %r8      # 0x172788
movl $0x2b, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xa6b56
jmp 0xa6b58
cmpq $0x0, 0x70(%rsp)
je 0xa6ba8
movq 0x70(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0xa6b70
jmp 0xa6ba8
movq 0x10d461(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0xb74e5(%rip), %rsi     # 0x15e066
leaq 0xb7ac0(%rip), %rdx     # 0x15e648
leaq 0xcbc54(%rip), %rcx     # 0x1727e3
leaq 0xcbbf2(%rip), %r8      # 0x172788
movl $0x2c, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xa6baa
callq 0x16a10
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
callq 0x16fa0
movq 0x38(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x60(%rsp), %rdi
callq 0xb240
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq %rax, %rdx
movl $0x20, %ecx
callq 0x16a30
movq 0x38(%rsp), %rdi
callq 0x17010
movq %rax, 0x48(%rsp)
movq $0x0, 0x40(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x6c(%rsp)
movb %al, 0x17(%rsp)
jne 0xa6c29
movq 0x40(%rsp), %rax
cmpq 0x48(%rsp), %rax
setb %al
movb %al, 0x17(%rsp)
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0xa6c36
jmp 0xa6ffe
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x16f20
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rdi
callq 0xb240
movl %eax, 0x34(%rsp)
cmpl $0x2, 0x34(%rsp)
jge 0xa6ca0
movq 0x58(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
je 0xa6c9e
movq 0x58(%rsp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
je 0xa6c9e
movq 0x70(%rsp), %rdi
movq 0x58(%rsp), %rdx
leaq 0xcbb6a(%rip), %rsi     # 0x1727f4
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x6c(%rsp) # imm = 0xFFFFFFFF
jmp 0xa6ffe
jmp 0xa6ca0
cmpl $0x0, 0x6c(%rsp)
jne 0xa6d87
jmp 0xa6cad
cmpl $0x1, 0x34(%rsp)
jg 0xa6cec
movq 0x10d31d(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0xb73a1(%rip), %rsi     # 0x15e066
leaq 0xcbb47(%rip), %rdx     # 0x172813
leaq 0xcbb10(%rip), %rcx     # 0x1727e3
leaq 0xcbaae(%rip), %r8      # 0x172788
movl $0x3f, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xa6cee
movq 0x58(%rsp), %rax
movsbl (%rax), %eax
movl %eax, 0x10(%rsp)
subl $0x44, %eax
je 0xa6d2d
jmp 0xa6d01
movl 0x10(%rsp), %eax
subl $0x46, %eax
je 0xa6d2f
jmp 0xa6d0c
movl 0x10(%rsp), %eax
subl $0x49, %eax
je 0xa6d2d
jmp 0xa6d17
movl 0x10(%rsp), %eax
subl $0x4d, %eax
je 0xa6d2d
jmp 0xa6d22
movl 0x10(%rsp), %eax
subl $0x52, %eax
je 0xa6d2f
jmp 0xa6d62
jmp 0xa6d85
movq 0x80(%rsp), %rax
testb $0x1, 0x20(%rax)
jne 0xa6d60
movq 0x70(%rsp), %rdi
movq 0x58(%rsp), %rax
movsbl (%rax), %edx
leaq 0xcbacd(%rip), %rsi     # 0x17281e
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x6c(%rsp) # imm = 0xFFFFFFFF
jmp 0xa6d85
movq 0x70(%rsp), %rdi
movq 0x58(%rsp), %rax
movsbl (%rax), %edx
leaq 0xcbaf6(%rip), %rsi     # 0x17286c
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x6c(%rsp) # imm = 0xFFFFFFFF
jmp 0xa6d87
cmpl $0x0, 0x6c(%rsp)
jne 0xa6fe9
movq 0x58(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x58(%rsp)
movb (%rax), %al
movb %al, 0x57(%rsp)
movq 0x58(%rsp), %rsi
leaq 0x28(%rsp), %rdi
callq 0x15580
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0xa6de5
movq 0x70(%rsp), %rdi
movq 0x58(%rsp), %rdx
leaq 0xcbac8(%rip), %rsi     # 0x172899
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x6c(%rsp) # imm = 0xFFFFFFFF
jmp 0xa6ffe
movsbl 0x57(%rsp), %eax
addl $-0x44, %eax
movl %eax, %ecx
movq %rcx, 0x8(%rsp)
subl $0xe, %eax
ja 0xa6fad
movq 0x8(%rsp), %rax
leaq 0xcb91f(%rip), %rcx     # 0x172728
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x80(%rsp), %rax
movq 0x18(%rax), %rcx
imulq 0x28(%rsp), %rcx
movq 0x80(%rsp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq 0x80(%rsp), %rax
movq 0x18(%rax), %rcx
imulq 0x28(%rsp), %rcx
movq 0x80(%rsp), %rax
addq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq 0x80(%rsp), %rax
movq 0x18(%rax), %rcx
imulq 0x28(%rsp), %rcx
movq 0x80(%rsp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
jmp 0xa6fe7
movq 0x80(%rsp), %rax
movq 0x18(%rax), %rcx
imulq 0x28(%rsp), %rcx
movq 0x80(%rsp), %rax
addq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq 0x80(%rsp), %rax
movq 0x18(%rax), %rcx
imulq 0x28(%rsp), %rcx
movq 0x80(%rsp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
jmp 0xa6fe7
movq 0x80(%rsp), %rax
movq 0x18(%rax), %rcx
imulq 0x28(%rsp), %rcx
movq 0x80(%rsp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq 0x80(%rsp), %rax
movq 0x18(%rax), %rcx
imulq 0x28(%rsp), %rcx
movq 0x80(%rsp), %rax
addq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
jmp 0xa6fe7
movq 0x28(%rsp), %rcx
movq 0x80(%rsp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq 0x28(%rsp), %rcx
movq 0x80(%rsp), %rax
addq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
jmp 0xa6fe7
movq 0x80(%rsp), %rax
movq (%rax), %rax
cmpq 0x28(%rsp), %rax
jb 0xa6f5d
movq 0x80(%rsp), %rax
movq 0x10(%rax), %rax
cmpq 0x28(%rsp), %rax
jae 0xa6f7d
movq 0x70(%rsp), %rdi
movq 0x28(%rsp), %rdx
leaq 0xcb956(%rip), %rsi     # 0x1728c4
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x6c(%rsp) # imm = 0xFFFFFFFF
movq 0x28(%rsp), %rdx
movq 0x80(%rsp), %rax
movq (%rax), %rcx
subq %rdx, %rcx
movq %rcx, (%rax)
movq 0x28(%rsp), %rdx
movq 0x80(%rsp), %rax
movq 0x10(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x10(%rax)
jmp 0xa6fe7
jmp 0xa6faf
movq 0x10d022(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0xb70a6(%rip), %rsi     # 0x15e066
leaq 0xcbd9f(%rip), %rdx     # 0x172d66
leaq 0xcb815(%rip), %rcx     # 0x1727e3
leaq 0xcb7b3(%rip), %r8      # 0x172788
movl $0x7a, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xa6fe9
jmp 0xa6feb
movq 0x40(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x40(%rsp)
jmp 0xa6c0b
movq 0x60(%rsp), %rdi
leaq 0xcb77e(%rip), %rsi     # 0x172788
movl $0x7f, %edx
callq 0xdab0
movq 0x38(%rsp), %rdi
callq 0x17060
movl 0x6c(%rsp), %eax
addq $0x88, %rsp
retq
nopw (%rax,%rax)