// File: /workspace/github_c_makefile_star2_O3/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 0x160ff6
movq %rdi, %rbx
cmpq $0x0, (%rdi)
je 0x160ffb
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r12
movq 0x20(%rbx), %r13
testq %r13, %r13
movq %r8, (%rsp)
je 0x160eb3
cmpq %r14, 0x28(%rbx)
jae 0x160ed5
leaq 0x28(%rbx), %r15
leaq 0x226bb0(%rip), %rdx    # 0x387a4a
movq %r13, %rdi
movq %r14, %rsi
movl $0xe5, %ecx
callq 0x104461
movq %rax, %r13
movq %rax, 0x20(%rbx)
jmp 0x160ed2
leaq 0x226b90(%rip), %rsi    # 0x387a4a
movq %r14, %rdi
movl $0xe1, %edx
callq 0x104226
movq %rax, %r13
movq %rax, 0x20(%rbx)
leaq 0x28(%rbx), %r15
movq %r14, (%r15)
testq %r14, %r14
je 0x160f01
xorl %r15d, %r15d
callq 0x170d0
movq (%rax), %rcx
movsbq (%r12,%r15), %rdx
movb (%rcx,%rdx,4), %cl
movq 0x20(%rbx), %rdx
movb %cl, (%rdx,%r15)
incq %r15
cmpq %r15, %r14
jne 0x160ee2
movq 0x20(%rbx), %r13
leaq 0x226b42(%rip), %rsi    # 0x387a4a
leaq -0x4dd87(%rip), %rcx    # 0x113188
movq %r14, %rdi
movl $0xfd, %edx
xorl %r8d, %r8d
callq 0x11327c
leaq 0x8(%rsp), %r12
movq %r13, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x23ba2c
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movl $0x1, %r12d
movq %rbx, %rdi
movl $0x1, %ecx
callq 0x161000
testb %al, %al
jne 0x160fe4
testb %bpl, %bpl
je 0x160fe1
movq 0x20(%rbx), %rdi
movq %r14, %rsi
movq (%rsp), %rdx
callq 0x16eef8
testl %eax, %eax
je 0x160f80
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
js 0x160fe4
callq 0x4cfe8
movq 0x20(%rbx), %r15
leaq 0x226abf(%rip), %rsi    # 0x387a4a
leaq -0x4de0a(%rip), %rcx    # 0x113188
xorl %r12d, %r12d
movq %r14, %rdi
movl $0x109, %edx            # imm = 0x109
xorl %r8d, %r8d
callq 0x11327c
leaq 0x18(%rsp), %r14
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x23ba2c
movq (%r14), %rsi
movq 0x8(%r14), %rdx
cmpq 0x8(%rsp), %rsi
jne 0x160fcd
cmpq 0x10(%rsp), %rdx
je 0x160fe4
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x161000
movl $0x2, %r12d
testb %al, %al
jne 0x160fe4
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4d05a
callq 0x4d021