// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/extended/md5set.c
// Function: gt_md5set_add_sequence
GtMD5SetStatus gt_md5set_add_sequence(GtMD5Set *set, const char* seq,
                                      GtUword seqlen, bool both_strands,
                                      GtError *err)
{
  md5_t md5sum, md5sum_rc;
  GtUword i;
  int retval = 0;
  bool found;

  gt_assert(set != NULL);
  gt_assert(set->table != NULL);

  md5set_prepare_buffer(set, seqlen);
  for (i = 0; i < seqlen; i++)
    set->buffer[i] = toupper(seq[i]);

  MD5SET_HASH_STRING(set->buffer, seqlen, md5sum);
  found = md5set_search(set, md5sum, true);
  if (found)
    return GT_MD5SET_FOUND;

  if (both_strands) {
    retval = gt_reverse_complement(set->buffer, seqlen, err);
    if (retval != 0) {
      gt_assert(retval < 0);
      return GT_MD5SET_ERROR;
    }

    MD5SET_HASH_STRING(set->buffer, seqlen, md5sum_rc);
    /* if the MD5 sum of the reverse complement equals the MD5 sum of the
       sequence itself we don't check if the reverse complement is in the set.
       Otherwise such sequences would never be added to the set at all. */
    if (md5sum_rc.l == md5sum.l && md5sum_rc.h == md5sum.h) {
      return GT_MD5SET_NOT_FOUND;
    }
    found = md5set_search(set, md5sum_rc, false);
    if (found)
      return GT_MD5SET_RC_FOUND;
  }

  return GT_MD5SET_NOT_FOUND;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testq %rdi, %rdi
je 0x168da1
movq %rdi, %rbx
cmpq $0x0, (%rdi)
je 0x168da6
movq %r8, %r15
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r12
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x168c5c
cmpq %r14, 0x28(%rbx)
jae 0x168c7c
leaq 0x28(%rbx), %r13
leaq 0x2281da(%rip), %rdx    # 0x390e23
movq %r14, %rsi
movl $0xe5, %ecx
callq 0x1094e6
movq %rax, 0x20(%rbx)
jmp 0x168c78
leaq 0x2281c0(%rip), %rsi    # 0x390e23
movq %r14, %rdi
movl $0xe1, %edx
callq 0x1092b2
movq %rax, 0x20(%rbx)
leaq 0x28(%rbx), %r13
movq %r14, (%r13)
testq %r14, %r14
je 0x168ca4
xorl %r13d, %r13d
callq 0x170d0
movq (%rax), %rcx
movsbq (%r12,%r13), %rdx
movb (%rcx,%rdx,4), %cl
movq 0x20(%rbx), %rdx
movb %cl, (%rdx,%r13)
incq %r13
cmpq %r13, %r14
jne 0x168c89
movq 0x20(%rbx), %r12
leaq 0x228174(%rip), %rsi    # 0x390e23
leaq -0x50492(%rip), %rcx    # 0x118824
movq %r14, %rdi
movl $0xfd, %edx
xorl %r8d, %r8d
callq 0x118918
leaq 0x18(%rsp), %r13
movq %r12, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x244498
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movl $0x1, %r12d
movq %rbx, %rdi
movl $0x1, %ecx
callq 0x168dab
testb %al, %al
jne 0x168d8f
testb %bpl, %bpl
je 0x168d8c
movq 0x20(%rbx), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x177290
testl %eax, %eax
je 0x168d25
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
js 0x168d8f
callq 0x4de6b
movq 0x20(%rbx), %r15
leaq 0x2280f3(%rip), %rsi    # 0x390e23
leaq -0x50513(%rip), %rcx    # 0x118824
xorl %r12d, %r12d
movq %r14, %rdi
movl $0x109, %edx            # imm = 0x109
xorl %r8d, %r8d
callq 0x118918
leaq 0x8(%rsp), %r14
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x244498
movq (%r14), %rsi
cmpq 0x18(%rsp), %rsi
jne 0x168d73
movq 0x10(%rsp), %rax
cmpq 0x20(%rsp), %rax
je 0x168d8f
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x168dab
movl $0x2, %r12d
testb %al, %al
jne 0x168d8f
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4dedd
callq 0x4dea4