// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/clustered_set_uf.c
// Function: gt_clustered_set_union_find_merge_clusters
int gt_clustered_set_union_find_merge_clusters(GtClusteredSet *cs,
                                               GtUword e1,
                                               GtUword e2,
                                               GtError *err)
{
  gt_assert(cs);
  int had_err = 0;
  GtClusteredSetUFClusterInfo *cluster_info_c1 = NULL;
  GtClusteredSetUFClusterInfo *cluster_info_c2 = NULL;
  GtUword target = 0, source = 0, c1 = 0, c2 = 0;
  GtClusteredSetUF *cs_uf = (GtClusteredSetUF*) cs;
  if (e1 == e2) {
    gt_error_set(err, "expected "GT_WU" to be unequal "GT_WU"", e1, e2 );
    had_err = -1;
  }

  if (e1 >= cs_uf->num_of_elems || e2 >= cs_uf->num_of_elems) {
    gt_error_set(err, ""GT_WU" and "GT_WU" must not be larger than "GT_WU"",
                 e1, e2, cs_uf->num_of_elems);
    had_err = -1;
  }

  if (!had_err) {
    if (SINGLETON(e1)) {
       /* printf(""GT_WU" is singleton\n", e1); */
      if (SINGLETON(e2)) {
        /* printf(""GT_WU" is singleton\n", e2);*/
        gt_clustered_set_union_find_make_new_cluster(cs_uf, e1, e2, err);
        gt_bittab_set_bit(cs_uf->in_cluster, e2);
      }
      else {
        c2 = cs_uf->cluster_elems[e2].cluster_num;
        CHECKCLUSTER(c2);
        gt_clustered_set_union_find_append_elem(cs_uf, c2, e1, err);
      }
      gt_bittab_set_bit(cs_uf->in_cluster, e1);
    }
    else {
      c1 = cs_uf->cluster_elems[e1].cluster_num;
      CHECKCLUSTER(c1);
      if (SINGLETON(e2)) {
        gt_clustered_set_union_find_append_elem(cs_uf, c1, e2, err);
        gt_bittab_set_bit(cs_uf->in_cluster, e2);
      }
      else {
        c2 = cs_uf->cluster_elems[e2].cluster_num;
        CHECKCLUSTER(c2);
        cluster_info_c1 = CINFO(c1);
        cluster_info_c2 = CINFO(c2);
        if (cluster_info_c1->cluster_size > cluster_info_c2->cluster_size) {
          target = c1;
          source = c2;
        }
        else {
          target = c1;
          source = c2;
        }
        if (target != source)
          gt_clustered_set_union_find_join_clusters(cs_uf, target, source, err);
      }
    }
  }
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
testq %rdi, %rdi
je 0x298a64
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
cmpq %rdx, %rsi
jne 0x2987c3
leaq 0xe4a50(%rip), %rsi     # 0x37d203
movq %r14, %rdi
movq %r12, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x89dbb
movq 0x28(%rbx), %r8
cmpq %r12, %r8
seta %al
cmpq %r15, %r8
seta %cl
testb %cl, %al
je 0x298939
cmpq %r15, %r12
je 0x298950
movq 0x20(%rbx), %rdi
movq %r12, %rsi
callq 0x5e839
testb %al, %al
je 0x298962
shlq $0x4, %r12
movq 0x10(%rbx), %rax
movq 0x30(%rbx), %rcx
movq (%rax,%r12), %r12
xorl %ebp, %ebp
cmpq %rcx, %r12
jb 0x298826
leaq 0xe4a34(%rip), %rsi     # 0x37d24a
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %rbp
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0x581aa
cmpq $0x0, 0x10(%rax)
jne 0x298850
leaq 0xe4a3c(%rip), %rsi     # 0x37d27c
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %rbp
movq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0x5e839
testb %al, %al
je 0x2989da
shlq $0x4, %r15
movq 0x10(%rbx), %rax
movq 0x30(%rbx), %rcx
movq (%rax,%r15), %r15
cmpq %rcx, %r15
jb 0x298890
leaq 0xe49ca(%rip), %rsi     # 0x37d24a
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %rbp
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0x581aa
cmpq $0x0, 0x10(%rax)
jne 0x2988ba
leaq 0xe49d2(%rip), %rsi     # 0x37d27c
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %rbp
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0x581aa
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0x581aa
cmpq %r15, %r12
je 0x298953
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0x581aa
movq %rax, %r14
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0x581aa
movq (%rax), %rcx
movq 0x10(%rbx), %rdx
movq 0x28(%rbx), %rsi
movq %rcx, %rdi
shlq $0x4, %rdi
movq %r12, (%rdx,%rdi)
movq 0x8(%rdx,%rdi), %rdi
cmpq %rsi, %rdi
jne 0x298900
movq 0x8(%r14), %rdi
shlq $0x4, %rdi
movq %rcx, 0x8(%rdx,%rdi)
movq %rsi, (%rax)
movq 0x10(%rax), %rcx
addq %rcx, 0x10(%r14)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%r14)
andq $0x0, 0x10(%rax)
jmp 0x298953
leaq 0xe48e2(%rip), %rsi     # 0x37d222
movq %r14, %rdi
movq %r12, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0x5e839
testb %al, %al
je 0x2989f1
shlq $0x4, %r15
movq 0x10(%rbx), %rax
movq 0x30(%rbx), %rcx
movq (%rax,%r15), %r15
xorl %ebp, %ebp
cmpq %rcx, %r15
jb 0x2989a0
leaq 0xe48ba(%rip), %rsi     # 0x37d24a
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %rbp
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0x581aa
cmpq $0x0, 0x10(%rax)
jne 0x2989ca
leaq 0xe48c2(%rip), %rsi     # 0x37d27c
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %rbp
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x298a9c
jmp 0x298a53
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x298a9c
movq 0x20(%rbx), %rdi
movq %r15, %rsi
jmp 0x298a5a
movq 0x10(%rbx), %rax
movq 0x30(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x30(%rbx)
movq %r12, %rdx
shlq $0x4, %rdx
movq %rcx, (%rax,%rdx)
movq %r15, %rsi
shlq $0x4, %rsi
movq %rcx, (%rax,%rsi)
movq %r15, 0x8(%rax,%rdx)
movq 0x28(%rbx), %rcx
movq %rcx, 0x8(%rax,%rsi)
leaq 0x8(%rsp), %rsi
movq $0x2, 0x10(%rsi)
movq %r12, (%rsi)
movq %r15, 0x8(%rsi)
movq 0x18(%rbx), %rdi
pushq $0x18
popq %rdx
callq 0x5851d
movq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0x5e143
xorl %ebp, %ebp
movq 0x20(%rbx), %rdi
movq %r12, %rsi
callq 0x5e143
jmp 0x298953
movq 0x19f4fd(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x4c59e(%rip), %rsi     # 0x2e5013
leaq 0xab875(%rip), %rdx     # 0x3442f1
leaq 0xe4755(%rip), %rcx     # 0x37d1d8
leaq 0xe46ae(%rip), %r8      # 0x37d138
movl $0xe2, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390