// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/sfx-maprange.c
// Function: gt_Sfxmappedrange_map
void *gt_Sfxmappedrange_map(GtSfxmappedrange *sfxmappedrange,
                            GtUword minindex,
                            GtUword maxindex)
{
  gt_assert(sfxmappedrange != NULL);
  if (sfxmappedrange->ptr != NULL)
  {
    gt_fa_xmunmap(sfxmappedrange->ptr);
  }
  if (sfxmappedrange->transformfunc != NULL)
  {
    sfxmappedrange->transformfunc(&minindex,&maxindex,
                                  sfxmappedrange->transformfunc_data);
  }
  if (minindex <= maxindex)
  {
    GtMappedrange lbrange;
    GtUword unitoffset;
    size_t sizeoftable;

    gt_Sfxmapped_offset_end(&lbrange,
                            sfxmappedrange->sizeofunit,
                            sfxmappedrange->pagesize,
                            minindex,
                            maxindex);
    sizeoftable = gt_Sfxmappedrange_size_entire(sfxmappedrange);
    gt_log_log("mapped %s["GT_WU".."GT_WU"] for %s (%.1f%% of all)",
               gt_str_get(sfxmappedrange->tablename),
               lbrange.mapoffset,
               lbrange.mapend,
               sfxmappedrange->writable ? "writing" : "reading",
               (lbrange.mapend - lbrange.mapoffset + 1
                 >= (GtUword) sizeoftable)
                    ? 100.0
                    : 100.0 * (lbrange.mapend - lbrange.mapoffset + 1)/
                               sizeoftable);
    gt_assert(lbrange.mapoffset <= lbrange.mapend);
    gt_assert(lbrange.mapoffset <= minindex * sfxmappedrange->sizeofunit);
    gt_assert(maxindex * sfxmappedrange->sizeofunit <= lbrange.mapend);
    gt_assert(lbrange.mapoffset % sfxmappedrange->pagesize == 0);
    if (sfxmappedrange->writable)
    {
      sfxmappedrange->ptr
        = gt_fa_xmmap_write_range(gt_str_get(sfxmappedrange->filename),
                                  (size_t) (lbrange.mapend-lbrange.mapoffset+1),
                                  (size_t) lbrange.mapoffset);
    } else
    {
      sfxmappedrange->ptr
        = gt_fa_xmmap_read_range (gt_str_get(sfxmappedrange->filename),
                                  (size_t) (lbrange.mapend-lbrange.mapoffset+1),
                                  (size_t) lbrange.mapoffset);
    }
    sfxmappedrange->indexrange_defined = true;
    sfxmappedrange->currentmaxindex = maxindex;
    sfxmappedrange->currentminindex = minindex;
    unitoffset = lbrange.mapoffset / sfxmappedrange->sizeofunit;
    switch (sfxmappedrange->type)
    {
      case GtSfxGtBitsequence:
        return ((GtBitsequence *) sfxmappedrange->ptr) - unitoffset;
      case GtSfxuint32_t:
        return ((uint32_t *) sfxmappedrange->ptr) - unitoffset;
      case GtSfxunsignedlong:
        return ((GtUword *) sfxmappedrange->ptr) - unitoffset;
      default:
        gt_assert(false);
        break;
    }
    gt_assert(false);
  }
  sfxmappedrange->ptr = NULL;
  sfxmappedrange->indexrange_defined = true;
  sfxmappedrange->currentmaxindex = maxindex;
  sfxmappedrange->currentminindex = minindex;
  return NULL;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movq %rdx, 0x58(%rsp)
cmpq $0x0, 0x68(%rsp)
jne 0x2cc523
movq 0x36faae(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x249b17(%rip), %rsi    # 0x516013
leaq 0x2bee7b(%rip), %rdx    # 0x58b37e
leaq 0x2bf052(%rip), %rcx    # 0x58b55c
leaq 0x2beea2(%rip), %r8     # 0x58b3b3
movl $0x130, %r9d            # imm = 0x130
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2cc525
movq 0x68(%rsp), %rax
cmpq $0x0, (%rax)
je 0x2cc53d
movq 0x68(%rsp), %rax
movq (%rax), %rdi
callq 0xdb2a0
movq 0x68(%rsp), %rax
cmpq $0x0, 0x60(%rax)
je 0x2cc567
movq 0x68(%rsp), %rax
movq 0x60(%rax), %rax
movq 0x68(%rsp), %rcx
movq 0x68(%rcx), %rdx
leaq 0x60(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq *%rax
movq 0x60(%rsp), %rax
cmpq 0x58(%rsp), %rax
ja 0x2cc972
movq 0x68(%rsp), %rax
movq 0x38(%rax), %rsi
movq 0x68(%rsp), %rax
movq 0x28(%rax), %rdx
movq 0x60(%rsp), %rcx
movq 0x58(%rsp), %r8
leaq 0x48(%rsp), %rdi
callq 0x2cc3f0
movq 0x68(%rsp), %rdi
callq 0x2cb990
movq %rax, 0x38(%rsp)
movq 0x68(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x11dee0
movq %rax, 0x18(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x68(%rsp), %rax
movb 0x70(%rax), %dl
leaq 0x2f0710(%rip), %rax    # 0x5bccf2
leaq 0x2f0730(%rip), %rcx    # 0x5bcd19
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, 0x30(%rsp)
movq 0x50(%rsp), %rax
subq 0x48(%rsp), %rax
addq $0x1, %rax
cmpq 0x38(%rsp), %rax
jb 0x2cc61a
movsd 0x24e226(%rip), %xmm0   # 0x51a838
movsd %xmm0, 0x10(%rsp)
jmp 0x2cc680
movq 0x48(%rsp), %rcx
movq 0x50(%rsp), %rax
subq %rcx, %rax
incq %rax
movq %rax, %xmm0
movaps 0x24c2fa(%rip), %xmm3   # 0x518930
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x24c2fe(%rip), %xmm2   # 0x518940
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x24e1df(%rip), %xmm1   # 0x51a838
mulsd %xmm1, %xmm0
movq 0x38(%rsp), %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x30(%rsp), %r8
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rsi
movsd 0x10(%rsp), %xmm0
leaq 0x2beed1(%rip), %rdi    # 0x58b572
movb $0x1, %al
callq 0xe7740
movq 0x48(%rsp), %rax
cmpq 0x50(%rsp), %rax
jbe 0x2cc6ec
movq 0x36f8e5(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x24994e(%rip), %rsi    # 0x516013
leaq 0x2beed1(%rip), %rdx    # 0x58b59d
leaq 0x2bee89(%rip), %rcx    # 0x58b55c
leaq 0x2becd9(%rip), %r8     # 0x58b3b3
movl $0x150, %r9d            # imm = 0x150
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2cc6ee
jmp 0x2cc6f0
movq 0x48(%rsp), %rax
movq 0x60(%rsp), %rcx
movq 0x68(%rsp), %rdx
imulq 0x38(%rdx), %rcx
cmpq %rcx, %rax
jbe 0x2cc741
movq 0x36f890(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2498f9(%rip), %rsi    # 0x516013
leaq 0x2beea0(%rip), %rdx    # 0x58b5c1
leaq 0x2bee34(%rip), %rcx    # 0x58b55c
leaq 0x2bec84(%rip), %r8     # 0x58b3b3
movl $0x151, %r9d            # imm = 0x151
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2cc743
jmp 0x2cc745
movq 0x58(%rsp), %rax
movq 0x68(%rsp), %rcx
imulq 0x38(%rcx), %rax
cmpq 0x50(%rsp), %rax
jbe 0x2cc793
movq 0x36f83e(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2498a7(%rip), %rsi    # 0x516013
leaq 0x2bee89(%rip), %rdx    # 0x58b5fc
leaq 0x2bede2(%rip), %rcx    # 0x58b55c
leaq 0x2bec32(%rip), %r8     # 0x58b3b3
movl $0x152, %r9d            # imm = 0x152
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2cc795
jmp 0x2cc797
movq 0x48(%rsp), %rax
movq 0x68(%rsp), %rcx
xorl %edx, %edx
divq 0x28(%rcx)
cmpq $0x0, %rdx
je 0x2cc7e5
movq 0x36f7ec(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x249855(%rip), %rsi    # 0x516013
leaq 0x2bee6f(%rip), %rdx    # 0x58b634
leaq 0x2bed90(%rip), %rcx    # 0x58b55c
leaq 0x2bebe0(%rip), %r8     # 0x58b3b3
movl $0x153, %r9d            # imm = 0x153
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2cc7e7
movq 0x68(%rsp), %rax
testb $0x1, 0x70(%rax)
je 0x2cc835
movq 0x68(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
movq 0x50(%rsp), %rsi
subq 0x48(%rsp), %rsi
addq $0x1, %rsi
movq 0x48(%rsp), %rdx
leaq 0x2beb96(%rip), %rcx    # 0x58b3b3
movl $0x159, %r8d            # imm = 0x159
callq 0xdb1c0
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, (%rax)
jmp 0x2cc876
movq 0x68(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
movq 0x50(%rsp), %rsi
subq 0x48(%rsp), %rsi
addq $0x1, %rsi
movq 0x48(%rsp), %rdx
leaq 0x2beb53(%rip), %rcx    # 0x58b3b3
movl $0x15f, %r8d            # imm = 0x15F
callq 0xdb010
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, (%rax)
movq 0x68(%rsp), %rax
movb $0x1, 0x58(%rax)
movq 0x58(%rsp), %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x50(%rax)
movq 0x60(%rsp), %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x48(%rax)
movq 0x48(%rsp), %rax
movq 0x68(%rsp), %rcx
movq 0x38(%rcx), %rcx
xorl %edx, %edx
divq %rcx
movq %rax, 0x40(%rsp)
movq 0x68(%rsp), %rax
movl 0x40(%rax), %eax
movl %eax, 0xc(%rsp)
testl %eax, %eax
je 0x2cc8db
jmp 0x2cc8c5
movl 0xc(%rsp), %eax
subl $0x1, %eax
je 0x2cc91b
jmp 0x2cc8d0
movl 0xc(%rsp), %eax
subl $0x2, %eax
je 0x2cc8fb
jmp 0x2cc938
movq 0x68(%rsp), %rax
movq (%rax), %rax
xorl %ecx, %ecx
subq 0x40(%rsp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x70(%rsp)
jmp 0x2cc9ac
movq 0x68(%rsp), %rax
movq (%rax), %rax
xorl %ecx, %ecx
subq 0x40(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x70(%rsp)
jmp 0x2cc9ac
movq 0x68(%rsp), %rax
movq (%rax), %rax
xorl %ecx, %ecx
subq 0x40(%rsp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x70(%rsp)
jmp 0x2cc9ac
jmp 0x2cc93a
movq 0x36f65f(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2496c8(%rip), %rsi    # 0x516013
leaq 0x28c411(%rip), %rdx    # 0x558d63
leaq 0x2bec03(%rip), %rcx    # 0x58b55c
leaq 0x2bea53(%rip), %r8     # 0x58b3b3
movl $0x16e, %r9d            # imm = 0x16E
movb $0x0, %al
callq 0x199f0
callq 0x19370
movq 0x68(%rsp), %rax
movq $0x0, (%rax)
movq 0x68(%rsp), %rax
movb $0x1, 0x58(%rax)
movq 0x58(%rsp), %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x50(%rax)
movq 0x60(%rsp), %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x48(%rax)
movq $0x0, 0x70(%rsp)
movq 0x70(%rsp), %rax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)