// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/shu-genomediff.c
// Function: genomediff_calculate_gc
static double *genomediff_calculate_gc(GtUword *genome_lengths,
                                       GtShuUnitFileInfo *unit_info,
                                       GT_UNUSED GtError *err)
{
  GtUword file_idx = 0UL,
                genome_idx,
                idx,
                *seq_gc_content = NULL,
                num_of_seq,
                *genome_gc_content;
  double *gc_content;

  gt_assert(genome_lengths != NULL);
  gt_assert(unit_info != NULL);

  gt_assert(genome_lengths != NULL);
  gt_assert(unit_info != NULL);

  /*count gc, do not calculate ratio*/
  seq_gc_content = gt_encseq_gc_count(unit_info->encseq);

  if (seq_gc_content == NULL)
    return NULL;

  gc_content = gt_calloc((size_t)unit_info->num_of_genomes,
                         sizeof (*gc_content));
  genome_gc_content = gt_calloc((size_t)unit_info->num_of_genomes,
                                sizeof (*genome_gc_content));
  num_of_seq = gt_encseq_num_of_sequences(unit_info->encseq);

  for (idx = 0; idx < num_of_seq; idx++) {
    file_idx = gt_encseq_filenum(unit_info->encseq,
                                 gt_encseq_seqstartpos(unit_info->encseq, idx));
    if (unit_info->map_files != NULL)
      genome_idx = unit_info->map_files[file_idx];
    else
      genome_idx = file_idx;
    #ifndef S_SPLINT_S
    gt_safe_add(genome_gc_content[genome_idx],
                genome_gc_content[genome_idx],
                seq_gc_content[idx]);
    #endif
  }
  for (idx = 0; idx < unit_info->num_of_genomes; idx++) {
    gt_log_log("file/genome "GT_WU" has gc "GT_WU"",
               idx, genome_gc_content[idx]);
  }

  for (idx = 0; idx < unit_info->num_of_genomes; idx++) {
    gt_assert(genome_gc_content[idx] <= genome_lengths[idx]);
    gc_content[idx] = (double) genome_gc_content[idx] /
                      (double) genome_lengths[idx];
  }
  gt_free(seq_gc_content);
  gt_free(genome_gc_content);
  return gc_content;
}

// Assembly:
subq $0xc8, %rsp
movq %rdi, 0xb8(%rsp)
movq %rsi, 0xb0(%rsp)
movq %rdx, 0xa8(%rsp)
movq $0x0, 0xa0(%rsp)
movq $0x0, 0x88(%rsp)
cmpq $0x0, 0xb8(%rsp)
jne 0x2ecdaa
movq 0x34f227(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x229290(%rip), %rsi    # 0x516013
leaq 0x2a1dc6(%rip), %rdx    # 0x58eb50
leaq 0x2a1dd6(%rip), %rcx    # 0x58eb67
leaq 0x2a1c36(%rip), %r8     # 0x58e9ce
movl $0x7b, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2ecdac
jmp 0x2ecdae
cmpq $0x0, 0xb0(%rsp)
jne 0x2ecdf1
movq 0x34f1e0(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x229249(%rip), %rsi    # 0x516013
leaq 0x23176a(%rip), %rdx    # 0x51e53b
leaq 0x2a1d8f(%rip), %rcx    # 0x58eb67
leaq 0x2a1bef(%rip), %r8     # 0x58e9ce
movl $0x7c, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2ecdf3
jmp 0x2ecdf5
cmpq $0x0, 0xb8(%rsp)
jne 0x2ece38
movq 0x34f199(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x229202(%rip), %rsi    # 0x516013
leaq 0x2a1d38(%rip), %rdx    # 0x58eb50
leaq 0x2a1d48(%rip), %rcx    # 0x58eb67
leaq 0x2a1ba8(%rip), %r8     # 0x58e9ce
movl $0x7e, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2ece3a
jmp 0x2ece3c
cmpq $0x0, 0xb0(%rsp)
jne 0x2ece7f
movq 0x34f152(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2291bb(%rip), %rsi    # 0x516013
leaq 0x2316dc(%rip), %rdx    # 0x51e53b
leaq 0x2a1d01(%rip), %rcx    # 0x58eb67
leaq 0x2a1b61(%rip), %r8     # 0x58e9ce
movl $0x7f, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2ece81
movq 0xb0(%rsp), %rax
movq 0x28(%rax), %rdi
callq 0x2ebaf0
movq %rax, 0x88(%rsp)
cmpq $0x0, 0x88(%rsp)
jne 0x2eceb6
movq $0x0, 0xc0(%rsp)
jmp 0x2ed34f
movq 0xb0(%rsp), %rax
movq (%rax), %rdi
movl $0x8, %esi
leaq 0x2a1b01(%rip), %rdx    # 0x58e9ce
movl $0x88, %ecx
callq 0xe83c0
movq %rax, 0x70(%rsp)
movq 0xb0(%rsp), %rax
movq (%rax), %rdi
movl $0x8, %esi
leaq 0x2a1adb(%rip), %rdx    # 0x58e9ce
movl $0x8a, %ecx
callq 0xe83c0
movq %rax, 0x78(%rsp)
movq 0xb0(%rsp), %rax
movq 0x28(%rax), %rdi
callq 0xa9d50
movq %rax, 0x80(%rsp)
movq $0x0, 0x90(%rsp)
movq 0x90(%rsp), %rax
cmpq 0x80(%rsp), %rax
jae 0x2ed1aa
movq 0xb0(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0xb0(%rsp), %rax
movq 0x28(%rax), %rdi
movq 0x90(%rsp), %rsi
callq 0xb0530
movq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0xc2af0
movq %rax, 0xa0(%rsp)
movq 0xb0(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x2ecfad
movq 0xb0(%rsp), %rax
movq 0x20(%rax), %rax
movq 0xa0(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x98(%rsp)
jmp 0x2ecfbd
movq 0xa0(%rsp), %rax
movq %rax, 0x98(%rsp)
jmp 0x2ecfbf
movq 0x78(%rsp), %rax
movq 0x98(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x68(%rsp)
movq 0x88(%rsp), %rax
movq 0x90(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x60(%rsp)
cmpq $0x1, 0x60(%rsp)
jae 0x2ed0a5
xorl %eax, %eax
subq 0x60(%rsp), %rax
cmpq 0x68(%rsp), %rax
ja 0x2ed08d
movq 0x68(%rsp), %rax
addq 0x60(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x50(%rsp), %rax
cmpq 0x48(%rsp), %rax
jne 0x2ed070
cmpq $0x1, 0x50(%rsp)
setb %al
andb $0x1, %al
movzbl %al, %eax
cmpq $0x1, 0x48(%rsp)
setb %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x2ed070
movq 0x48(%rsp), %rdx
movq 0x78(%rsp), %rax
movq 0x98(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
xorl %eax, %eax
movl %eax, 0x1c(%rsp)
jmp 0x2ed07b
movl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x2ed07b
movl 0x1c(%rsp), %eax
movl %eax, 0x44(%rsp)
movl 0x44(%rsp), %eax
movl %eax, 0x18(%rsp)
jmp 0x2ed098
movl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x2ed098
movl 0x18(%rsp), %eax
movl %eax, 0x14(%rsp)
jmp 0x2ed150
movq $-0x1, %rax
subq 0x60(%rsp), %rax
cmpq 0x68(%rsp), %rax
jb 0x2ed13d
movq 0x68(%rsp), %rax
addq 0x60(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x38(%rsp), %rax
cmpq 0x30(%rsp), %rax
jne 0x2ed120
cmpq $0x1, 0x38(%rsp)
setb %al
andb $0x1, %al
movzbl %al, %eax
cmpq $0x1, 0x30(%rsp)
setb %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x2ed120
movq 0x30(%rsp), %rdx
movq 0x78(%rsp), %rax
movq 0x98(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
xorl %eax, %eax
movl %eax, 0x10(%rsp)
jmp 0x2ed12b
movl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x2ed12b
movl 0x10(%rsp), %eax
movl %eax, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
movl %eax, 0xc(%rsp)
jmp 0x2ed148
movl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x2ed148
movl 0xc(%rsp), %eax
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %eax
movl %eax, 0x5c(%rsp)
cmpl $0x0, 0x5c(%rsp)
je 0x2ed18d
movq 0x34ee3a(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x246900(%rip), %rsi    # 0x533a70
leaq 0x2a1857(%rip), %rdx    # 0x58e9ce
movl $0x97, %ecx
movb $0x0, %al
callq 0x199f0
movl $0x1, %edi
callq 0x19890
jmp 0x2ed18f
jmp 0x2ed191
movq 0x90(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x90(%rsp)
jmp 0x2ecf27
movq $0x0, 0x90(%rsp)
movq 0x90(%rsp), %rax
movq 0xb0(%rsp), %rcx
cmpq (%rcx), %rax
jae 0x2ed208
movq 0x90(%rsp), %rsi
movq 0x78(%rsp), %rax
movq 0x90(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x2a1994(%rip), %rdi    # 0x58eb7f
movb $0x0, %al
callq 0xe7740
movq 0x90(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x90(%rsp)
jmp 0x2ed1b6
movq $0x0, 0x90(%rsp)
movq 0x90(%rsp), %rax
movq 0xb0(%rsp), %rcx
cmpq (%rcx), %rax
jae 0x2ed313
jmp 0x2ed22f
movq 0x78(%rsp), %rax
movq 0x90(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0xb8(%rsp), %rcx
movq 0x90(%rsp), %rdx
cmpq (%rcx,%rdx,8), %rax
jbe 0x2ed28e
movq 0x34ed43(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x228dac(%rip), %rsi    # 0x516013
leaq 0x2a192c(%rip), %rdx    # 0x58eb9a
leaq 0x2a18f2(%rip), %rcx    # 0x58eb67
leaq 0x2a1752(%rip), %r8     # 0x58e9ce
movl $0xa0, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2ed290
movq 0x78(%rsp), %rax
movq 0x90(%rsp), %rcx
movq (%rax,%rcx,8), %xmm0
movaps 0x22b687(%rip), %xmm3   # 0x518930
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x22b68b(%rip), %xmm2   # 0x518940
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq 0xb8(%rsp), %rax
movq (%rax,%rcx,8), %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movq 0x70(%rsp), %rax
movq 0x90(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x90(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x90(%rsp)
jmp 0x2ed214
movq 0x88(%rsp), %rdi
leaq 0x2a16ac(%rip), %rsi    # 0x58e9ce
movl $0xa4, %edx
callq 0xe88c0
movq 0x78(%rsp), %rdi
leaq 0x2a1696(%rip), %rsi    # 0x58e9ce
movl $0xa5, %edx
callq 0xe88c0
movq 0x70(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0xc0(%rsp), %rax
addq $0xc8, %rsp
retq
nop