// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/rcr.c
// Function: rcr_decode_inexact
static inline int rcr_decode_inexact(GtRcrDecoder *rcr_dec,
                                     GtBitInStream *bitstream,
                                     RcrDecodeInfo *info,
                                     GtUword seq_i,
                                     GtUword readlength,
                                     GtError *err)
{
  int had_err = 0,
      cigar_op = GT_UNDEF_INT;
  GtUword end,
                prev_varpos = 0,
                read_i = 0,
                rel_varpos = 0,
                symbol,
                varpos;

  info->offset = 0;

  /* read variation type */
  had_err = rcr_huff_read(info->cigar_hbwd, bitstream, &symbol, err);
  if (!had_err)
    gt_safe_assign(cigar_op, symbol);

  while (!had_err && cigar_op != ENDOFRECORD) {

    /* read variation position */
    if (!had_err)
      had_err = rcr_golomb_read(info->varpos_gbwd, bitstream, &rel_varpos, err);

    varpos = rel_varpos + prev_varpos;

    /* are there matches between the current and the previous variation? */
    if (!had_err && (read_i < varpos)) {
      end = seq_i + varpos - read_i;
      rcr_decode_exact_range(rcr_dec, info, seq_i, end);
      seq_i = end;
      read_i += varpos - read_i;
    }

    /* variation handling */
    if (!had_err) {
      switch (cigar_op) {
        case  BAM_CMATCH:
          gt_str_append_char(info->cigar_string, 'X');
          had_err = rcr_decode_mismatch(rcr_dec, seq_i, info, bitstream, err);
          if (!had_err)
            had_err = rcr_decode_mismatch_qual(rcr_dec, bitstream, info, err);
          read_i++; seq_i++;
          break;
        case BAM_CSOFT_CLIP:
          had_err = rcr_decode_insert_var(rcr_dec, bitstream, info, 'S', err);
          read_i += info->inserted_bases;
          break;
        case BAM_CINS:
          had_err = rcr_decode_insert_var(rcr_dec, bitstream, info, 'I', err);
          read_i += info->inserted_bases;
          break;
        case BAM_CDEL:
          had_err = rcr_decode_delete_var(info, bitstream, 'D', err);
          seq_i += info->offset;
          break;
        case BAM_CREF_SKIP:
          had_err = rcr_decode_delete_var(info, bitstream, 'N', err);
          seq_i += info->offset;
          break;
        default:
          gt_error_set(err, "encountered funny cigar op: %d", cigar_op);
          had_err = -1;
      }
    }
    prev_varpos = varpos;
    /* read next variation type */
    if (!had_err)
      had_err = rcr_huff_read(info->cigar_hbwd, bitstream, &symbol, err);
    if (!had_err)
      gt_safe_assign(cigar_op, symbol);
  }
  /* end symbol was read are there trailing matches?*/
  if (!had_err && (read_i < readlength)) {
      end = seq_i + readlength - read_i;
      rcr_decode_exact_range(rcr_dec, info, seq_i, end);
  }
  return had_err;
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movq %rdx, 0x90(%rsp)
movq %rcx, 0x88(%rsp)
movq %r8, 0x80(%rsp)
movq %r9, 0x78(%rsp)
movl $0x0, 0x74(%rsp)
movl $0x80000000, 0x70(%rsp) # imm = 0x80000000
movq $0x0, 0x60(%rsp)
movq $0x0, 0x58(%rsp)
movq $0x0, 0x50(%rsp)
movq 0x90(%rsp), %rax
movq $0x0, 0x50(%rax)
movq 0x90(%rsp), %rax
movq 0x28(%rax), %rdi
movq 0x98(%rsp), %rsi
movq 0x78(%rsp), %rcx
leaq 0x48(%rsp), %rdx
callq 0x1c2730
movl %eax, 0x74(%rsp)
cmpl $0x0, 0x74(%rsp)
jne 0x1c2b51
jmp 0x1c2ab3
movq 0x48(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movl %eax, 0x34(%rsp)
movq 0x38(%rsp), %rax
movslq 0x34(%rsp), %rcx
cmpq %rcx, %rax
jne 0x1c2b05
cmpq $0x1, 0x38(%rsp)
setb %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, 0x34(%rsp)
setl %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x1c2b05
movl 0x34(%rsp), %eax
movl %eax, 0x70(%rsp)
xorl %eax, %eax
movl %eax, 0x1c(%rsp)
jmp 0x1c2b10
movl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x1c2b10
movl 0x1c(%rsp), %eax
movl %eax, 0x30(%rsp)
cmpl $0x0, 0x30(%rsp)
je 0x1c2b4d
movq 0x47947a(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3554f5(%rip), %rsi    # 0x518025
leaq 0x39e9a8(%rip), %rdx    # 0x5614df
movl $0x72f, %ecx            # imm = 0x72F
movb $0x0, %al
callq 0x199f0
movl $0x1, %edi
callq 0x19890
jmp 0x1c2b4f
jmp 0x1c2b51
jmp 0x1c2b53
xorl %eax, %eax
cmpl $0x0, 0x74(%rsp)
movb %al, 0x1b(%rsp)
jne 0x1c2b6c
cmpl $0x9, 0x70(%rsp)
setne %al
movb %al, 0x1b(%rsp)
movb 0x1b(%rsp), %al
testb $0x1, %al
jne 0x1c2b79
jmp 0x1c2f05
cmpl $0x0, 0x74(%rsp)
jne 0x1c2ba7
movq 0x90(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x98(%rsp), %rsi
movq 0x78(%rsp), %rcx
leaq 0x50(%rsp), %rdx
callq 0x1c2820
movl %eax, 0x74(%rsp)
movq 0x50(%rsp), %rax
addq 0x60(%rsp), %rax
movq %rax, 0x40(%rsp)
cmpl $0x0, 0x74(%rsp)
jne 0x1c2c23
movq 0x58(%rsp), %rax
cmpq 0x40(%rsp), %rax
jae 0x1c2c23
movq 0x88(%rsp), %rax
addq 0x40(%rsp), %rax
subq 0x58(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0xa0(%rsp), %rdi
movq 0x90(%rsp), %rsi
movq 0x88(%rsp), %rdx
movq 0x68(%rsp), %rcx
callq 0x1c31a0
movq 0x68(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0x40(%rsp), %rax
subq 0x58(%rsp), %rax
addq 0x58(%rsp), %rax
movq %rax, 0x58(%rsp)
cmpl $0x0, 0x74(%rsp)
jne 0x1c2e1d
movl 0x70(%rsp), %eax
movq %rax, 0x10(%rsp)
subq $0x4, %rax
ja 0x1c2dfc
movq 0x10(%rsp), %rax
leaq 0x39e85b(%rip), %rcx    # 0x5614a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x90(%rsp), %rax
movq 0x40(%rax), %rdi
movl $0x58, %esi
callq 0x11da70
movq 0xa0(%rsp), %rdi
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
movq 0x98(%rsp), %rcx
movq 0x78(%rsp), %r8
callq 0x1c3260
movl %eax, 0x74(%rsp)
cmpl $0x0, 0x74(%rsp)
jne 0x1c2cc7
movq 0xa0(%rsp), %rdi
movq 0x98(%rsp), %rsi
movq 0x90(%rsp), %rdx
movq 0x78(%rsp), %rcx
callq 0x1c3400
movl %eax, 0x74(%rsp)
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
movq 0x88(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x88(%rsp)
jmp 0x1c2e1b
movq 0xa0(%rsp), %rdi
movq 0x98(%rsp), %rsi
movq 0x90(%rsp), %rdx
movq 0x78(%rsp), %r8
movl $0x53, %ecx
callq 0x1c34a0
movl %eax, 0x74(%rsp)
movq 0x90(%rsp), %rax
movq 0x58(%rax), %rax
addq 0x58(%rsp), %rax
movq %rax, 0x58(%rsp)
jmp 0x1c2e1b
movq 0xa0(%rsp), %rdi
movq 0x98(%rsp), %rsi
movq 0x90(%rsp), %rdx
movq 0x78(%rsp), %r8
movl $0x49, %ecx
callq 0x1c34a0
movl %eax, 0x74(%rsp)
movq 0x90(%rsp), %rax
movq 0x58(%rax), %rax
addq 0x58(%rsp), %rax
movq %rax, 0x58(%rsp)
jmp 0x1c2e1b
movq 0x90(%rsp), %rdi
movq 0x98(%rsp), %rsi
movq 0x78(%rsp), %rcx
movl $0x44, %edx
callq 0x1c36a0
movl %eax, 0x74(%rsp)
movq 0x90(%rsp), %rax
movq 0x50(%rax), %rax
addq 0x88(%rsp), %rax
movq %rax, 0x88(%rsp)
jmp 0x1c2e1b
movq 0x90(%rsp), %rdi
movq 0x98(%rsp), %rsi
movq 0x78(%rsp), %rcx
movl $0x4e, %edx
callq 0x1c36a0
movl %eax, 0x74(%rsp)
movq 0x90(%rsp), %rax
movq 0x50(%rax), %rax
addq 0x88(%rsp), %rax
movq %rax, 0x88(%rsp)
jmp 0x1c2e1b
movq 0x78(%rsp), %rdi
movl 0x70(%rsp), %edx
leaq 0x39eeee(%rip), %rsi    # 0x561cfa
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
jmp 0x1c2e1d
movq 0x40(%rsp), %rax
movq %rax, 0x60(%rsp)
cmpl $0x0, 0x74(%rsp)
jne 0x1c2e55
movq 0x90(%rsp), %rax
movq 0x28(%rax), %rdi
movq 0x98(%rsp), %rsi
movq 0x78(%rsp), %rcx
leaq 0x48(%rsp), %rdx
callq 0x1c2730
movl %eax, 0x74(%rsp)
cmpl $0x0, 0x74(%rsp)
jne 0x1c2f00
jmp 0x1c2e62
movq 0x48(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movl %eax, 0x24(%rsp)
movq 0x28(%rsp), %rax
movslq 0x24(%rsp), %rcx
cmpq %rcx, %rax
jne 0x1c2eb4
cmpq $0x1, 0x28(%rsp)
setb %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, 0x24(%rsp)
setl %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x1c2eb4
movl 0x24(%rsp), %eax
movl %eax, 0x70(%rsp)
xorl %eax, %eax
movl %eax, 0xc(%rsp)
jmp 0x1c2ebf
movl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x1c2ebf
movl 0xc(%rsp), %eax
movl %eax, 0x20(%rsp)
cmpl $0x0, 0x20(%rsp)
je 0x1c2efc
movq 0x4790cb(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x355146(%rip), %rsi    # 0x518025
leaq 0x39e5f9(%rip), %rdx    # 0x5614df
movl $0x765, %ecx            # imm = 0x765
movb $0x0, %al
callq 0x199f0
movl $0x1, %edi
callq 0x19890
jmp 0x1c2efe
jmp 0x1c2f00
jmp 0x1c2b53
cmpl $0x0, 0x74(%rsp)
jne 0x1c2f57
movq 0x58(%rsp), %rax
cmpq 0x80(%rsp), %rax
jae 0x1c2f57
movq 0x88(%rsp), %rax
addq 0x80(%rsp), %rax
subq 0x58(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0xa0(%rsp), %rdi
movq 0x90(%rsp), %rsi
movq 0x88(%rsp), %rdx
movq 0x68(%rsp), %rcx
callq 0x1c31a0
movl 0x74(%rsp), %eax
addq $0xa8, %rsp
retq
nopw %cs:(%rax,%rax)