// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/region_mapping.c
// Function: gt_region_mapping_get_sequence_length
int gt_region_mapping_get_sequence_length(GtRegionMapping *rm,
                                          GtUword *length, GtStr *seqid,
                                          GtError *err)
{
  GtUword filenum, seqnum;
  int had_err;
  gt_error_check(err);
  GT_UNUSED GtRange range = {0,0};
  gt_assert(rm && seqid);
  if (rm->userawseq) {
    return rm->rawlength;
  }
  had_err = update_seq_col_if_necessary(rm, seqid, err);
  if (!had_err) {
    if (gt_md5_seqid_has_prefix(gt_str_get(seqid))) {
      had_err = gt_seq_col_md5_to_sequence_length(rm->seq_col, length, seqid,
                                                  err);
    }
    else if (rm->usedesc) {
      gt_assert(rm->seqid2seqnum_mapping);
      had_err = gt_seqid2seqnum_mapping_map(rm->seqid2seqnum_mapping,
                                            gt_str_get(seqid), &range, &seqnum,
                                            &filenum, NULL, err);
      if (!had_err)
        *length = gt_seq_col_get_sequence_length(rm->seq_col, filenum, seqnum);
    }
    else if (rm->matchdesc) {
      had_err = gt_seq_col_grep_desc_sequence_length(rm->seq_col, length,
                                                     seqid, err);
    }
    else if (rm->useseqno) {
      GtUword seqno = GT_UNDEF_UWORD;
      gt_assert(rm->encseq);
      if (1 != sscanf(gt_str_get(seqid), "seq"GT_WU"", &seqno)) {
        gt_error_set(err, "seqid '%s' does not have the form 'seqX' "
                          "where X is a sequence number in the encoded "
                          "sequence", gt_str_get(seqid));
        had_err = -1;
      }
      gt_assert(had_err || seqno != GT_UNDEF_UWORD);
      if (!had_err && seqno >= gt_encseq_num_of_sequences(rm->encseq)) {
          gt_error_set(err, "trying to access sequence "GT_WU", but encoded "
                            "sequence contains only "GT_WU" sequences",
                            seqno, gt_encseq_num_of_sequences(rm->encseq));
          had_err = -1;
      }
      if (!had_err) {
        *length = gt_encseq_seqlength(rm->encseq, seqno);
      }
    } else if (rm->mapping) {
      *length = gt_seq_col_get_sequence_length(rm->seq_col, 0, 0);
    } else {
      gt_assert(!rm->usedesc && !rm->matchdesc);
      gt_error_set(err, "no mapping rule given and no MD5 tags "
                        "present in the query seqid \"%s\" -- no mapping can "
                        "be defined", gt_str_get(seqid));
      had_err = -1;
    }
  }
  return had_err;
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x88(%rsp)
movq %rsi, 0x80(%rsp)
movq %rdx, 0x78(%rsp)
movq %rcx, 0x70(%rsp)
cmpq $0x0, 0x70(%rsp)
je 0xe9d21
movq 0x70(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0xe9ce9
jmp 0xe9d21
movq 0xca2e8(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x7436c(%rip), %rsi     # 0x15e066
leaq 0x74947(%rip), %rdx     # 0x15e648
leaq 0x90463(%rip), %rcx     # 0x17a16b
leaq 0x8fff7(%rip), %r8      # 0x179d06
movl $0x167, %r9d            # imm = 0x167
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xe9d23
leaq 0x48(%rsp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0xb2d0
cmpq $0x0, 0x88(%rsp)
je 0xe9d47
cmpq $0x0, 0x78(%rsp)
jne 0xe9d7f
movq 0xca28a(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x7430e(%rip), %rsi     # 0x15e066
leaq 0x90432(%rip), %rdx     # 0x17a191
leaq 0x90405(%rip), %rcx     # 0x17a16b
leaq 0x8ff99(%rip), %r8      # 0x179d06
movl $0x169, %r9d            # imm = 0x169
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xe9d81
movq 0x88(%rsp), %rax
testb $0x1, 0x1b(%rax)
je 0xe9da7
movq 0x88(%rsp), %rax
movq 0x50(%rax), %rax
movl %eax, 0x94(%rsp)
jmp 0xea1b0
movq 0x88(%rsp), %rdi
movq 0x78(%rsp), %rsi
movq 0x70(%rsp), %rdx
callq 0xe98f0
movl %eax, 0x5c(%rsp)
cmpl $0x0, 0x5c(%rsp)
jne 0xea1a5
movq 0x78(%rsp), %rdi
callq 0x19940
movq %rax, %rdi
callq 0x8dca0
testb $0x1, %al
jne 0xe9de5
jmp 0xe9e11
movq 0x88(%rsp), %rax
movq 0x38(%rax), %rdi
movq 0x80(%rsp), %rsi
movq 0x78(%rsp), %rdx
movq 0x70(%rsp), %rcx
callq 0x14a8a0
movl %eax, 0x5c(%rsp)
jmp 0xea1a3
movq 0x88(%rsp), %rax
testb $0x1, 0x19(%rax)
je 0xe9eea
jmp 0xe9e25
movq 0x88(%rsp), %rax
cmpq $0x0, 0x40(%rax)
jne 0xe9e6c
movq 0xca19d(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x74221(%rip), %rsi     # 0x15e066
leaq 0x90012(%rip), %rdx     # 0x179e5e
leaq 0x90318(%rip), %rcx     # 0x17a16b
leaq 0x8feac(%rip), %r8      # 0x179d06
movl $0x174, %r9d            # imm = 0x174
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xe9e6e
movq 0x88(%rsp), %rax
movq 0x40(%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x78(%rsp), %rdi
callq 0x19940
movq 0x38(%rsp), %rdi
movq %rax, %rsi
movq 0x70(%rsp), %rax
leaq 0x48(%rsp), %rdx
leaq 0x60(%rsp), %rcx
leaq 0x68(%rsp), %r8
xorl %r9d, %r9d
movq %rax, (%rsp)
callq 0xeb6c0
movl %eax, 0x5c(%rsp)
cmpl $0x0, 0x5c(%rsp)
jne 0xe9ee5
movq 0x88(%rsp), %rax
movq 0x38(%rax), %rdi
movq 0x68(%rsp), %rsi
movq 0x60(%rsp), %rdx
callq 0x14ac60
movq %rax, %rcx
movq 0x80(%rsp), %rax
movq %rcx, (%rax)
jmp 0xea1a1
movq 0x88(%rsp), %rax
testb $0x1, 0x18(%rax)
je 0xe9f24
movq 0x88(%rsp), %rax
movq 0x38(%rax), %rdi
movq 0x80(%rsp), %rsi
movq 0x78(%rsp), %rdx
movq 0x70(%rsp), %rcx
callq 0x14a670
movl %eax, 0x5c(%rsp)
jmp 0xea19f
movq 0x88(%rsp), %rax
testb $0x1, 0x1c(%rax)
je 0xea0d7
movq $-0x1, 0x40(%rsp)
movq 0x88(%rsp), %rax
cmpq $0x0, 0x30(%rax)
jne 0xe9f86
movq 0xca083(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x74107(%rip), %rsi     # 0x15e066
leaq 0x8ffe4(%rip), %rdx     # 0x179f4a
leaq 0x901fe(%rip), %rcx     # 0x17a16b
leaq 0x8fd92(%rip), %r8      # 0x179d06
movl $0x181, %r9d            # imm = 0x181
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xe9f88
movq 0x78(%rsp), %rdi
callq 0x19940
movq %rax, %rdi
leaq 0x8ffb9(%rip), %rsi     # 0x179f55
leaq 0x40(%rsp), %rdx
movb $0x0, %al
callq 0xb660
movl %eax, %ecx
movl $0x1, %eax
cmpl %ecx, %eax
je 0xe9fe5
movq 0x70(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x78(%rsp), %rdi
callq 0x19940
movq 0x30(%rsp), %rdi
movq %rax, %rdx
leaq 0x8ff86(%rip), %rsi     # 0x179f5c
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
jmp 0xe9fe7
cmpl $0x0, 0x5c(%rsp)
jne 0xea02e
cmpq $-0x1, 0x40(%rsp)
jne 0xea02e
movq 0xc9fdb(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x7405f(%rip), %rsi     # 0x15e066
leaq 0x8ffac(%rip), %rdx     # 0x179fba
leaq 0x90156(%rip), %rcx     # 0x17a16b
leaq 0x8fcea(%rip), %r8      # 0x179d06
movl $0x188, %r9d            # imm = 0x188
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xea030
cmpl $0x0, 0x5c(%rsp)
jne 0xea0a7
movq 0x40(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x88(%rsp), %rax
movq 0x30(%rax), %rdi
callq 0x113f30
movq %rax, %rcx
movq 0x28(%rsp), %rax
cmpq %rcx, %rax
jb 0xea0a7
movq 0x70(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x88(%rsp), %rax
movq 0x30(%rax), %rdi
callq 0x113f30
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rdx
movq %rax, %rcx
leaq 0x8ff45(%rip), %rsi     # 0x179fdd
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0x5c(%rsp)
jne 0xea0d2
movq 0x88(%rsp), %rax
movq 0x30(%rax), %rdi
movq 0x40(%rsp), %rsi
callq 0x11abd0
movq %rax, %rcx
movq 0x80(%rsp), %rax
movq %rcx, (%rax)
jmp 0xea19d
movq 0x88(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0xea111
movq 0x88(%rsp), %rax
movq 0x38(%rax), %rdi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x14ac60
movq %rax, %rcx
movq 0x80(%rsp), %rax
movq %rcx, (%rax)
jmp 0xea19b
jmp 0xea113
movq 0x88(%rsp), %rax
testb $0x1, 0x19(%rax)
jne 0xea12f
movq 0x88(%rsp), %rax
testb $0x1, 0x18(%rax)
je 0xea167
movq 0xc9ea2(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x73f26(%rip), %rsi     # 0x15e066
leaq 0x8ffa2(%rip), %rdx     # 0x17a0e9
leaq 0x9001d(%rip), %rcx     # 0x17a16b
leaq 0x8fbb1(%rip), %r8      # 0x179d06
movl $0x195, %r9d            # imm = 0x195
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xea169
movq 0x70(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x78(%rsp), %rdi
callq 0x19940
movq 0x10(%rsp), %rdi
movq %rax, %rdx
leaq 0x8ff7c(%rip), %rsi     # 0x17a108
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
jmp 0xea19d
jmp 0xea19f
jmp 0xea1a1
jmp 0xea1a3
jmp 0xea1a5
movl 0x5c(%rsp), %eax
movl %eax, 0x94(%rsp)
movl 0x94(%rsp), %eax
addq $0x98, %rsp
retq
nop