// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/consensus_sa.c
// Function: compute_csas
static void compute_csas(ConsensusSA *csa)
{
  GtUword i, sa_i, sa_i_size = 0, sa_prime, sa_prime_size;
  GtArray *splice_form;
  GtBittab **C, **left, **right, **L, **R, *U_i, *SA_i, *SA_prime;
#ifndef NDEBUG
  GtUword u_i_size, u_i_minus_1_size;
  gt_assert(csa && csa->set_of_sas);
#endif

  /* init sets */
  C     = gt_malloc(sizeof (GtBittab*) * csa->number_of_sas);
  left  = gt_malloc(sizeof (GtBittab*) * csa->number_of_sas);
  right = gt_malloc(sizeof (GtBittab*) * csa->number_of_sas);
  L     = gt_malloc(sizeof (GtBittab*) * csa->number_of_sas);
  R     = gt_malloc(sizeof (GtBittab*) * csa->number_of_sas);

  for (i = 0; i < csa->number_of_sas; i++) {
    C[i]     = gt_bittab_new(csa->number_of_sas);
    left[i]  = gt_bittab_new(csa->number_of_sas);
    right[i] = gt_bittab_new(csa->number_of_sas);
    L[i]     = gt_bittab_new(csa->number_of_sas);
    R[i]     = gt_bittab_new(csa->number_of_sas);
  }

  U_i      = gt_bittab_new(csa->number_of_sas);
  SA_i     = gt_bittab_new(csa->number_of_sas);
  SA_prime = gt_bittab_new(csa->number_of_sas);

  splice_form = gt_array_new(sizeof (GtUword));

  /* compute sets */
  compute_C(C, csa);
  compute_left(left, csa);
  compute_right(right, csa);
  compute_L(L, C, left, csa->number_of_sas);
  compute_R(R, C, right, csa->number_of_sas);

  /* U_0 = SA */
  for (i = 0; i < csa->number_of_sas; i++)
    gt_bittab_set_bit(U_i, i);

#ifndef NDEBUG
  /* preparation for assertion below */
  u_i_minus_1_size = gt_bittab_count_set_bits(U_i);
#endif
  while (gt_bittab_is_true(U_i)) {
    sa_i = GT_UNDEF_UWORD;
    for (sa_prime  = gt_bittab_get_first_bitnum(U_i);
         sa_prime != gt_bittab_get_last_bitnum(U_i);
         sa_prime  = gt_bittab_get_next_bitnum(U_i, sa_prime)) {
      if (sa_i == GT_UNDEF_UWORD) {
        sa_i = sa_prime;
        gt_bittab_or(SA_i, L[sa_i], R[sa_i]);
        sa_i_size = gt_bittab_count_set_bits(SA_i);
      }
      else {
        gt_bittab_or(SA_prime, L[sa_prime], R[sa_prime]);
        sa_prime_size = gt_bittab_count_set_bits(SA_prime);
        if (sa_prime_size > sa_i_size) {
          sa_i = sa_prime;
          sa_i_size = sa_prime_size;
          gt_bittab_equal(SA_i, SA_prime);
        }
      }
    }

    /* make sure the computed splice form is maximal w.r.t. to compatibility */
    gt_assert(splice_form_is_valid(SA_i, csa));

    /* process splice form */
    if (csa->process_splice_form) {
      gt_array_reset(splice_form);
      gt_bittab_get_all_bitnums(SA_i, splice_form);
      csa->process_splice_form(splice_form, csa->set_of_sas, csa->number_of_sas,
                               csa->size_of_sa, csa->userdata);
    }

    /* U_i = U_i-1 \ SA_i */
    gt_bittab_nand(U_i, U_i, SA_i);

#ifndef NDEBUG
    /* ensure that |U_i| < |U_i-1| */
    u_i_size = gt_bittab_count_set_bits(U_i);
    gt_assert(u_i_size < u_i_minus_1_size);
    u_i_minus_1_size = u_i_size;
#endif
  }

  /* free sets */
  for (i = 0; i < csa->number_of_sas; i++) {
    gt_bittab_delete(C[i]);
    gt_bittab_delete(left[i]);
    gt_bittab_delete(right[i]);
    gt_bittab_delete(L[i]);
    gt_bittab_delete(R[i]);
  }
  gt_free(C);
  gt_free(left);
  gt_free(right);
  gt_free(L);
  gt_free(R);
  gt_bittab_delete(U_i);
  gt_bittab_delete(SA_i);
  gt_bittab_delete(SA_prime);
  gt_array_delete(splice_form);
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq $0x0, 0x78(%rsp)
cmpq $0x0, 0x90(%rsp)
je 0x15b3d1
movq 0x90(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x15b409
movq 0x58c00(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x2c84(%rip), %rsi      # 0x15e066
leaq 0x34228(%rip), %rdx     # 0x18f611
leaq 0x34238(%rip), %rcx     # 0x18f628
leaq 0x3412e(%rip), %r8      # 0x18f525
movl $0x1d1, %r9d            # imm = 0x1D1
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x15b40b
movq 0x90(%rsp), %rax
movq 0x8(%rax), %rdi
shlq $0x3, %rdi
leaq 0x34103(%rip), %rsi     # 0x18f525
movl $0x1d5, %edx            # imm = 0x1D5
callq 0xd2e0
movq %rax, 0x58(%rsp)
movq 0x90(%rsp), %rax
movq 0x8(%rax), %rdi
shlq $0x3, %rdi
leaq 0x340dd(%rip), %rsi     # 0x18f525
movl $0x1d6, %edx            # imm = 0x1D6
callq 0xd2e0
movq %rax, 0x50(%rsp)
movq 0x90(%rsp), %rax
movq 0x8(%rax), %rdi
shlq $0x3, %rdi
leaq 0x340b7(%rip), %rsi     # 0x18f525
movl $0x1d7, %edx            # imm = 0x1D7
callq 0xd2e0
movq %rax, 0x48(%rsp)
movq 0x90(%rsp), %rax
movq 0x8(%rax), %rdi
shlq $0x3, %rdi
leaq 0x34091(%rip), %rsi     # 0x18f525
movl $0x1d8, %edx            # imm = 0x1D8
callq 0xd2e0
movq %rax, 0x40(%rsp)
movq 0x90(%rsp), %rax
movq 0x8(%rax), %rdi
shlq $0x3, %rdi
leaq 0x3406b(%rip), %rsi     # 0x18f525
movl $0x1d9, %edx            # imm = 0x1D9
callq 0xd2e0
movq %rax, 0x38(%rsp)
movq $0x0, 0x88(%rsp)
movq 0x88(%rsp), %rax
movq 0x90(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x15b5c1
movq 0x90(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x78f00
movq %rax, %rdx
movq 0x58(%rsp), %rax
movq 0x88(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x90(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x78f00
movq %rax, %rdx
movq 0x50(%rsp), %rax
movq 0x88(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x90(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x78f00
movq %rax, %rdx
movq 0x48(%rsp), %rax
movq 0x88(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x90(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x78f00
movq %rax, %rdx
movq 0x40(%rsp), %rax
movq 0x88(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x90(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x78f00
movq %rax, %rdx
movq 0x38(%rsp), %rax
movq 0x88(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x88(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x88(%rsp)
jmp 0x15b4d5
movq 0x90(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x78f00
movq %rax, 0x30(%rsp)
movq 0x90(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x78f00
movq %rax, 0x28(%rsp)
movq 0x90(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x78f00
movq %rax, 0x20(%rsp)
movl $0x8, %edi
callq 0x75ab0
movq %rax, 0x60(%rsp)
movq 0x58(%rsp), %rdi
movq 0x90(%rsp), %rsi
callq 0x15ba90
movq 0x50(%rsp), %rdi
movq 0x90(%rsp), %rsi
callq 0x15bbd0
movq 0x48(%rsp), %rdi
movq 0x90(%rsp), %rsi
callq 0x15bc40
movq 0x40(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq 0x90(%rsp), %rax
movq 0x8(%rax), %rcx
callq 0x15bcb0
movq 0x38(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq 0x90(%rsp), %rax
movq 0x8(%rax), %rcx
callq 0x15bee0
movq $0x0, 0x88(%rsp)
movq 0x88(%rsp), %rax
movq 0x90(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x15b6d2
movq 0x30(%rsp), %rdi
movq 0x88(%rsp), %rsi
callq 0x78fe0
movq 0x88(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x88(%rsp)
jmp 0x15b694
movq 0x30(%rsp), %rdi
callq 0x7a120
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %rdi
callq 0x79d10
testb $0x1, %al
jne 0x15b6f4
jmp 0x15b941
movq $-0x1, 0x80(%rsp)
movq 0x30(%rsp), %rdi
callq 0x79ee0
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x30(%rsp), %rdi
callq 0x79fb0
movq %rax, %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
je 0x15b80d
cmpq $-0x1, 0x80(%rsp)
jne 0x15b789
movq 0x70(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x28(%rsp), %rdi
movq 0x40(%rsp), %rax
movq 0x80(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
movq 0x38(%rsp), %rax
movq 0x80(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
callq 0x79480
movq 0x28(%rsp), %rdi
callq 0x7a120
movq %rax, 0x78(%rsp)
jmp 0x15b7f2
movq 0x20(%rsp), %rdi
movq 0x40(%rsp), %rax
movq 0x70(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
movq 0x38(%rsp), %rax
movq 0x70(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
callq 0x79480
movq 0x20(%rsp), %rdi
callq 0x7a120
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rax
cmpq 0x78(%rsp), %rax
jbe 0x15b7f0
movq 0x70(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x79250
jmp 0x15b7f2
jmp 0x15b7f4
movq 0x30(%rsp), %rdi
movq 0x70(%rsp), %rsi
callq 0x7a000
movq %rax, 0x70(%rsp)
jmp 0x15b70f
jmp 0x15b80f
movq 0x28(%rsp), %rdi
movq 0x90(%rsp), %rsi
callq 0x15c110
testb $0x1, %al
jne 0x15b85d
movq 0x587ac(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x2830(%rip), %rsi      # 0x15e066
leaq 0x33df8(%rip), %rdx     # 0x18f635
leaq 0x33de4(%rip), %rcx     # 0x18f628
leaq 0x33cda(%rip), %r8      # 0x18f525
movl $0x20e, %r9d            # imm = 0x20E
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x15b85f
movq 0x90(%rsp), %rax
cmpq $0x0, 0x30(%rax)
je 0x15b8c9
movq 0x60(%rsp), %rdi
callq 0x765c0
movq 0x28(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0x79bb0
movq 0x90(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x60(%rsp), %rdi
movq 0x90(%rsp), %rcx
movq (%rcx), %rsi
movq 0x90(%rsp), %rcx
movq 0x8(%rcx), %rdx
movq 0x90(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x90(%rsp), %r8
movq 0x38(%r8), %r8
callq *%rax
movq 0x30(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x28(%rsp), %rdx
callq 0x795f0
movq 0x30(%rsp), %rdi
callq 0x7a120
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
jb 0x15b930
movq 0x586d9(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x275d(%rip), %rsi      # 0x15e066
leaq 0x33d45(%rip), %rdx     # 0x18f655
leaq 0x33d11(%rip), %rcx     # 0x18f628
leaq 0x33c07(%rip), %r8      # 0x18f525
movl $0x21e, %r9d            # imm = 0x21E
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x15b932
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x15b6e1
movq $0x0, 0x88(%rsp)
movq 0x88(%rsp), %rax
movq 0x90(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x15b9ee
movq 0x58(%rsp), %rax
movq 0x88(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x7a420
movq 0x50(%rsp), %rax
movq 0x88(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x7a420
movq 0x48(%rsp), %rax
movq 0x88(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x7a420
movq 0x40(%rsp), %rax
movq 0x88(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x7a420
movq 0x38(%rsp), %rax
movq 0x88(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x7a420
movq 0x88(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x88(%rsp)
jmp 0x15b94d
movq 0x58(%rsp), %rdi
leaq 0x33b2b(%rip), %rsi     # 0x18f525
movl $0x22b, %edx            # imm = 0x22B
callq 0xdab0
movq 0x50(%rsp), %rdi
leaq 0x33b15(%rip), %rsi     # 0x18f525
movl $0x22c, %edx            # imm = 0x22C
callq 0xdab0
movq 0x48(%rsp), %rdi
leaq 0x33aff(%rip), %rsi     # 0x18f525
movl $0x22d, %edx            # imm = 0x22D
callq 0xdab0
movq 0x40(%rsp), %rdi
leaq 0x33ae9(%rip), %rsi     # 0x18f525
movl $0x22e, %edx            # imm = 0x22E
callq 0xdab0
movq 0x38(%rsp), %rdi
leaq 0x33ad3(%rip), %rsi     # 0x18f525
movl $0x22f, %edx            # imm = 0x22F
callq 0xdab0
movq 0x30(%rsp), %rdi
callq 0x7a420
movq 0x28(%rsp), %rdi
callq 0x7a420
movq 0x20(%rsp), %rdi
callq 0x7a420
movq 0x60(%rsp), %rdi
callq 0x770a0
addq $0x98, %rsp
retq
nopl (%rax)