// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/tools/gt_sfxmap.c
// Function: gt_sfxmap_stream_esq
static int gt_sfxmap_stream_esq(const Sfxmapoptions *arguments,GtError *err)
{
  GtEncseqLoader *el = NULL;
  GtEncseq *encseq = NULL;
  bool haserr = false;
  Bitstreamreadmode brsmode = BSRS_stream_single;
  int multiarg = 0;
  GtUword streamesq_size = gt_str_array_size(arguments->streamesq);

  gt_error_check(err);
  if (streamesq_size == 2UL || streamesq_size == 3UL)
  {
    int mode;

    mode = gt_optionargsetsingle(stream_esq_operation,
                                 sizeof stream_esq_operation/
                                 sizeof stream_esq_operation[0],
                                 __func__,
                                 gt_str_array_get(arguments->streamesq,1UL),
                                 err);
    if (mode < 0)
    {
      haserr = true;
    } else
    {
      brsmode = (Bitstreamreadmode) mode;
      if ((brsmode == BSRS_stream_words ||
           brsmode == BSRS_stream_single ||
           brsmode == BSRS_reader_single ||
           brsmode == BSRS_stream_reader_single) &&
           streamesq_size != 2UL)
      {
        gt_error_set(err,"if option -streamesq has one of the arguments "
                         "stream_words stream_single reader_single "
                         "stream_reader_single then no other argument "
                         "is allowed");
        haserr = true;
      } else
      {
        if ((brsmode == BSRS_reader_multi ||
             brsmode == BSRS_stream_reader_multi ||
             brsmode == BSRS_stream_reader_multi3 ||
             brsmode == BSRS_hashfirstcodes) &&
             streamesq_size != 3UL)
        {
          gt_error_set(err,"if option -streamesq has one of the arguments "
                           "stream_multi reader_multi "
                           "stream_reader_multi then one more argument "
                           "is required");
          haserr = true;
        }
      }
    }
    if (!haserr && streamesq_size == 3UL)
    {
      if (sscanf(gt_str_array_get(arguments->streamesq,2UL),"%d",&multiarg)
          != 1 || multiarg < 1)
      {
        gt_error_set(err,"if option -streamesq has three arguments, "
                         "then third argument must be positive integer");
        haserr = true;
      }
    }
  } else
  {
    gt_error_set(err,"option -streamesq must have two or three arguments");
    haserr = true;
  }
  if (!haserr)
  {
    el = gt_encseq_loader_new();
    encseq = gt_encseq_loader_load(el, gt_str_array_get(arguments->streamesq,0),
                                   err);
    if (encseq == NULL)
    {
      haserr = true;
    }
  }
  if (!haserr && brsmode == BSRS_hashfirstcodes)
  {
    if (gt_encseq_mirror(encseq, err) != 0)
    {
      haserr = true;
    }
  }
  if (!haserr)
  {
    gt_assert(multiarg >= 0);
    gt_encseq_faststream(encseq,brsmode,(unsigned int) multiarg);
  }
  gt_encseq_delete(encseq);
  gt_encseq_loader_delete(el);
  return haserr ? -1 : 0;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq $0x0, 0x30(%rsp)
movq $0x0, 0x28(%rsp)
movb $0x0, 0x27(%rsp)
movl $0x1, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x40(%rsp), %rax
movq 0x40(%rax), %rdi
callq 0x11fcc0
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x38(%rsp)
je 0x6b6d8
movq 0x38(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x6b6a0
jmp 0x6b6d8
movq 0x5d08f9(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4aa962(%rip), %rsi    # 0x516013
leaq 0x4aab07(%rip), %rdx    # 0x5161bf
leaq 0x4bfb46(%rip), %rcx    # 0x52b205
leaq 0x4bef24(%rip), %r8     # 0x52a5ea
movl $0x4bb, %r9d            # imm = 0x4BB
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x6b6da
cmpq $0x2, 0x10(%rsp)
je 0x6b6ee
cmpq $0x3, 0x10(%rsp)
jne 0x6b81c
movq 0x40(%rsp), %rax
movq 0x40(%rax), %rdi
movl $0x1, %esi
callq 0x11f8c0
movq %rax, %rcx
movq 0x38(%rsp), %r8
leaq 0x5caa20(%rip), %rdi    # 0x636130
movl $0x8, %esi
leaq 0x4bfae9(%rip), %rdx    # 0x52b205
callq 0x261470
movl %eax, 0xc(%rsp)
cmpl $0x0, 0xc(%rsp)
jge 0x6b736
movb $0x1, 0x27(%rsp)
jmp 0x6b7bc
movl 0xc(%rsp), %eax
movl %eax, 0x20(%rsp)
cmpl $0x0, 0x20(%rsp)
je 0x6b75a
cmpl $0x1, 0x20(%rsp)
je 0x6b75a
cmpl $0x2, 0x20(%rsp)
je 0x6b75a
cmpl $0x3, 0x20(%rsp)
jne 0x6b77c
cmpq $0x2, 0x10(%rsp)
je 0x6b77c
movq 0x38(%rsp), %rdi
leaq 0x4bfaac(%rip), %rsi    # 0x52b21a
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x27(%rsp)
jmp 0x6b7ba
cmpl $0x4, 0x20(%rsp)
je 0x6b798
cmpl $0x5, 0x20(%rsp)
je 0x6b798
cmpl $0x6, 0x20(%rsp)
je 0x6b798
cmpl $0x7, 0x20(%rsp)
jne 0x6b7b8
cmpq $0x3, 0x10(%rsp)
je 0x6b7b8
movq 0x38(%rsp), %rdi
leaq 0x4bfafc(%rip), %rsi    # 0x52b2a8
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x27(%rsp)
jmp 0x6b7ba
jmp 0x6b7bc
testb $0x1, 0x27(%rsp)
jne 0x6b81a
cmpq $0x3, 0x10(%rsp)
jne 0x6b81a
movq 0x40(%rsp), %rax
movq 0x40(%rax), %rdi
movl $0x2, %esi
callq 0x11f8c0
movq %rax, %rdi
leaq 0x531cba(%rip), %rsi    # 0x59d4a2
leaq 0x1c(%rsp), %rdx
movb $0x0, %al
callq 0x19770
cmpl $0x1, %eax
jne 0x6b800
cmpl $0x1, 0x1c(%rsp)
jge 0x6b818
movq 0x38(%rsp), %rdi
leaq 0x4bfb1b(%rip), %rsi    # 0x52b327
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x27(%rsp)
jmp 0x6b81a
jmp 0x6b834
movq 0x38(%rsp), %rdi
leaq 0x4bfb56(%rip), %rsi    # 0x52b37e
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x27(%rsp)
testb $0x1, 0x27(%rsp)
jne 0x6b885
callq 0xb7a40
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
movq 0x40(%rsp), %rax
movq 0x40(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x11f8c0
movq (%rsp), %rdi
movq %rax, %rsi
movq 0x38(%rsp), %rdx
callq 0xb7aa0
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
jne 0x6b883
movb $0x1, 0x27(%rsp)
jmp 0x6b885
testb $0x1, 0x27(%rsp)
jne 0x6b8ae
cmpl $0x7, 0x20(%rsp)
jne 0x6b8ae
movq 0x28(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0xbbd00
cmpl $0x0, %eax
je 0x6b8ac
movb $0x1, 0x27(%rsp)
jmp 0x6b8ae
testb $0x1, 0x27(%rsp)
jne 0x6b90a
jmp 0x6b8b7
cmpl $0x0, 0x1c(%rsp)
jge 0x6b8f6
movq 0x5d06db(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4aa744(%rip), %rsi    # 0x516013
leaq 0x4bfadb(%rip), %rdx    # 0x52b3b1
leaq 0x4bf928(%rip), %rcx    # 0x52b205
leaq 0x4bed06(%rip), %r8     # 0x52a5ea
movl $0x509, %r9d            # imm = 0x509
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x6b8f8
movq 0x28(%rsp), %rdi
movl 0x20(%rsp), %esi
movl 0x1c(%rsp), %edx
callq 0x2f3710
movq 0x28(%rsp), %rdi
callq 0xae070
movq 0x30(%rsp), %rdi
callq 0xb7e50
movb 0x27(%rsp), %dl
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testb $0x1, %dl
cmovnel %ecx, %eax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)