// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/shu-encseq-gc.c
// Function: gt_encseq_gc_count
GtUword *gt_encseq_gc_count(const GtEncseq *encseq)
{
  GtEncseqReader *reader;
  GtAlphabet *alphabet;
  GtUword *gc_count_per_seq,
                char_idx, totallength, max_unit,
                seq_idx = 0,
                nextsep = 0;
  bool is_mirrored_encseq;
  GtUchar cCgG_encoded[4], current_c;

  alphabet = gt_encseq_alphabet(encseq);
  gt_assert(gt_alphabet_is_dna(alphabet));
  gt_alphabet_encode_seq(alphabet, cCgG_encoded, "cCgG", 4UL);
  totallength = gt_encseq_total_length(encseq);
  reader = gt_encseq_create_reader_with_readmode(encseq,
                                                 GT_READMODE_FORWARD,
                                                 0);
  is_mirrored_encseq = gt_encseq_is_mirrored(encseq);
  if (is_mirrored_encseq) {
    max_unit = GT_DIV2(gt_encseq_num_of_sequences(encseq));
    gc_count_per_seq = gt_calloc((size_t) GT_MULT2(max_unit),
                                 sizeof (*gc_count_per_seq));
  }
  else {
    max_unit = gt_encseq_num_of_sequences(encseq);
    gc_count_per_seq = gt_calloc((size_t) max_unit, sizeof (*gc_count_per_seq));
  }

  nextsep = gt_encseq_seqstartpos(encseq, seq_idx) +
            gt_encseq_seqlength(encseq, seq_idx);

  for (char_idx = 0; char_idx < totallength; char_idx++)
  {
    if (nextsep == char_idx)
    {
      gt_assert(gc_count_per_seq[seq_idx] <=
                gt_encseq_seqlength(encseq, seq_idx));
      seq_idx++;

      nextsep = gt_encseq_seqstartpos(encseq, seq_idx) +
                gt_encseq_seqlength(encseq, seq_idx);

      gt_encseq_reader_reinit_with_readmode(reader,
                                            encseq,
                                            GT_READMODE_FORWARD,
                                            char_idx + 1UL);
      char_idx++;
    }
    current_c = gt_encseq_reader_next_encoded_char(reader);
    if (current_c == cCgG_encoded[0] || current_c == cCgG_encoded[1] ||
        current_c == cCgG_encoded[2] || current_c == cCgG_encoded[3]) {
       gc_count_per_seq[seq_idx]++;
       gt_assert(gc_count_per_seq[seq_idx] != 0);
    }
  }
  gt_encseq_reader_delete(reader);
  return gc_count_per_seq;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, 0x8(%rsp)
callq 0xebcd9
movq %rax, %r14
movq %rax, %rdi
callq 0xd1749
testb %al, %al
je 0x1fd544
leaq 0x1be492(%rip), %rdx    # 0x3bb840
leaq 0x1c(%rsp), %rsi
movl $0x4, %ecx
movq %r14, %rdi
callq 0xd18c7
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xe7b9c
movq %rax, %r12
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xe91b2
movq %rax, %r15
movq %rbx, %rdi
callq 0xf6567
movl %eax, %ebp
movq %rbx, %rdi
callq 0xe7bac
testb %bpl, %bpl
je 0x1fd410
andq $-0x2, %rax
leaq 0x1be425(%rip), %rdx    # 0x3bb826
movl $0x8, %esi
movq %rax, %rdi
movl $0x43, %ecx
jmp 0x1fd424
leaq 0x1be40f(%rip), %rdx    # 0x3bb826
movl $0x8, %esi
movq %rax, %rdi
movl $0x47, %ecx
callq 0x10436a
movq %rax, %rbx
movq 0x8(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0xeb6ee
movq %rax, %r13
movq %r14, %rdi
xorl %esi, %esi
callq 0xeb9d2
testq %r12, %r12
je 0x1fd520
movq %rax, %r14
addq %r13, %r14
xorl %r13d, %r13d
movq $0x0, 0x10(%rsp)
cmpq %r13, %r14
jne 0x1fd4d0
movq %rbx, %rbp
movq 0x10(%rsp), %r14
movq (%rbx,%r14,8), %rbx
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0xeb9d2
cmpq %rax, %rbx
ja 0x1fd53f
incq %r14
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xeb6ee
movq %rax, 0x20(%rsp)
movq %rbx, %rdi
movq %r14, 0x10(%rsp)
movq %r14, %rsi
callq 0xeb9d2
movq %rax, %r14
addq 0x20(%rsp), %r14
incq %r13
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %r13, %rcx
callq 0xe8eed
movq %rbp, %rbx
movq %r15, %rdi
callq 0xe8186
movd 0x1c(%rsp), %xmm0
movzbl %al, %eax
movd %eax, %xmm1
punpcklbw %xmm1, %xmm1    # xmm1 = xmm1[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
pshuflw $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0,4,5,6,7]
punpcklbw %xmm0, %xmm0    # xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
punpcklwd %xmm0, %xmm0    # xmm0 = xmm0[0,0,1,1,2,2,3,3]
punpcklbw %xmm1, %xmm1    # xmm1 = xmm1[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
punpcklwd %xmm1, %xmm1    # xmm1 = xmm1[0,0,1,1,2,2,3,3]
pcmpeqb %xmm0, %xmm1
movmskps %xmm1, %eax
testl %eax, %eax
je 0x1fd514
movq 0x10(%rsp), %rax
incq (%rbx,%rax,8)
je 0x1fd53a
incq %r13
cmpq %r12, %r13
jb 0x1fd463
movq %r15, %rdi
callq 0xe9204
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x7e821
callq 0x7e858
callq 0x7e7ea