// File: /workspace/github_c_makefile_star2_O1/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 0xf02da
movq %rax, %r14
movq %rax, %rdi
callq 0xd3c75
testb %al, %al
je 0x206c20
leaq 0x1be426(%rip), %rdx    # 0x3c4eb0
leaq 0x1c(%rsp), %rsi
movl $0x4, %ecx
movq %r14, %rdi
callq 0xd3df3
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xec1d8
movq %rax, %r12
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xed76d
movq %rax, %r15
movq %rbx, %rdi
callq 0xfac80
movl %eax, %ebp
movq %rbx, %rdi
callq 0xec1e8
testb %bpl, %bpl
je 0x206aec
andq $-0x2, %rax
leaq 0x1be3b9(%rip), %rdx    # 0x3c4e96
movl $0x8, %esi
movq %rax, %rdi
movl $0x43, %ecx
jmp 0x206b00
leaq 0x1be3a3(%rip), %rdx    # 0x3c4e96
movl $0x8, %esi
movq %rax, %rdi
movl $0x47, %ecx
callq 0x1093ef
movq %rax, %rbx
movq 0x8(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0xefce0
movq %rax, %r13
movq %r14, %rdi
xorl %esi, %esi
callq 0xeffd3
testq %r12, %r12
je 0x206bfc
movq %rax, %r14
addq %r13, %r14
xorl %r13d, %r13d
movq $0x0, 0x10(%rsp)
cmpq %r13, %r14
jne 0x206bac
movq %rbx, %rbp
movq 0x10(%rsp), %r14
movq (%rbx,%r14,8), %rbx
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0xeffd3
cmpq %rax, %rbx
ja 0x206c1b
incq %r14
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xefce0
movq %rax, 0x20(%rsp)
movq %rbx, %rdi
movq %r14, 0x10(%rsp)
movq %r14, %rsi
callq 0xeffd3
movq %rax, %r14
addq 0x20(%rsp), %r14
incq %r13
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %r13, %rcx
callq 0xed48e
movq %rbp, %rbx
movq %r15, %rdi
callq 0xec7be
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 0x206bf0
movq 0x10(%rsp), %rax
incq (%rbx,%rax,8)
je 0x206c16
incq %r13
cmpq %r12, %r13
jb 0x206b3f
movq %r15, %rdi
callq 0xed7bf
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x8062b
callq 0x80662
callq 0x805f4