// File: /workspace/github_c_makefile_star2_O3/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 0x2fc38a
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
cmpq %rdx, %rsi
jne 0x2fc079
leaq 0xe0dec(%rip), %rsi     # 0x3dce33
movq %r14, %rdi
movq %r12, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0xfcb67
movq 0x28(%rbx), %r8
cmpq %r12, %r8
seta %al
cmpq %r15, %r8
seta %cl
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb %cl, %al
jne 0x2fc37b
jmp 0x2fc1fe
movq 0x28(%rbx), %r8
cmpq %r12, %r8
seta %al
cmpq %r15, %r8
seta %cl
testb %cl, %al
je 0x2fc1fe
movq 0x20(%rbx), %rdi
movq %r12, %rsi
callq 0xd6e4a
testb %al, %al
je 0x2fc21f
shlq $0x4, %r12
movq 0x10(%rbx), %rax
movq 0x30(%rbx), %rcx
movq (%rax,%r12), %r12
xorl %ebp, %ebp
cmpq %rcx, %r12
jb 0x2fc0d5
leaq 0xe0db7(%rip), %rsi     # 0x3dce7a
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xd2207
cmpq $0x0, 0x10(%rax)
jne 0x2fc101
leaq 0xe0dbd(%rip), %rsi     # 0x3dceac
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0xd6e4a
movq 0x10(%rbx), %rcx
movq %r15, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rsi
testb %al, %al
je 0x2fc2d1
movq (%rsi), %r15
movq 0x30(%rbx), %rcx
cmpq %rcx, %r15
jb 0x2fc149
leaq 0xe0d43(%rip), %rsi     # 0x3dce7a
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xd2207
cmpq $0x0, 0x10(%rax)
jne 0x2fc175
leaq 0xe0d49(%rip), %rsi     # 0x3dceac
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xd2207
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xd2207
cmpq %r15, %r12
je 0x2fc37b
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xd2207
movq %rax, %r14
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xd2207
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 0x2fc1bf
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 0x2fc37b
leaq 0xe0c4d(%rip), %rsi     # 0x3dce52
movq %r14, %rdi
movq %r12, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x2fc37b
movq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0xd6e4a
testb %al, %al
je 0x2fc30b
shlq $0x4, %r15
movq 0x10(%rbx), %rax
movq 0x30(%rbx), %rcx
movq (%rax,%r15), %r15
xorl %ebp, %ebp
cmpq %rcx, %r15
jb 0x2fc263
leaq 0xe0c29(%rip), %rsi     # 0x3dce7a
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xd2207
cmpq $0x0, 0x10(%rax)
jne 0x2fc28f
leaq 0xe0c2f(%rip), %rsi     # 0x3dceac
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xfcb67
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 0xd2207
movq 0x10(%rbx), %rcx
movq 0x8(%rax), %rdx
shlq $0x4, %rdx
movq %r12, 0x8(%rcx,%rdx)
movq %r12, 0x8(%rax)
incq 0x10(%rax)
jmp 0x2fc36f
movq %r12, (%rsi)
movq 0x28(%rbx), %rax
movq %rax, 0x8(%rcx,%rdx)
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xd2207
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 0x2fc376
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 0xd2410
movq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0xd6abc
xorl %ebp, %ebp
movq 0x20(%rbx), %rdi
movq %r12, %rsi
callq 0xd6abc
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x8ad5e