// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/core/encseq.c
// Function: gt_encseq_builder_add_encoded_generic
static void gt_encseq_builder_add_encoded_generic(GtEncseqBuilder *eb,
                                                  const GtUchar *str,
                                                  GtUword strlen,
                                                  const char *desc,
                                                  bool copy)
{
  GtUword i, offset;
  gt_assert(eb && str);
  if (eb->plainseq == NULL) {
    if (!copy) {
      eb->plainseq = (GtUchar*) str;
      eb->own = false;
    } else {
      eb->plainseq = gt_malloc((size_t) strlen * sizeof (GtUchar));
      eb->allocated = (size_t) (strlen * sizeof (GtUchar));
      memcpy(eb->plainseq, str, (size_t) strlen * sizeof (GtUchar));
      eb->own = true;
    }
    eb->seqlen = strlen;
    eb->firstseq = false;
    eb->nof_seqs++;
    if (eb->wdestab) {
      gt_assert(desc);
      gt_str_append_cstr(eb->destab, desc);
      gt_str_append_char(eb->destab, '\n');
      /* store description separator position, if not first description */
      if (eb->wsdstab) {
        GT_STOREINARRAY(&eb->sdstab, GtUword, 128,
                        gt_str_length(eb->destab)-1);
      }
      eb->firstdesc = false;
    }
  } else {
    if (!eb->own) {
      GtUchar *theirseq = eb->plainseq;
      eb->plainseq = gt_malloc((size_t) eb->seqlen * sizeof (GtUchar));
      eb->allocated = (size_t) (eb->seqlen * sizeof (GtUchar));
      memcpy(eb->plainseq, theirseq, (size_t) eb->seqlen);
    }
    /* store separator position if needed */
    if (eb->wssptab && !eb->firstseq) {
      GT_STOREINARRAY(&eb->ssptab, GtUword, 128, eb->seqlen);
    }
    /* from the second sequence on, add a separator before adding symbols */
    if (!eb->firstseq) {
      eb->plainseq = gt_dynalloc(eb->plainseq, &eb->allocated,
                                 (eb->seqlen + strlen+1) * sizeof (GtUchar));
      eb->plainseq[eb->seqlen] = (GtUchar) GT_SEPARATOR;
      offset = eb->seqlen+1;
      eb->seqlen += strlen+1;
    } else {
      eb->plainseq = gt_dynalloc(eb->plainseq, &eb->allocated,
                                 strlen * sizeof (GtUchar));
      offset = 0;
      eb->seqlen = strlen;
      eb->firstseq = false;
    }
    /* append description to in-memory description table */
    if (eb->wdestab) {
      gt_assert(desc);
      gt_str_append_cstr(eb->destab, desc);
      gt_str_append_char(eb->destab, '\n');
      eb->firstdesc = false;
      /* store description separator position, if not first description */
      if (eb->wsdstab) {
        GT_STOREINARRAY(&eb->sdstab, GtUword, 128,
                        gt_str_length(eb->destab)-1);
      }

    }
    for (i=0;i < strlen; i++) {
      eb->plainseq[offset+i] = str[i];
    }
    eb->nof_seqs++;
    eb->own = true;
  }
  if (eb->minseqlen == GT_UNDEF_UWORD || strlen < eb->minseqlen)
    eb->minseqlen = strlen;
  if (eb->maxseqlen == GT_UNDEF_UWORD || strlen > eb->maxseqlen)
    eb->maxseqlen = strlen;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0xafa80
movq %rsi, %r15
testq %rsi, %rsi
je 0xafa80
movq %rcx, %r12
movq %rdx, %rbx
movq %rdi, %r14
movq (%rdi), %r13
testq %r13, %r13
je 0xaf7f9
cmpb $0x0, 0x68(%r14)
jne 0xaf7cc
movq 0x8(%r14), %rdi
leaq 0x3c3ee(%rip), %rsi     # 0xebb9a
movl $0x233f, %edx           # imm = 0x233F
callq 0xccb0
movq %rax, (%r14)
movq 0x8(%r14), %rdx
movq %rdx, 0x60(%r14)
movq %rax, %rdi
movq %r13, %rsi
callq 0xb520
cmpb $0x1, 0x6b(%r14)
jne 0xaf8d8
cmpb $0x0, 0x6e(%r14)
jne 0xaf8d8
movq 0x48(%r14), %rax
cmpq %rax, 0x50(%r14)
jae 0xaf88f
movq 0x40(%r14), %rax
jmp 0xaf8bb
testb %r8b, %r8b
je 0xaf82b
leaq 0x3c395(%rip), %rsi     # 0xebb9a
movq %rbx, %rdi
movl $0x2329, %edx           # imm = 0x2329
callq 0xccb0
movq %rax, (%r14)
movq %rbx, 0x60(%r14)
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0xb520
movb $0x1, %al
jmp 0xaf830
movq %r15, (%r14)
xorl %eax, %eax
movb %al, 0x68(%r14)
movq %rbx, 0x8(%r14)
movb $0x0, 0x6e(%r14)
incq 0x10(%r14)
cmpb $0x1, 0x6a(%r14)
jne 0xafa44
testq %r12, %r12
je 0xafae2
movq 0x58(%r14), %rdi
movq %r12, %rsi
callq 0x13dd3
movq 0x58(%r14), %rdi
pushq $0xa
popq %rsi
callq 0x140b1
cmpb $0x1, 0x6c(%r14)
jne 0xafa3f
movq 0x30(%r14), %rax
cmpq %rax, 0x38(%r14)
jae 0xaf9ea
movq 0x28(%r14), %rax
jmp 0xafa16
leaq 0x80(%rax), %rcx
movq %rcx, 0x48(%r14)
movq 0x40(%r14), %rdi
leaq 0x400(,%rax,8), %rsi
leaq 0x3c2ed(%rip), %rdx     # 0xebb9a
movl $0x2345, %ecx           # imm = 0x2345
callq 0xcfc2
movq %rax, 0x40(%r14)
testq %rax, %rax
je 0xafb13
movq 0x8(%r14), %rcx
movq 0x50(%r14), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, 0x50(%r14)
movq %rcx, (%rax,%rdx,8)
movq (%r14), %rdi
leaq 0x60(%r14), %rsi
cmpb $0x0, 0x6e(%r14)
je 0xaf8ff
movq %rbx, %rdx
callq 0x516a0
movq %rax, (%r14)
movq %rbx, 0x8(%r14)
movb $0x0, 0x6e(%r14)
xorl %r13d, %r13d
jmp 0xaf929
leaq 0x1(%rbx), %rdx
addq 0x8(%r14), %rdx
callq 0x516a0
movq %rax, (%r14)
movq 0x8(%r14), %rcx
movb $-0x1, (%rax,%rcx)
movq 0x8(%r14), %r13
leaq (%rbx,%r13), %rax
incq %rax
incq %r13
movq %rax, 0x8(%r14)
cmpb $0x1, 0x6a(%r14)
jne 0xaf9c6
testq %r12, %r12
je 0xafab1
movq 0x58(%r14), %rdi
movq %r12, %rsi
callq 0x13dd3
movq 0x58(%r14), %rdi
pushq $0xa
popq %rsi
callq 0x140b1
movb $0x0, 0x6d(%r14)
cmpb $0x1, 0x6c(%r14)
jne 0xaf9c6
movq 0x30(%r14), %rax
cmpq %rax, 0x38(%r14)
jae 0xaf971
movq 0x28(%r14), %rax
jmp 0xaf99d
leaq 0x80(%rax), %rcx
movq %rcx, 0x30(%r14)
movq 0x28(%r14), %rdi
leaq 0x400(,%rax,8), %rsi
leaq 0x3c20b(%rip), %rdx     # 0xebb9a
movl $0x235e, %ecx           # imm = 0x235E
callq 0xcfc2
movq %rax, 0x28(%r14)
testq %rax, %rax
je 0xafb41
movq 0x58(%r14), %rdi
callq 0x14461
decq %rax
movq 0x28(%r14), %rcx
movq 0x38(%r14), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, 0x38(%r14)
movq %rax, (%rcx,%rdx,8)
xorl %eax, %eax
cmpq %rax, %rbx
je 0xaf9df
movb (%r15,%rax), %cl
movq (%r14), %rdx
addq %r13, %rdx
movb %cl, (%rax,%rdx)
incq %rax
jmp 0xaf9c8
incq 0x10(%r14)
movb $0x1, 0x68(%r14)
jmp 0xafa44
leaq 0x80(%rax), %rcx
movq %rcx, 0x30(%r14)
movq 0x28(%r14), %rdi
leaq 0x400(,%rax,8), %rsi
leaq 0x3c192(%rip), %rdx     # 0xebb9a
movl $0x2338, %ecx           # imm = 0x2338
callq 0xcfc2
movq %rax, 0x28(%r14)
testq %rax, %rax
je 0xafb6f
movq 0x58(%r14), %rdi
callq 0x14461
decq %rax
movq 0x28(%r14), %rcx
movq 0x38(%r14), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, 0x38(%r14)
movq %rax, (%rcx,%rdx,8)
movb $0x0, 0x6d(%r14)
movq 0x18(%r14), %rax
cmpq $-0x1, %rax
setne %cl
cmpq %rbx, %rax
setbe %al
testb %al, %cl
jne 0xafa5d
movq %rbx, 0x18(%r14)
movq 0x20(%r14), %rax
cmpq $-0x1, %rax
setne %cl
cmpq %rbx, %rax
setae %al
testb %al, %cl
jne 0xafa76
movq %rbx, 0x20(%r14)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x7e531(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x1a5d5(%rip), %rsi     # 0xca066
leaq 0x3e361(%rip), %rdx     # 0xeddf9
leaq 0x40b7b(%rip), %rcx     # 0xf061a
leaq 0x3c0f4(%rip), %r8      # 0xebb9a
movl $0x2323, %r9d           # imm = 0x2323
jmp 0xafb9b
movq 0x7e500(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x1a5a4(%rip), %rsi     # 0xca066
leaq 0x34355(%rip), %rdx     # 0xe3e1e
leaq 0x40b4a(%rip), %rcx     # 0xf061a
leaq 0x3c0c3(%rip), %r8      # 0xebb9a
movl $0x2357, %r9d           # imm = 0x2357
jmp 0xafb9b
movq 0x7e4cf(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x1a573(%rip), %rsi     # 0xca066
leaq 0x34324(%rip), %rdx     # 0xe3e1e
leaq 0x40b19(%rip), %rcx     # 0xf061a
leaq 0x3c092(%rip), %r8      # 0xebb9a
movl $0x2332, %r9d           # imm = 0x2332
jmp 0xafb9b
movq 0x7e49e(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x1a542(%rip), %rsi     # 0xca066
leaq 0x3e2f3(%rip), %rdx     # 0xede1e
leaq 0x40ae8(%rip), %rcx     # 0xf061a
leaq 0x3c061(%rip), %r8      # 0xebb9a
movl $0x2345, %r9d           # imm = 0x2345
jmp 0xafb9b
movq 0x7e470(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x1a514(%rip), %rsi     # 0xca066
leaq 0x3e2e9(%rip), %rdx     # 0xede42
leaq 0x40aba(%rip), %rcx     # 0xf061a
leaq 0x3c033(%rip), %r8      # 0xebb9a
movl $0x235e, %r9d           # imm = 0x235E
jmp 0xafb9b
movq 0x7e442(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x1a4e6(%rip), %rsi     # 0xca066
leaq 0x3e2bb(%rip), %rdx     # 0xede42
leaq 0x40a8c(%rip), %rcx     # 0xf061a
leaq 0x3c005(%rip), %r8      # 0xebb9a
movl $0x2338, %r9d           # imm = 0x2338
xorl %eax, %eax
callq 0xb8c0
callq 0xb300