// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/fmi-sufbwtstream.c
// Function: nextesamergedsufbwttabvalues
static int nextesamergedsufbwttabvalues(Definedunsignedlong *longest,
                                       GtUchar *bwtvalue,
                                       GtUword *suftabvalue,
                                       Emissionmergedesa *emmesa,
                                       const GtUword *sequenceoffsettable,
                                       GtUword bwtpos,
                                       GtError *err)
{
  Indexedsuffix indexedsuffix;

  gt_error_check(err);
  if (emmesa->buf.nextaccessidx >= emmesa->buf.nextstoreidx)
  {
    if (emmesa->numofentries == 0)
    {
      return 0;
    }
    if (gt_emissionmergedesa_stepdeleteandinsertothersuffixes(emmesa,err) != 0)
    {
      return -1;
    }
    if (emmesa->buf.nextstoreidx == 0)
    {
      return 0;
    }
    emmesa->buf.nextaccessidx = 0;
  }
  indexedsuffix = emmesa->buf.suftabstore[emmesa->buf.nextaccessidx];
  *suftabvalue = sequenceoffsettable[indexedsuffix.idx] +
                 indexedsuffix.startpos;
  if (indexedsuffix.startpos == 0)
  {
    if (indexedsuffix.idx == 0)
    {
      if (longest->defined)
      {
        gt_error_set(err,"longest is already defined as "GT_WU"",
                      longest->valueunsignedlong);
        return -2;
      }
      longest->defined = true;
      longest->valueunsignedlong = bwtpos;
      *bwtvalue = (GtUchar) GT_UNDEFBWTCHAR;
    } else
    {
      *bwtvalue = (GtUchar) GT_SEPARATOR;
    }
  } else
  {
    *bwtvalue
      = gt_encseq_get_encoded_char( /* Random access */
           emmesa->suffixarraytable[indexedsuffix.idx].encseq,
           indexedsuffix.startpos-1,
           emmesa->suffixarraytable[indexedsuffix.idx].readmode);
  }
  emmesa->buf.nextaccessidx++;
  return 1;
}

// Assembly:
subq $0x48, %rsp
movq 0x50(%rsp), %rax
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
movq %r8, 0x18(%rsp)
movq %r9, 0x10(%rsp)
cmpq $0x0, 0x50(%rsp)
je 0x24f097
movq 0x50(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x24f05f
jmp 0x24f097
movq 0x3ecf3a(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2c6fa3(%rip), %rsi    # 0x516013
leaq 0x2c7148(%rip), %rdx    # 0x5161bf
leaq 0x32a340(%rip), %rcx    # 0x5793be
leaq 0x32a19e(%rip), %r8     # 0x579223
movl $0xc3, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x24f099
movq 0x20(%rsp), %rax
movl 0x18(%rax), %eax
movq 0x20(%rsp), %rcx
cmpl 0x1c(%rcx), %eax
jb 0x24f108
movq 0x20(%rsp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x24f0c3
movl $0x0, 0x44(%rsp)
jmp 0x24f219
movq 0x20(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x4b6380
cmpl $0x0, %eax
je 0x24f0e4
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x24f219
movq 0x20(%rsp), %rax
cmpl $0x0, 0x1c(%rax)
jne 0x24f0fc
movl $0x0, 0x44(%rsp)
jmp 0x24f219
movq 0x20(%rsp), %rax
movl $0x0, 0x18(%rax)
movq 0x20(%rsp), %rax
addq $0x18, %rax
addq $0x10008, %rax          # imm = 0x10008
movq 0x20(%rsp), %rcx
movl 0x18(%rcx), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
movl (%rsp), %ecx
movq (%rax,%rcx,8), %rcx
addq 0x8(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, (%rax)
cmpq $0x0, 0x8(%rsp)
jne 0x24f1ba
cmpl $0x0, (%rsp)
jne 0x24f1b0
movq 0x38(%rsp), %rax
testb $0x1, (%rax)
je 0x24f190
movq 0x50(%rsp), %rdi
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rdx
leaq 0x32a25f(%rip), %rsi    # 0x5793db
movb $0x0, %al
callq 0xd88c0
movl $0xfffffffe, 0x44(%rsp) # imm = 0xFFFFFFFE
jmp 0x24f219
movq 0x38(%rsp), %rax
movb $0x1, (%rax)
movq 0x10(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x30(%rsp), %rax
movb $-0x2, (%rax)
jmp 0x24f1b8
movq 0x30(%rsp), %rax
movb $-0x1, (%rax)
jmp 0x24f203
movq 0x20(%rsp), %rax
movq 0x30058(%rax), %rax
movl (%rsp), %ecx
shlq $0x8, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq 0x8(%rsp), %rsi
subq $0x1, %rsi
movq 0x20(%rsp), %rax
movq 0x30058(%rax), %rax
movl (%rsp), %ecx
shlq $0x8, %rcx
addq %rcx, %rax
movl 0x48(%rax), %edx
callq 0xa9da0
movb %al, %cl
movq 0x30(%rsp), %rax
movb %cl, (%rax)
movq 0x20(%rsp), %rax
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
movl $0x1, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)