// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/core/encseq.c
// Function: gt_encseq_builder_add_cstr
void gt_encseq_builder_add_cstr(GtEncseqBuilder *eb, const char *str,
                                GtUword strlen, const char *desc)
{
  GtUword i, offset;
  gt_assert(eb && str);
  if (eb->plainseq && !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');
    /* store description separator position */
    if (eb->wsdstab) {
      GT_STOREINARRAY(&eb->sdstab, GtUword, 128,
                      gt_str_length(eb->destab)-1);
    }
    eb->firstdesc = false;
  }
  /* copy sequence, encode on the fly */
  for (i=0;i < strlen; i++) {
    gt_assert(gt_alphabet_valid_input(eb->alpha, str[i]));
    eb->plainseq[offset+i] = gt_alphabet_encode(eb->alpha, str[i]);
  }
  eb->nof_seqs++;
  if (eb->minseqlen == GT_UNDEF_UWORD || strlen < eb->minseqlen)
    eb->minseqlen = strlen;
  if (eb->maxseqlen == GT_UNDEF_UWORD || strlen > eb->maxseqlen)
    eb->maxseqlen = strlen;
  eb->own = true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0xaf5b1
movq %rsi, %r15
testq %rsi, %rsi
je 0xaf5b1
movq %rcx, %r12
movq %rdx, %r14
movq %rdi, %rbx
movq (%rdi), %r13
testq %r13, %r13
je 0xaf3b0
cmpb $0x0, 0x68(%rbx)
jne 0xaf3b0
movq 0x8(%rbx), %rdi
leaq 0x3c80a(%rip), %rsi     # 0xebb9a
movl $0x22e6, %edx           # imm = 0x22E6
callq 0xccb0
movq %rax, (%rbx)
movq 0x8(%rbx), %rdx
movq %rdx, 0x60(%rbx)
movq %rax, %rdi
movq %r13, %rsi
callq 0xb520
cmpb $0x1, 0x6b(%rbx)
jne 0xaf415
cmpb $0x0, 0x6e(%rbx)
jne 0xaf415
movq 0x48(%rbx), %rax
cmpq %rax, 0x50(%rbx)
jae 0xaf3cc
movq 0x40(%rbx), %rax
jmp 0xaf3f8
leaq 0x80(%rax), %rcx
movq %rcx, 0x48(%rbx)
movq 0x40(%rbx), %rdi
leaq 0x400(,%rax,8), %rsi
leaq 0x3c7b0(%rip), %rdx     # 0xebb9a
movl $0x22ec, %ecx           # imm = 0x22EC
callq 0xcfc2
movq %rax, 0x40(%rbx)
testq %rax, %rax
je 0xaf60d
movq 0x8(%rbx), %rcx
movq 0x50(%rbx), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, 0x50(%rbx)
movq %rcx, (%rax,%rdx,8)
movq (%rbx), %rdi
leaq 0x60(%rbx), %rsi
cmpb $0x0, 0x6e(%rbx)
je 0xaf43a
movq %r14, %rdx
callq 0x516a0
movq %rax, (%rbx)
movq %r14, 0x8(%rbx)
movb $0x0, 0x6e(%rbx)
xorl %r13d, %r13d
jmp 0xaf464
leaq 0x1(%r14), %rdx
addq 0x8(%rbx), %rdx
callq 0x516a0
movq %rax, (%rbx)
movq 0x8(%rbx), %rcx
movb $-0x1, (%rax,%rcx)
movq 0x8(%rbx), %r13
leaq (%r14,%r13), %rax
incq %rax
incq %r13
movq %rax, 0x8(%rbx)
cmpb $0x1, 0x6a(%rbx)
jne 0xaf4fe
testq %r12, %r12
je 0xaf5df
movq 0x58(%rbx), %rdi
movq %r12, %rsi
callq 0x13dd3
movq 0x58(%rbx), %rdi
pushq $0xa
popq %rsi
callq 0x140b1
cmpb $0x1, 0x6c(%rbx)
jne 0xaf4fa
movq 0x30(%rbx), %rax
cmpq %rax, 0x38(%rbx)
jae 0xaf4a5
movq 0x28(%rbx), %rax
jmp 0xaf4d1
leaq 0x80(%rax), %rcx
movq %rcx, 0x30(%rbx)
movq 0x28(%rbx), %rdi
leaq 0x400(,%rax,8), %rsi
leaq 0x3c6d7(%rip), %rdx     # 0xebb9a
movl $0x2304, %ecx           # imm = 0x2304
callq 0xcfc2
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0xaf63e
movq 0x58(%rbx), %rdi
callq 0x14461
decq %rax
movq 0x28(%rbx), %rcx
movq 0x38(%rbx), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, 0x38(%rbx)
movq %rax, (%rcx,%rdx,8)
movb $0x0, 0x6d(%rbx)
xorl %r12d, %r12d
cmpq %r12, %r14
je 0xaf535
movq 0x70(%rbx), %rdi
movsbl (%r15,%r12), %esi
callq 0x9be52
testb %al, %al
je 0xaf579
movq 0x70(%rbx), %rdi
movsbl (%r15,%r12), %esi
callq 0x9be5e
movq (%rbx), %rcx
addq %r13, %rcx
movb %al, (%r12,%rcx)
incq %r12
jmp 0xaf501
incq 0x10(%rbx)
movq 0x18(%rbx), %rax
cmpq $-0x1, %rax
setne %cl
cmpq %r14, %rax
setbe %al
testb %al, %cl
jne 0xaf552
movq %r14, 0x18(%rbx)
movq 0x20(%rbx), %rax
cmpq $-0x1, %rax
setne %cl
cmpq %r14, %rax
setae %al
testb %al, %cl
jne 0xaf56b
movq %r14, 0x20(%rbx)
movb $0x1, 0x68(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x7ea38(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x1aadc(%rip), %rsi     # 0xca066
leaq 0x3e8d5(%rip), %rdx     # 0xede66
leaq 0x3e86b(%rip), %rcx     # 0xede03
leaq 0x3c5fb(%rip), %r8      # 0xebb9a
movl $0x230a, %r9d           # imm = 0x230A
xorl %eax, %eax
callq 0xb8c0
callq 0xb300
movq 0x7ea00(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x1aaa4(%rip), %rsi     # 0xca066
leaq 0x3e830(%rip), %rdx     # 0xeddf9
leaq 0x3e833(%rip), %rcx     # 0xede03
leaq 0x3c5c3(%rip), %r8      # 0xebb9a
movl $0x22e3, %r9d           # imm = 0x22E3
jmp 0xaf5a5
movq 0x7e9d2(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x1aa76(%rip), %rsi     # 0xca066
leaq 0x34827(%rip), %rdx     # 0xe3e1e
leaq 0x3e805(%rip), %rcx     # 0xede03
leaq 0x3c595(%rip), %r8      # 0xebb9a
movl $0x22fe, %r9d           # imm = 0x22FE
jmp 0xaf5a5
movq 0x7e9a4(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x1aa48(%rip), %rsi     # 0xca066
leaq 0x3e7f9(%rip), %rdx     # 0xede1e
leaq 0x3e7d7(%rip), %rcx     # 0xede03
leaq 0x3c567(%rip), %r8      # 0xebb9a
movl $0x22ec, %r9d           # imm = 0x22EC
jmp 0xaf5a5
movq 0x7e973(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x1aa17(%rip), %rsi     # 0xca066
leaq 0x3e7ec(%rip), %rdx     # 0xede42
leaq 0x3e7a6(%rip), %rcx     # 0xede03
leaq 0x3c536(%rip), %r8      # 0xebb9a
movl $0x2304, %r9d           # imm = 0x2304
jmp 0xaf5a5