// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/esa-map.c
// Function: inputsuffixarray
static int inputsuffixarray(bool map,
                            Suffixarray *suffixarray,
                            unsigned int demand,
                            const char *indexname,
                            GtLogger *logger,
                            GtError *err)
{
  bool haserr = false;
  GtEncseqLoader *el;
  GtUword totallength = 0;

  gt_error_check(err);
  initsuffixarray(suffixarray);
  el = gt_encseq_loader_new();
  if (!(demand & SARR_DESTAB))
    gt_encseq_loader_do_not_require_des_tab(el);
  else
    gt_encseq_loader_require_des_tab(el);
  if (!(demand & SARR_SDSTAB))
    gt_encseq_loader_do_not_require_sds_tab(el);
  else
    gt_encseq_loader_require_sds_tab(el);
  if (!(demand & SARR_SSPTAB))
    gt_encseq_loader_do_not_require_ssp_tab(el);
  else
    gt_encseq_loader_require_ssp_tab(el);
  gt_encseq_loader_set_logger(el, logger);
  suffixarray->encseq = gt_encseq_loader_load(el, indexname, err);
  gt_encseq_loader_delete(el);
  if (suffixarray->encseq == NULL)
  {
    haserr = true;
  }
  if (!haserr)
  {
    haserr = scanprjfileuintkeys(suffixarray,indexname,logger,err);
  }
  if (!haserr
        && suffixarray->mirroredencseq
        && !gt_encseq_is_mirrored(suffixarray->encseq))
  {
    if (gt_encseq_mirror(suffixarray->encseq, err) != 0)
      haserr = true;
  }
  if (!haserr)
  {
    totallength = gt_encseq_total_length(suffixarray->encseq);
  }
  if (!haserr && (demand & SARR_SUFTAB))
  {
    if (map)
    {
      if (suffixarray->numberofallsortedsuffixes > 0)
      {
        suffixarray->suftab
          = gt_fa_mmap_check_size_with_suffix(indexname,
                                       GT_SUFTABSUFFIX,
                                       suffixarray->numberofallsortedsuffixes,
                                       sizeof (*suffixarray->suftab),
                                       err);
        if (suffixarray->suftab == NULL)
        {
          haserr = true;
        }
      }
    } else
    {
#if defined (_LP64) || defined (_WIN64)
      off_t filesize = gt_file_size_with_suffix(indexname,GT_SUFTABSUFFIX);

      if (filesize == (off_t) sizeof (uint32_t) *
                              suffixarray->numberofallsortedsuffixes)
      {
        gt_logger_log(logger,"read suftab in units of 4 bytes");
        INITBufferedfile(indexname,&suffixarray->suftabstream_uint32_t,uint32_t,
                         GT_SUFTABSUFFIX);
      } else
      {
        gt_logger_log(logger,"read suftab in units of 8 bytes");
        INITBufferedfile(indexname,&suffixarray->suftabstream_GtUword,GtUword,
                         GT_SUFTABSUFFIX);
      }
#else
      gt_logger_log(logger,"read suftab in units of 4 bytes");
      INITBufferedfile(indexname,&suffixarray->suftabstream_GtUword,GtUword,
                       GT_SUFTABSUFFIX);
#endif
    }
    if (!haserr && !suffixarray->longest.defined)
    {
      gt_error_set(err,"longest not defined");
      haserr = true;
    }
  }
  if (!haserr && (demand & SARR_LCPTAB))
  {
    if (map)
    {
      if (suffixarray->numberofallsortedsuffixes > 0)
      {
        suffixarray->lcptab
          = gt_fa_mmap_check_size_with_suffix(indexname,
                                         GT_LCPTABSUFFIX,
                                         suffixarray->numberofallsortedsuffixes,
                                         sizeof (*suffixarray->lcptab),
                                         err);
        if (suffixarray->lcptab == NULL)
        {
          haserr = true;
        }
      }
    } else
    {
      INITBufferedfile(indexname,&suffixarray->lcptabstream,GtUchar,
                       GT_LCPTABSUFFIX);
      if (!haserr &&
          fseek(suffixarray->lcptabstream.fp,
                (GtWord) sizeof (GtUchar),SEEK_SET))
      {
        gt_error_set(err,"fseek(esastream) failed: %s",strerror(errno));
        haserr = true;
      }
    }
    if (!haserr && !suffixarray->numoflargelcpvalues.defined)
    {
      gt_error_set(err,"numoflargelcpvalues not defined");
      haserr = true;
    }
    if (!haserr && suffixarray->numoflargelcpvalues.valueunsignedlong > 0)
    {
      if (map)
      {
        suffixarray->llvtab
          = gt_fa_mmap_check_size_with_suffix(indexname,
                                           GT_LARGELCPTABSUFFIX,
                                           (GtUword)
                                           suffixarray->numoflargelcpvalues.
                                           valueunsignedlong,
                                           sizeof (*suffixarray->llvtab),
                                           err);
        if (suffixarray->llvtab == NULL)
        {
          haserr = true;
        }
      } else
      {
        INITBufferedfile(indexname,&suffixarray->llvtabstream,Largelcpvalue,
                         GT_LARGELCPTABSUFFIX);
      }
    }
  }
  if (!haserr && (demand & SARR_BWTTAB))
  {
    if (map)
    {
      suffixarray->bwttab
        = gt_fa_mmap_check_size_with_suffix(indexname,
                                         GT_BWTTABSUFFIX,
                                         totallength+1,
                                         sizeof (*suffixarray->bwttab),
                                         err);
      if (suffixarray->bwttab == NULL)
      {
        haserr = true;
      }
    } else
    {
      INITBufferedfile(indexname,&suffixarray->bwttabstream,GtUchar,
                       GT_BWTTABSUFFIX);
    }
  }
  if (!haserr && (demand & SARR_BCKTAB))
  {
    suffixarray->bcktab
      = gt_bcktab_map(indexname,
                      gt_encseq_alphabetnumofchars(suffixarray->encseq),
                      suffixarray->prefixlength,
                      totallength+1,
                      true,
                      err);
    if (suffixarray->bcktab == NULL)
    {
      haserr = true;
    }
  }
  if (haserr)
  {
    gt_freesuffixarray(suffixarray);
  }
  return haserr ? -1 : 0;
}

// Assembly:
subq $0x68, %rsp
movb %dil, %al
andb $0x1, %al
movb %al, 0x67(%rsp)
movq %rsi, 0x58(%rsp)
movl %edx, 0x54(%rsp)
movq %rcx, 0x48(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x38(%rsp)
movb $0x0, 0x37(%rsp)
movq $0x0, 0x20(%rsp)
cmpq $0x0, 0x38(%rsp)
je 0x233613
movq 0x38(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x2335db
jmp 0x233613
movq 0x4089be(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2e2a27(%rip), %rsi    # 0x516013
leaq 0x2e2bcc(%rip), %rdx    # 0x5161bf
leaq 0x3433d7(%rip), %rcx    # 0x5769d1
leaq 0x343398(%rip), %r8     # 0x576999
movl $0x132, %r9d            # imm = 0x132
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x233615
movq 0x58(%rsp), %rdi
callq 0x233ea0
callq 0xb7a40
movq %rax, 0x28(%rsp)
movl 0x54(%rsp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
jne 0x233641
movq 0x28(%rsp), %rdi
callq 0xba820
jmp 0x23364b
movq 0x28(%rsp), %rdi
callq 0xba7d0
movl 0x54(%rsp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
jne 0x233663
movq 0x28(%rsp), %rdi
callq 0xbaa10
jmp 0x23366d
movq 0x28(%rsp), %rdi
callq 0xba9c0
movl 0x54(%rsp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
jne 0x233687
movq 0x28(%rsp), %rdi
callq 0xba910
jmp 0x233691
movq 0x28(%rsp), %rdi
callq 0xba8c0
movq 0x28(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0xbacf0
movq 0x28(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x38(%rsp), %rdx
callq 0xb7aa0
movq %rax, %rcx
movq 0x58(%rsp), %rax
movq %rcx, (%rax)
movq 0x28(%rsp), %rdi
callq 0xb7e50
movq 0x58(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x2336d9
movb $0x1, 0x37(%rsp)
testb $0x1, 0x37(%rsp)
jne 0x2336ff
movq 0x58(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0x38(%rsp), %rcx
callq 0x233fb0
andb $0x1, %al
movb %al, 0x37(%rsp)
testb $0x1, 0x37(%rsp)
jne 0x233740
movq 0x58(%rsp), %rax
testb $0x1, 0x4c(%rax)
je 0x233740
movq 0x58(%rsp), %rax
movq (%rax), %rdi
callq 0xc2ec0
testb $0x1, %al
jne 0x233740
movq 0x58(%rsp), %rax
movq (%rax), %rdi
movq 0x38(%rsp), %rsi
callq 0xbbd00
cmpl $0x0, %eax
je 0x23373e
movb $0x1, 0x37(%rsp)
jmp 0x233740
testb $0x1, 0x37(%rsp)
jne 0x233759
movq 0x58(%rsp), %rax
movq (%rax), %rdi
callq 0xa9d00
movq %rax, 0x20(%rsp)
testb $0x1, 0x37(%rsp)
jne 0x23399f
movl 0x54(%rsp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x23399f
testb $0x1, 0x67(%rsp)
je 0x2337cf
movq 0x58(%rsp), %rax
cmpq $0x0, 0x50(%rax)
jbe 0x2337ca
movq 0x48(%rsp), %rdi
movq 0x58(%rsp), %rax
movq 0x50(%rax), %rdx
movq 0x38(%rsp), %r8
leaq 0x326150(%rip), %rsi    # 0x5598f1
movl $0x8, %ecx
callq 0xdb500
movq %rax, %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0x58(%rax)
movq 0x58(%rsp), %rax
cmpq $0x0, 0x58(%rax)
jne 0x2337c8
movb $0x1, 0x37(%rsp)
jmp 0x2337ca
jmp 0x233973
movq 0x48(%rsp), %rdi
leaq 0x326116(%rip), %rsi    # 0x5598f1
callq 0xdf410
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq 0x58(%rsp), %rcx
movq 0x50(%rcx), %rcx
shlq $0x2, %rcx
cmpq %rcx, %rax
jne 0x2338ba
movq 0x40(%rsp), %rdi
leaq 0x3431d6(%rip), %rsi    # 0x5769e2
movb $0x0, %al
callq 0xe7cd0
movq 0x48(%rsp), %rdi
movq 0x38(%rsp), %r9
leaq 0x3260cd(%rip), %rsi    # 0x5598f1
leaq 0x3446ba(%rip), %rdx    # 0x577ee5
leaq 0x343167(%rip), %rcx    # 0x576999
movl $0x172, %r8d            # imm = 0x172
callq 0xd92c0
movq %rax, %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0x98(%rax)
movq 0x58(%rsp), %rax
cmpq $0x0, 0x98(%rax)
jne 0x233872
movb $0x1, 0x37(%rsp)
movq 0x58(%rsp), %rax
movq $0x0, 0x90(%rax)
jmp 0x2338b5
movq 0x58(%rsp), %rax
movl $0x0, 0x8c(%rax)
movq 0x58(%rsp), %rax
movl $0x0, 0x88(%rax)
movl $0x4000, %edi           # imm = 0x4000
leaq 0x3430fd(%rip), %rsi    # 0x576999
movl $0x172, %edx            # imm = 0x172
callq 0xe80f0
movq %rax, %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0x90(%rax)
jmp 0x233971
movq 0x40(%rsp), %rdi
leaq 0x34313c(%rip), %rsi    # 0x576a02
movb $0x0, %al
callq 0xe7cd0
movq 0x48(%rsp), %rdi
movq 0x38(%rsp), %r9
leaq 0x326013(%rip), %rsi    # 0x5598f1
leaq 0x344600(%rip), %rdx    # 0x577ee5
leaq 0x3430ad(%rip), %rcx    # 0x576999
movl $0x177, %r8d            # imm = 0x177
callq 0xd92c0
movq %rax, %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0xb0(%rax)
movq 0x58(%rsp), %rax
cmpq $0x0, 0xb0(%rax)
jne 0x23392c
movb $0x1, 0x37(%rsp)
movq 0x58(%rsp), %rax
movq $0x0, 0xa8(%rax)
jmp 0x23396f
movq 0x58(%rsp), %rax
movl $0x0, 0xa4(%rax)
movq 0x58(%rsp), %rax
movl $0x0, 0xa0(%rax)
movl $0x8000, %edi           # imm = 0x8000
leaq 0x343043(%rip), %rsi    # 0x576999
movl $0x177, %edx            # imm = 0x177
callq 0xe80f0
movq %rax, %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0xa8(%rax)
jmp 0x233971
jmp 0x233973
testb $0x1, 0x37(%rsp)
jne 0x23399d
movq 0x58(%rsp), %rax
testb $0x1, 0x38(%rax)
jne 0x23399d
movq 0x38(%rsp), %rdi
leaq 0x343091(%rip), %rsi    # 0x576a22
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x37(%rsp)
jmp 0x23399f
testb $0x1, 0x37(%rsp)
jne 0x233c48
movl 0x54(%rsp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x233c48
testb $0x1, 0x67(%rsp)
je 0x233a15
movq 0x58(%rsp), %rax
cmpq $0x0, 0x50(%rax)
jbe 0x233a10
movq 0x48(%rsp), %rdi
movq 0x58(%rsp), %rax
movq 0x50(%rax), %rdx
movq 0x38(%rsp), %r8
leaq 0x34304f(%rip), %rsi    # 0x576a36
movl $0x1, %ecx
callq 0xdb500
movq %rax, %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0x60(%rax)
movq 0x58(%rsp), %rax
cmpq $0x0, 0x60(%rax)
jne 0x233a0e
movb $0x1, 0x37(%rsp)
jmp 0x233a10
jmp 0x233b0e
movq 0x48(%rsp), %rdi
movq 0x38(%rsp), %r9
leaq 0x343010(%rip), %rsi    # 0x576a36
leaq 0x3444b8(%rip), %rdx    # 0x577ee5
leaq 0x342f65(%rip), %rcx    # 0x576999
movl $0x199, %r8d            # imm = 0x199
callq 0xd92c0
movq %rax, %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0xe0(%rax)
movq 0x58(%rsp), %rax
cmpq $0x0, 0xe0(%rax)
jne 0x233a74
movb $0x1, 0x37(%rsp)
movq 0x58(%rsp), %rax
movq $0x0, 0xd8(%rax)
jmp 0x233ab7
movq 0x58(%rsp), %rax
movl $0x0, 0xd4(%rax)
movq 0x58(%rsp), %rax
movl $0x0, 0xd0(%rax)
movl $0x1000, %edi           # imm = 0x1000
leaq 0x342efb(%rip), %rsi    # 0x576999
movl $0x199, %edx            # imm = 0x199
callq 0xe80f0
movq %rax, %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0xd8(%rax)
testb $0x1, 0x37(%rsp)
jne 0x233b0c
movq 0x58(%rsp), %rax
movq 0xe0(%rax), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x197e0
cmpl $0x0, %eax
je 0x233b0c
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
callq 0x19060
movl (%rax), %edi
callq 0x19200
movq 0x10(%rsp), %rdi
movq %rax, %rdx
leaq 0x342f3b(%rip), %rsi    # 0x576a3b
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x37(%rsp)
jmp 0x233b0e
testb $0x1, 0x37(%rsp)
jne 0x233b38
movq 0x58(%rsp), %rax
testb $0x1, 0x8(%rax)
jne 0x233b38
movq 0x38(%rsp), %rdi
leaq 0x342f2b(%rip), %rsi    # 0x576a57
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x37(%rsp)
testb $0x1, 0x37(%rsp)
jne 0x233c46
movq 0x58(%rsp), %rax
cmpq $0x0, 0x10(%rax)
jbe 0x233c46
testb $0x1, 0x67(%rsp)
je 0x233ba0
movq 0x48(%rsp), %rdi
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rdx
movq 0x38(%rsp), %r8
leaq 0x342f03(%rip), %rsi    # 0x576a77
movl $0x10, %ecx
callq 0xdb500
movq %rax, %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0x68(%rax)
movq 0x58(%rsp), %rax
cmpq $0x0, 0x68(%rax)
jne 0x233b9b
movb $0x1, 0x37(%rsp)
jmp 0x233c44
movq 0x48(%rsp), %rdi
movq 0x38(%rsp), %r9
leaq 0x342ec6(%rip), %rsi    # 0x576a77
leaq 0x34432d(%rip), %rdx    # 0x577ee5
leaq 0x342dda(%rip), %rcx    # 0x576999
movl $0x1ba, %r8d            # imm = 0x1BA
callq 0xd92c0
movq %rax, %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0xf8(%rax)
movq 0x58(%rsp), %rax
cmpq $0x0, 0xf8(%rax)
jne 0x233bff
movb $0x1, 0x37(%rsp)
movq 0x58(%rsp), %rax
movq $0x0, 0xf0(%rax)
jmp 0x233c42
movq 0x58(%rsp), %rax
movl $0x0, 0xec(%rax)
movq 0x58(%rsp), %rax
movl $0x0, 0xe8(%rax)
movl $0x10000, %edi          # imm = 0x10000
leaq 0x342d70(%rip), %rsi    # 0x576999
movl $0x1ba, %edx            # imm = 0x1BA
callq 0xe80f0
movq %rax, %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0xf0(%rax)
jmp 0x233c44
jmp 0x233c46
jmp 0x233c48
testb $0x1, 0x37(%rsp)
jne 0x233d56
movl 0x54(%rsp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x233d56
testb $0x1, 0x67(%rsp)
je 0x233cb0
movq 0x48(%rsp), %rdi
movq 0x20(%rsp), %rdx
addq $0x1, %rdx
movq 0x38(%rsp), %r8
leaq 0x342df8(%rip), %rsi    # 0x576a7c
movl $0x1, %ecx
callq 0xdb500
movq %rax, %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0x70(%rax)
movq 0x58(%rsp), %rax
cmpq $0x0, 0x70(%rax)
jne 0x233cab
movb $0x1, 0x37(%rsp)
jmp 0x233d54
movq 0x48(%rsp), %rdi
movq 0x38(%rsp), %r9
leaq 0x342dbb(%rip), %rsi    # 0x576a7c
leaq 0x34421d(%rip), %rdx    # 0x577ee5
leaq 0x342cca(%rip), %rcx    # 0x576999
movl $0x1cf, %r8d            # imm = 0x1CF
callq 0xd92c0
movq %rax, %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0xc8(%rax)
movq 0x58(%rsp), %rax
cmpq $0x0, 0xc8(%rax)
jne 0x233d0f
movb $0x1, 0x37(%rsp)
movq 0x58(%rsp), %rax
movq $0x0, 0xc0(%rax)
jmp 0x233d52
movq 0x58(%rsp), %rax
movl $0x0, 0xbc(%rax)
movq 0x58(%rsp), %rax
movl $0x0, 0xb8(%rax)
movl $0x1000, %edi           # imm = 0x1000
leaq 0x342c60(%rip), %rsi    # 0x576999
movl $0x1cf, %edx            # imm = 0x1CF
callq 0xe80f0
movq %rax, %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0xc0(%rax)
jmp 0x233d54
jmp 0x233d56
testb $0x1, 0x37(%rsp)
jne 0x233dcd
movl 0x54(%rsp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x233dcd
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %rax
movq (%rax), %rdi
callq 0xb0e80
movq 0x8(%rsp), %rdi
movl %eax, %esi
movq 0x58(%rsp), %rax
movl 0x78(%rax), %edx
movq 0x20(%rsp), %rcx
addq $0x1, %rcx
movq 0x38(%rsp), %r9
movl $0x1, %r8d
callq 0x204d60
movq %rax, %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0x80(%rax)
movq 0x58(%rsp), %rax
cmpq $0x0, 0x80(%rax)
jne 0x233dcb
movb $0x1, 0x37(%rsp)
jmp 0x233dcd
testb $0x1, 0x37(%rsp)
je 0x233dde
movq 0x58(%rsp), %rdi
callq 0x233320
movb 0x37(%rsp), %dl
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testb $0x1, %dl
cmovnel %ecx, %eax
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)