// File: /workspace/github_c_makefile_star2_O1/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 0x30606f
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
xorl %eax, %eax
cmpq %rdx, %rsi
jne 0x305d5a
leaq 0xe07ee(%rip), %rsi     # 0x3e6533
movq %r14, %rdi
movq %r12, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq 0x28(%rbx), %r8
cmpq %r12, %r8
seta %cl
cmpq %r15, %r8
seta %dl
testb %dl, %cl
jne 0x305d8a
leaq 0xe07dd(%rip), %rsi     # 0x3e6552
movq %r14, %rdi
movq %r12, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x306060
movq 0x20(%rbx), %rdi
movq %r12, %rsi
callq 0xd94c7
testb %al, %al
je 0x305f04
shlq $0x4, %r12
movq 0x10(%rbx), %rax
movq 0x30(%rbx), %rcx
movq (%rax,%r12), %r12
xorl %ebp, %ebp
cmpq %rcx, %r12
jb 0x305ddb
leaq 0xe07b1(%rip), %rsi     # 0x3e657a
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xd47ba
cmpq $0x0, 0x10(%rax)
jne 0x305e07
leaq 0xe07b7(%rip), %rsi     # 0x3e65ac
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0xd94c7
movq 0x10(%rbx), %rcx
movq %r15, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rsi
testb %al, %al
je 0x305fb6
movq (%rsi), %r15
movq 0x30(%rbx), %rcx
cmpq %rcx, %r15
jb 0x305e4f
leaq 0xe073d(%rip), %rsi     # 0x3e657a
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xd47ba
cmpq $0x0, 0x10(%rax)
jne 0x305e7b
leaq 0xe0743(%rip), %rsi     # 0x3e65ac
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xd47ba
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xd47ba
cmpq %r15, %r12
je 0x306060
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xd47ba
movq %rax, %r14
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xd47ba
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 0x305ec5
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)
movq $0x0, 0x10(%rax)
jmp 0x306060
movq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0xd94c7
testb %al, %al
je 0x305ff0
shlq $0x4, %r15
movq 0x10(%rbx), %rax
movq 0x30(%rbx), %rcx
movq (%rax,%r15), %r15
xorl %ebp, %ebp
cmpq %rcx, %r15
jb 0x305f48
leaq 0xe0644(%rip), %rsi     # 0x3e657a
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xd47ba
cmpq $0x0, 0x10(%rax)
jne 0x305f74
leaq 0xe064a(%rip), %rsi     # 0x3e65ac
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x10(%rbx), %rax
movq %r12, %rcx
shlq $0x4, %rcx
movq %r15, (%rax,%rcx)
movq 0x28(%rbx), %rdx
movq %rdx, 0x8(%rax,%rcx)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xd47ba
movq 0x10(%rbx), %rcx
movq 0x8(%rax), %rdx
shlq $0x4, %rdx
movq %r12, 0x8(%rcx,%rdx)
movq %r12, 0x8(%rax)
incq 0x10(%rax)
jmp 0x306054
movq %r12, (%rsi)
movq 0x28(%rbx), %rax
movq %rax, 0x8(%rcx,%rdx)
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xd47ba
movq 0x10(%rbx), %rcx
movq 0x8(%rax), %rdx
shlq $0x4, %rdx
movq %r15, 0x8(%rcx,%rdx)
movq %r15, 0x8(%rax)
incq 0x10(%rax)
movq 0x20(%rbx), %rdi
movq %r15, %rsi
jmp 0x30605b
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
movl $0x18, %edx
callq 0xd49ce
movq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0xd913c
xorl %ebp, %ebp
movq 0x20(%rbx), %rdi
movq %r12, %rsi
callq 0xd913c
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x8ca41