// File: /workspace/github_c_makefile_star2_O3/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 0xa9482
callq 0x34fea
testb %al, %al
jne 0xa9635
testq %r15, %r15
je 0xa9630
testq %r14, %r14
je 0xa9630
testq %r13, %r13
je 0xa9630
movq 0x10(%r15), %rsi
testq %rsi, %rsi
je 0xa94b6
movq %r14, %rdi
callq 0xb890
testl %eax, %eax
je 0xa9580
movq %r13, 0x20(%rsp)
movq 0x8(%r15), %rdi
movq %r14, %rsi
callq 0x775ed
testq %rax, %rax
je 0xa9560
movq %rax, %r13
movq %rbp, 0x18(%rsp)
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0xa94ef
callq 0x34fea
testb %al, %al
jne 0xa963a
movq %r13, %rdi
callq 0x6f310
testq %rax, %rax
je 0xa9541
xorl %ebp, %ebp
movq %r13, %rdi
movq %rbp, %rsi
callq 0x6f037
movq %rax, %r12
cmpq $-0x1, 0x18(%rax)
je 0xa95c2
testq %rbx, %rbx
je 0xa9531
leaq 0x10(%r12), %rdi
movq %rbx, %rsi
callq 0x7e261
testb %al, %al
jne 0xa95c2
incq %rbp
movq %r13, %rdi
callq 0x6f310
cmpq %rax, %rbp
jb 0xa94fe
movq (%rbx), %rcx
movq 0x8(%rbx), %r8
leaq 0x52b11(%rip), %rsi     # 0xfc060
movq 0x60(%rsp), %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x34f1f
jmp 0xa9576
leaq 0x529d6(%rip), %rsi     # 0xfbf3d
movq 0x60(%rsp), %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x34f1f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xa9621
leaq 0x28(%r15), %r12
cmpq $-0x1, 0x30(%r15)
je 0xa959e
movq %r12, %rdi
movq %rbx, %rsi
callq 0x7e261
testb %al, %al
je 0xa94b6
movq 0x18(%r15), %rax
movq %rax, (%r13)
movq 0x20(%r15), %rax
movq %rax, (%rbp)
xorl %eax, %eax
movq (%rsp), %rdx
testq %rdx, %rdx
je 0xa9621
movq (%r12), %rcx
movq %rcx, (%rdx)
jmp 0xa9621
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 0xa95ee
movlps %xmm0, (%rax)
movaps %xmm0, (%rsp)
movq 0x8(%r15), %rdi
movq %r14, %rsi
callq 0x7760b
movq %rax, 0x10(%r15)
testq %rax, %rax
je 0xa963f
movq (%r13), %rax
movq %rax, 0x18(%r15)
movq (%rbx), %rax
movq %rax, 0x20(%r15)
movaps (%rsp), %xmm0
movups %xmm0, 0x28(%r15)
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x24681
callq 0x24648
callq 0x246ba
callq 0x246f1