// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/seqid2seqnum_mapping.c
// Function: gt_seqid2seqnum_mapping_map
int gt_seqid2seqnum_mapping_map(GtSeqid2SeqnumMapping *mapping,
                                const char *seqid, const GtRange *inrange,
                                GtUword *seqnum, GtUword *filenum,
                                GtUword *offset, GtError *err)
{
  SeqidInfo *seqid_info;
  GtRange outrange;
  gt_error_check(err);
  gt_assert(mapping && seqid && seqnum);
  /* try to answer request from cache */
  if (mapping->cached_seqid && !strcmp(seqid, mapping->cached_seqid) &&
      (mapping->cached_range.end == GT_UNDEF_UWORD ||
       gt_range_contains(&mapping->cached_range, inrange))) {
    *seqnum = mapping->cached_seqnum;
    *filenum = mapping->cached_filenum;
    if (offset)
      *offset = mapping->cached_range.start;
    return 0;
  }
  /* cache miss -> regular mapping */
  if (!(seqid_info = gt_hashmap_get(mapping->map, seqid))) {
    gt_error_set(err, "no sequence with ID \"%s\" found in input sequence(s)",
                 seqid);
    return -1;
  }
  /* get results from seqid info */
  if (seqid_info_get(seqid_info, seqnum, filenum, &outrange, inrange,
                     mapping->filename, seqid, err)) {
    return -1;
  }
  /* report offset */
  if (offset)
    *offset = outrange.start;
  /* store result in cache */
  mapping->cached_seqid = gt_hashmap_get_key(mapping->map, seqid);
  gt_assert(mapping->cached_seqid);
  mapping->cached_seqnum = *seqnum;
  mapping->cached_filenum = *filenum;
  mapping->cached_range = outrange;
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, (%rsp)
movq %r8, %rbp
movq %rcx, %r13
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x8ac00
callq 0xc103
testb %al, %al
jne 0x8adcf
testq %r15, %r15
je 0x8ad9e
testq %r14, %r14
je 0x8ad9e
testq %r13, %r13
je 0x8ad9e
movq 0x10(%r15), %rsi
testq %rsi, %rsi
je 0x8ac34
movq %r14, %rdi
callq 0xb880
testl %eax, %eax
je 0x8ad2d
movq %r13, 0x20(%rsp)
movq 0x8(%r15), %rdi
movq %r14, %rsi
callq 0x55ef6
testq %rax, %rax
je 0x8ad15
movq %rax, %r13
movq %rbp, 0x18(%rsp)
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x8ac6d
callq 0xc103
testb %al, %al
jne 0x8adfd
xorl %ebp, %ebp
movq %r13, %rdi
callq 0x4b988
cmpq %rax, %rbp
jae 0x8ad6f
movq %r13, %rdi
movq %rbp, %rsi
callq 0x4b48e
movq %rax, %r12
cmpq $-0x1, 0x18(%rax)
je 0x8acb0
testq %rbx, %rbx
je 0x8acab
leaq 0x10(%r12), %rdi
movq %rbx, %rsi
callq 0x5d1b5
testb %al, %al
jne 0x8acb0
incq %rbp
jmp 0x8ac6f
movq (%r12), %rax
movq 0x20(%rsp), %r13
movq %rax, (%r13)
movq 0x8(%r12), %rax
movq 0x18(%rsp), %rbx
movq %rax, (%rbx)
movups 0x10(%r12), %xmm0
movq (%rsp), %rax
testq %rax, %rax
je 0x8acdc
movlps %xmm0, (%rax)
movaps %xmm0, (%rsp)
movq 0x8(%r15), %rdi
movq %r14, %rsi
callq 0x55f14
movq %rax, 0x10(%r15)
testq %rax, %rax
je 0x8ae29
movq (%r13), %rax
movq %rax, 0x18(%r15)
movq (%rbx), %rax
movq %rax, 0x20(%r15)
movaps (%rsp), %xmm0
movups %xmm0, 0x28(%r15)
xorl %eax, %eax
jmp 0x8ad8f
leaq 0x5a531(%rip), %rsi     # 0xe524d
movq 0x60(%rsp), %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xc007
jmp 0x8ad8c
leaq 0x28(%r15), %r12
cmpq $-0x1, 0x30(%r15)
je 0x8ad4b
movq %r12, %rdi
movq %rbx, %rsi
callq 0x5d1b5
testb %al, %al
je 0x8ac34
movq 0x18(%r15), %rax
movq %rax, (%r13)
movq 0x20(%r15), %rax
movq %rax, (%rbp)
xorl %eax, %eax
movq (%rsp), %rdx
testq %rdx, %rdx
je 0x8ad8f
movq (%r12), %rcx
movq %rcx, (%rdx)
jmp 0x8ad8f
movq (%rbx), %rcx
movq 0x8(%rbx), %r8
leaq 0x5a60c(%rip), %rsi     # 0xe5389
movq 0x60(%rsp), %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xc007
pushq $-0x1
popq %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xa3213(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x3f2b7(%rip), %rsi     # 0xca066
leaq 0x5a47c(%rip), %rdx     # 0xe5232
leaq 0x5a459(%rip), %rcx     # 0xe5216
leaq 0x5a40b(%rip), %r8      # 0xe51cf
movl $0xf2, %r9d
jmp 0x8ae55
movq 0xa31e2(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x3f286(%rip), %rsi     # 0xca066
leaq 0x3f872(%rip), %rdx     # 0xca659
leaq 0x5a428(%rip), %rcx     # 0xe5216
leaq 0x5a3da(%rip), %r8      # 0xe51cf
movl $0xf1, %r9d
jmp 0x8ae55
movq 0xa31b4(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x3f258(%rip), %rsi     # 0xca066
leaq 0x3f844(%rip), %rdx     # 0xca659
leaq 0x5a55e(%rip), %rcx     # 0xe537a
leaq 0x5a3ac(%rip), %r8      # 0xe51cf
pushq $0x56
popq %r9
jmp 0x8ae55
movq 0xa3188(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x3f22c(%rip), %rsi     # 0xca066
leaq 0x5a440(%rip), %rdx     # 0xe5281
leaq 0x5a3ce(%rip), %rcx     # 0xe5216
leaq 0x5a380(%rip), %r8      # 0xe51cf
movl $0x10d, %r9d            # imm = 0x10D
xorl %eax, %eax
callq 0xb8c0
callq 0xb300