// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/shu-genomediff.c
// Function: gt_genomediff_calculate_div_from_avg
int gt_genomediff_calculate_div_from_avg(double **avgshu,
                                         const GtGenomediffArguments *arguments,
                                         GtShuUnitFileInfo *unit_info,
                                         GtLogger *logger,
                                         GtTimer *timer,
                                         GtError *err)
{
  int had_err = 0;
  const GtAlphabet *alphabet;
  double *gc_content = NULL;
  GtUword i_idx, j_idx;
  GtUword *genome_lengths = NULL;

  genome_lengths = genomediff_calculate_genome_lengths(unit_info);

  /*get alphabet and check if alphabet is dna, which is presumed for
    gc-calculation*/
  alphabet = gt_encseq_alphabet(unit_info->encseq);
  if (!gt_alphabet_is_dna(alphabet)) {
    gt_error_set(err,"error: sequences need to be dna to calculate gc!");
    had_err = -1;
  }

  if (!had_err && timer != NULL)
    gt_timer_show_progress(timer, "calculate gc", stdout);
  if (!had_err) {
    gc_content = genomediff_calculate_gc(genome_lengths, unit_info, err);
    if (gc_content == NULL)
      had_err = -1;
  }

    /* calculation of divergence */
  if (!had_err) {
    genomediff_calculate_div(unit_info, avgshu, gc_content, genome_lengths,
                             arguments, timer);

    if (gt_logger_enabled(logger)) {
      gt_logger_log(logger, "table of divergences");
      genomediff_print_table(avgshu, unit_info);
    }
  }

  if (!had_err && timer != NULL)
    gt_timer_show_progress(timer, "calculate kr", stdout);

  if (!had_err) {
    gt_logger_log(logger, "# Table of Kr");
    printf(""GT_WU"\n", unit_info->num_of_genomes);
    for (i_idx = 0; i_idx < unit_info->num_of_genomes; i_idx++) {
      printf("%s\t", gt_str_array_get(unit_info->genome_names, i_idx));
      for (j_idx = 0; j_idx < unit_info->num_of_genomes; j_idx++) {
        if ( i_idx == j_idx )
          printf("%.6f\t",0.0);
        else
          printf("%f\t", gt_calculateKr(avgshu[i_idx][j_idx]));
      }
      printf("\n");
    }
  }
  gt_free(gc_content);
  return had_err;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq %rdx, 0x50(%rsp)
movq %rcx, 0x48(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x38(%rsp)
movl $0x0, 0x34(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x8(%rsp)
movq 0x50(%rsp), %rdi
callq 0x2ecac0
movq %rax, 0x8(%rsp)
movq 0x50(%rsp), %rax
movq 0x28(%rax), %rdi
callq 0xb0f00
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rdi
callq 0x7f400
testb $0x1, %al
jne 0x2ec8a7
movq 0x38(%rsp), %rdi
leaq 0x2a21e1(%rip), %rsi    # 0x58ea79
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0x34(%rsp)
jne 0x2ec8d1
cmpq $0x0, 0x40(%rsp)
je 0x2ec8d1
movq 0x40(%rsp), %rdi
movq 0x34f676(%rip), %rax    # 0x63bf38
movq (%rax), %rdx
leaq 0x2a21de(%rip), %rsi    # 0x58eaaa
callq 0x121930
cmpl $0x0, 0x34(%rsp)
jne 0x2ec903
movq 0x8(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq 0x38(%rsp), %rdx
callq 0x2ecd30
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x2ec901
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
jmp 0x2ec903
cmpl $0x0, 0x34(%rsp)
jne 0x2ec961
movq 0x50(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x8(%rsp), %rcx
movq 0x58(%rsp), %r8
movq 0x40(%rsp), %r9
callq 0x2ed360
movq 0x48(%rsp), %rdi
callq 0xe7980
testb $0x1, %al
jne 0x2ec93d
jmp 0x2ec95f
movq 0x48(%rsp), %rdi
leaq 0x2a216e(%rip), %rsi    # 0x58eab7
movb $0x0, %al
callq 0xe7cd0
movq 0x60(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x2ed670
jmp 0x2ec961
cmpl $0x0, 0x34(%rsp)
jne 0x2ec98b
cmpq $0x0, 0x40(%rsp)
je 0x2ec98b
movq 0x40(%rsp), %rdi
movq 0x34f5bc(%rip), %rax    # 0x63bf38
movq (%rax), %rdx
leaq 0x2a2146(%rip), %rsi    # 0x58eacc
callq 0x121930
cmpl $0x0, 0x34(%rsp)
jne 0x2eca96
movq 0x48(%rsp), %rdi
leaq 0x2a2137(%rip), %rsi    # 0x58ead9
movb $0x0, %al
callq 0xe7cd0
movq 0x50(%rsp), %rax
movq (%rax), %rsi
leaq 0x2350ee(%rip), %rdi    # 0x521aa6
movb $0x0, %al
callq 0x19070
movq $0x0, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq 0x50(%rsp), %rcx
cmpq (%rcx), %rax
jae 0x2eca94
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rsp), %rsi
callq 0x11f8c0
movq %rax, %rsi
leaq 0x23a368(%rip), %rdi    # 0x526d60
movb $0x0, %al
callq 0x19070
movq $0x0, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x50(%rsp), %rcx
cmpq (%rcx), %rax
jae 0x2eca73
movq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
jne 0x2eca36
leaq 0x2a20bd(%rip), %rdi    # 0x58eae7
xorps %xmm0, %xmm0
movb $0x1, %al
callq 0x19070
jmp 0x2eca61
movq 0x60(%rsp), %rax
movq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x4e74a0
leaq 0x2a2093(%rip), %rdi    # 0x58eaed
movb $0x1, %al
callq 0x19070
jmp 0x2eca63
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x2eca08
leaq 0x2a67f9(%rip), %rdi    # 0x593273
movb $0x0, %al
callq 0x19070
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x2ec9c8
jmp 0x2eca96
movq 0x20(%rsp), %rdi
leaq 0x2a1f2c(%rip), %rsi    # 0x58e9ce
movl $0x1ae, %edx            # imm = 0x1AE
callq 0xe88c0
movl 0x34(%rsp), %eax
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)