// File: /workspace/github_c_makefile_star2_O1/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, 0x10(%rsp)
movq %r8, %rbp
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r14
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0xa9f3e
callq 0x3566a
testb %al, %al
jne 0xaa103
testq %r14, %r14
je 0xaa0fe
testq %r13, %r13
je 0xaa0fe
testq %r12, %r12
je 0xaa0fe
movq 0x10(%r14), %rsi
testq %rsi, %rsi
je 0xa9f72
movq %r13, %rdi
callq 0xb890
testl %eax, %eax
je 0xaa042
movq %r12, 0x8(%rsp)
movq 0x8(%r14), %rdi
movq %r13, %rsi
callq 0x77109
testq %rax, %rax
je 0xaa022
movq %rax, %r12
movq %rbp, (%rsp)
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0xa9faa
callq 0x3566a
testb %al, %al
jne 0xaa108
movq %r12, %rdi
callq 0x6ecda
testq %rax, %rax
je 0xa9ffc
xorl %r15d, %r15d
movq %r12, %rdi
movq %r15, %rsi
callq 0x6e9fa
movq %rax, %rbp
cmpq $-0x1, 0x18(%rax)
je 0xaa084
testq %rbx, %rbx
je 0xa9fec
leaq 0x10(%rbp), %rdi
movq %rbx, %rsi
callq 0x7e11d
testb %al, %al
jne 0xaa084
incq %r15
movq %r12, %rdi
callq 0x6ecda
cmpq %rax, %r15
jb 0xa9fba
movq (%rbx), %rcx
movq 0x8(%rbx), %r8
leaq 0x520e6(%rip), %rsi     # 0xfc0f0
xorl %ebx, %ebx
movq 0x60(%rsp), %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x3559f
movq 0x8(%rsp), %r15
jmp 0xaa0a1
leaq 0x51fa4(%rip), %rsi     # 0xfbfcd
movq 0x60(%rsp), %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x3559f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xaa0ef
leaq 0x28(%r14), %r15
cmpq $-0x1, 0x30(%r14)
je 0xaa060
movq %r15, %rdi
movq %rbx, %rsi
callq 0x7e11d
testb %al, %al
je 0xa9f72
movq 0x18(%r14), %rax
movq %rax, (%r12)
movq 0x20(%r14), %rax
movq %rax, (%rbp)
xorl %eax, %eax
movq 0x10(%rsp), %rdx
testq %rdx, %rdx
je 0xaa0ef
movq (%r15), %rcx
movq %rcx, (%rdx)
jmp 0xaa0ef
movq (%rbp), %rax
movq 0x8(%rsp), %r15
movq %rax, (%r15)
movq 0x8(%rbp), %rax
movq (%rsp), %rcx
movq %rax, (%rcx)
movups 0x10(%rbp), %xmm0
movb $0x1, %bl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb %bl, %bl
je 0xaa0ef
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xaa0b7
movlps %xmm0, (%rax)
movaps %xmm0, 0x10(%rsp)
movq 0x8(%r14), %rdi
movq %r13, %rsi
callq 0x77127
movq %rax, 0x10(%r14)
testq %rax, %rax
movq (%rsp), %rcx
je 0xaa10d
movq (%r15), %rax
movq %rax, 0x18(%r14)
movq (%rcx), %rax
movq %rax, 0x20(%r14)
movaps 0x10(%rsp), %xmm0
movups %xmm0, 0x28(%r14)
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x24759
callq 0x24720
callq 0x24792
callq 0x247c9