// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/sfx-bentsedg.c
// Function: bentsedgresources_new
static GtBentsedgresources *bentsedgresources_new(
                                   GtSuffixsortspace *suffixsortspace,
                                   const GtEncseq *encseq,
                                   GtReadmode readmode,
                                   unsigned int prefixlength,
                                   const GtBcktab *bcktab,
                                   unsigned int sortmaxdepth,
                                   const Sfxstrategy *sfxstrategy,
                                   bool withlcps)
{
  GtBentsedgresources *bsr = (GtBentsedgresources *) gt_malloc(sizeof *bsr);

  bsr->encseq = encseq;
  bsr->readmode = readmode;
  bsr->totallength = gt_encseq_total_length(encseq);
  bsr->sfxstrategy = sfxstrategy;
  bsr->sssp = suffixsortspace;
  bsr->rsi = NULL;
  bsr->fwd = GT_ISDIRREVERSE(bsr->readmode) ? false : true;
  bsr->complement = GT_ISDIRCOMPLEMENT(bsr->readmode) ? true : false;
  bsr->tableoflcpvalues = NULL;
  bsr->prefixlength = prefixlength;
  bsr->esr1 = gt_encseq_create_reader_with_readmode(encseq, readmode, 0);
  bsr->esr2 = gt_encseq_create_reader_with_readmode(encseq, readmode, 0);
  bsr->radixsortminwidth = gt_radixsort_str_minwidth();
  bsr->radixsortmaxwidth = 0;
  if (gt_encseq_accesstype_get(bsr->encseq) == GT_ACCESS_TYPE_EQUALLENGTH)
  {
    bsr->twobitencoding = gt_encseq_twobitencoding_export(bsr->encseq);
  } else
  {
    bsr->twobitencoding = NULL;
  }
  if (sortmaxdepth > 0)
  {
    if (sortmaxdepth > prefixlength)
    {
      bsr->srs_maxremain = sortmaxdepth - (GtUword) prefixlength;
    } else
    {
      bsr->srs_maxremain = 0;
    }
  } else
  {
    GtUword longestnsp = gt_encseq_lengthoflongestnonspecial(encseq);
    if (longestnsp > (GtUword) prefixlength)
    {
      bsr->srs_maxremain = longestnsp - prefixlength;
    } else
    {
      bsr->srs_maxremain = 0;
    }
  }
  bsr->shortreadsort_maxwidth
    = gt_shortreadsort_maxwidth(false,
                                bsr->srs_maxremain,
                                gt_size_of_sort_workspace (sfxstrategy));
  GT_INITARRAY(&bsr->mkvauxstack,GtMKVstack);
  bsr->countingsortinfo = NULL;
  bsr->medianinfospace = NULL;
  bsr->blindtrie = NULL;
  bsr->equalwithprevious = NULL;
  bsr->srsw = NULL;
  if (!sfxstrategy->cmpcharbychar)
  {
    int idx;
    const bool withmediumsizelcps = (sortmaxdepth > 0 && !withlcps)
                                    ? true : false;
    if (sortmaxdepth == 0 ||
        gt_encseq_has_twobitencoding_stoppos_support(encseq))
    {
      bsr->srsw = gt_shortreadsort_new(0,bsr->srs_maxremain,readmode,false,
                                       withmediumsizelcps);
    }
    for (idx = 0; idx < GT_UNITSIN2BITENC; idx++)
    {
      bsr->leftlcpdist[idx] = bsr->rightlcpdist[idx] = 0;
    }
    bsr->countingsortinfo = gt_malloc(sizeof (*bsr->countingsortinfo) *
                                      sfxstrategy->maxcountingsort);
    if (sfxstrategy->maxwidthrealmedian >= MINMEDIANOF9WIDTH)
    {
      bsr->medianinfospace = gt_malloc(sizeof (*bsr->medianinfospace) *
                                       sfxstrategy->maxwidthrealmedian);
    } else
    {
      bsr->medianinfospace = NULL;
    }
  }
  bsr->blindtrie = gt_blindtrie_new(bsr->sssp,
                                    sfxstrategy->maxbltriesort,
                                    0, /* the nodenumberincrement */
                                    encseq,
                                    sfxstrategy->cmpcharbychar,
                                    bsr->esr1,
                                    bsr->esr2,
                                    readmode);
  if (sortmaxdepth > 0 && bsr->sfxstrategy->maxinsertionsort >= 2UL)
  {
    GtUword idx;

    bsr->equalwithprevious = gt_malloc(sizeof (*bsr->equalwithprevious) *
                                       bsr->sfxstrategy->maxinsertionsort);
    for (idx=0; idx < bsr->sfxstrategy->maxinsertionsort; idx++)
    {
      bsr->equalwithprevious[idx] = false;
    }
  }
  bsr->sortmaxdepth = sortmaxdepth;
  bsr->processunsortedsuffixrange = NULL;
  bsr->processunsortedsuffixrangeinfo = NULL;
  bsr->countinsertionsort = 0;
  bsr->counttqsort = 0;
  bsr->countcountingsort = 0;
  bsr->countbltriesort = 0;
  bsr->countshortreadsort = 0;
  bsr->countradixsort = 0;
  if (bcktab != NULL &&
      sfxstrategy->withradixsort &&
      gt_encseq_accesstype_get(encseq) == GT_ACCESS_TYPE_EQUALLENGTH &&
      readmode == GT_READMODE_FORWARD)
  {
    bsr->rsi = gt_radixsort_str_new(bsr->twobitencoding,
                                    gt_encseq_is_mirrored(encseq)
                                      ? GT_DIV2(bsr->totallength - 1)
                                      : bsr->totallength,
                                    1 + gt_encseq_equallength(encseq),
                                    gt_bcktab_nonspecialsmaxsize(bcktab));
    bsr->radixsortmaxwidth = gt_radixsort_str_maxwidth(bsr->rsi);
  }
  return bsr;
}

// Assembly:
subq $0x98, %rsp
movb 0xa8(%rsp), %al
movq 0xa0(%rsp), %r10
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movl %edx, 0x84(%rsp)
movl %ecx, 0x80(%rsp)
movq %r8, 0x78(%rsp)
movl %r9d, 0x74(%rsp)
andb $0x1, %al
movb %al, 0x73(%rsp)
movl $0x2f8, %edi            # imm = 0x2F8
leaq 0x2d6b80(%rip), %rsi    # 0x588570
movl $0x549, %edx            # imm = 0x549
callq 0xe80f0
movq %rax, 0x68(%rsp)
movq 0x88(%rsp), %rcx
movq 0x68(%rsp), %rax
movq %rcx, (%rax)
movl 0x84(%rsp), %ecx
movq 0x68(%rsp), %rax
movl %ecx, 0x18(%rax)
movq 0x88(%rsp), %rdi
callq 0xa9d00
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0xb0(%rax)
movq 0xa0(%rsp), %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x40(%rax)
movq 0x90(%rsp), %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x48(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x2f0(%rax)
movq 0x68(%rsp), %rcx
movb $0x1, %al
cmpl $0x1, 0x18(%rcx)
movb %al, 0x4f(%rsp)
je 0x2b1a8d
movq 0x68(%rsp), %rax
cmpl $0x3, 0x18(%rax)
sete %al
movb %al, 0x4f(%rsp)
movb 0x4f(%rsp), %dl
movl $0x1, %eax
xorl %ecx, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
cmpl $0x0, %eax
setne %cl
movq 0x68(%rsp), %rax
andb $0x1, %cl
movb %cl, 0x1c(%rax)
movq 0x68(%rsp), %rcx
movb $0x1, %al
cmpl $0x2, 0x18(%rcx)
movb %al, 0x4e(%rsp)
je 0x2b1ad0
movq 0x68(%rsp), %rax
cmpl $0x3, 0x18(%rax)
sete %al
movb %al, 0x4e(%rsp)
movb 0x4e(%rsp), %dl
xorl %eax, %eax
movl $0x1, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
cmpl $0x0, %eax
setne %cl
movq 0x68(%rsp), %rax
andb $0x1, %cl
movb %cl, 0x1d(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x38(%rax)
movl 0x80(%rsp), %ecx
movq 0x68(%rsp), %rax
movl %ecx, 0x64(%rax)
movq 0x88(%rsp), %rdi
movl 0x84(%rsp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0xac380
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x88(%rsp), %rdi
movl 0x84(%rsp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0xac380
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x10(%rax)
callq 0x4d4410
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0xa0(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0xa8(%rax)
movq 0x68(%rsp), %rax
movq (%rax), %rdi
callq 0xc2d90
cmpl $0x2, %eax
jne 0x2b1baa
movq 0x68(%rsp), %rax
movq (%rax), %rdi
callq 0xb5250
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x2e8(%rax)
jmp 0x2b1bba
movq 0x68(%rsp), %rax
movq $0x0, 0x2e8(%rax)
cmpl $0x0, 0x74(%rsp)
jbe 0x2b1bfe
movl 0x74(%rsp), %eax
cmpl 0x80(%rsp), %eax
jbe 0x2b1bec
movl 0x74(%rsp), %eax
movl %eax, %ecx
movl 0x80(%rsp), %eax
subq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x98(%rax)
jmp 0x2b1bfc
movq 0x68(%rsp), %rax
movq $0x0, 0x98(%rax)
jmp 0x2b1c50
movq 0x88(%rsp), %rdi
callq 0xb2980
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
movl 0x80(%rsp), %ecx
cmpq %rcx, %rax
jbe 0x2b1c3e
movq 0x60(%rsp), %rcx
movl 0x80(%rsp), %eax
subq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x98(%rax)
jmp 0x2b1c4e
movq 0x68(%rsp), %rax
movq $0x0, 0x98(%rax)
jmp 0x2b1c50
movq 0x68(%rsp), %rax
movq 0x98(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0xa0(%rsp), %rdi
callq 0x2b1680
movq 0x40(%rsp), %rsi
movq %rax, %rdx
xorl %edi, %edi
callq 0x2da680
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0xb8(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x20(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x30(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x28(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x2d8(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x2d0(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x2c8(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x2c0(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x2e0(%rax)
movq 0xa0(%rsp), %rax
testb $0x1, 0x2c(%rax)
jne 0x2b1e63
xorl %eax, %eax
cmpl $0x0, 0x74(%rsp)
movb %al, 0x3f(%rsp)
jbe 0x2b1d2c
movb 0x73(%rsp), %al
xorb $-0x1, %al
movb %al, 0x3f(%rsp)
movb 0x3f(%rsp), %dl
xorl %eax, %eax
movl $0x1, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, 0x5b(%rsp)
cmpl $0x0, 0x74(%rsp)
je 0x2b1d63
movq 0x88(%rsp), %rdi
callq 0xac770
testb $0x1, %al
jne 0x2b1d63
jmp 0x2b1d9a
movq 0x68(%rsp), %rax
movq 0x98(%rax), %rsi
movl 0x84(%rsp), %edx
movb 0x5b(%rsp), %al
xorl %ecx, %ecx
movl %ecx, %edi
xorl %ecx, %ecx
andb $0x1, %al
movzbl %al, %r8d
callq 0x2da6d0
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x2e0(%rax)
movl $0x0, 0x5c(%rsp)
cmpl $0x20, 0x5c(%rsp)
jge 0x2b1de2
movq 0x68(%rsp), %rax
movslq 0x5c(%rsp), %rcx
movq $0x0, 0x1c0(%rax,%rcx,8)
movq 0x68(%rsp), %rax
movslq 0x5c(%rsp), %rcx
movq $0x0, 0xc0(%rax,%rcx,8)
movl 0x5c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c(%rsp)
jmp 0x2b1da2
movq 0xa0(%rsp), %rax
movq 0x18(%rax), %rdi
shlq $0x4, %rdi
leaq 0x2d6777(%rip), %rsi    # 0x588570
movl $0x58e, %edx            # imm = 0x58E
callq 0xe80f0
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x2d8(%rax)
movq 0xa0(%rsp), %rax
cmpq $0x1f, (%rax)
jb 0x2b1e51
movq 0xa0(%rsp), %rax
movq (%rax), %rdi
shlq $0x5, %rdi
leaq 0x2d673a(%rip), %rsi    # 0x588570
movl $0x592, %edx            # imm = 0x592
callq 0xe80f0
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x2d0(%rax)
jmp 0x2b1e61
movq 0x68(%rsp), %rax
movq $0x0, 0x2d0(%rax)
jmp 0x2b1e63
movq 0x68(%rsp), %rax
movq 0x48(%rax), %rdi
movq 0xa0(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x88(%rsp), %rcx
movq 0xa0(%rsp), %rax
movb 0x2c(%rax), %r8b
movq 0x68(%rsp), %rax
movq 0x8(%rax), %r9
movq 0x68(%rsp), %rax
movq 0x10(%rax), %r10
movl 0x84(%rsp), %eax
xorl %edx, %edx
andb $0x1, %r8b
movzbl %r8b, %r8d
movq %r10, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x2b7ea0
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x2c8(%rax)
cmpl $0x0, 0x74(%rsp)
jbe 0x2b1f5b
movq 0x68(%rsp), %rax
movq 0x40(%rax), %rax
cmpq $0x2, 0x8(%rax)
jb 0x2b1f5b
movq 0x68(%rsp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rdi
shlq $0x0, %rdi
leaq 0x2d6672(%rip), %rsi    # 0x588570
movl $0x5a5, %edx            # imm = 0x5A5
callq 0xe80f0
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x2c0(%rax)
movq $0x0, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq 0x68(%rsp), %rcx
movq 0x40(%rcx), %rcx
cmpq 0x8(%rcx), %rax
jae 0x2b1f59
movq 0x68(%rsp), %rax
movq 0x2c0(%rax), %rax
movq 0x50(%rsp), %rcx
movb $0x0, (%rax,%rcx)
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0x2b1f20
jmp 0x2b1f5b
movl 0x74(%rsp), %ecx
movq 0x68(%rsp), %rax
movl %ecx, 0x60(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x50(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x58(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x68(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x70(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x88(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x90(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x78(%rax)
movq 0x68(%rsp), %rax
movq $0x0, 0x80(%rax)
cmpq $0x0, 0x78(%rsp)
je 0x2b20d9
movq 0xa0(%rsp), %rax
testb $0x1, 0x37(%rax)
je 0x2b20d9
movq 0x88(%rsp), %rdi
callq 0xc2d90
cmpl $0x2, %eax
jne 0x2b20d9
cmpl $0x0, 0x84(%rsp)
jne 0x2b20d9
movq 0x68(%rsp), %rax
movq 0x2e8(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x88(%rsp), %rdi
callq 0xc2ec0
testb $0x1, %al
jne 0x2b203e
jmp 0x2b2058
movq 0x68(%rsp), %rax
movq 0xb0(%rax), %rax
subq $0x1, %rax
shrq %rax
movq %rax, 0x28(%rsp)
jmp 0x2b2069
movq 0x68(%rsp), %rax
movq 0xb0(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x88(%rsp), %rdi
callq 0xc2da0
addq $0x1, %rax
movq %rax, 0x20(%rsp)
movq 0x78(%rsp), %rdi
callq 0x205e90
movq 0x30(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq %rax, %rcx
callq 0x4d4010
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x2f0(%rax)
movq 0x68(%rsp), %rax
movq 0x2f0(%rax), %rdi
callq 0x4d4420
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0xa8(%rax)
movq 0x68(%rsp), %rax
addq $0x98, %rsp
retq
nopw %cs:(%rax,%rax)