// File: /workspace/github_c_makefile_star2_O2/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, %rbx
callq 0x754dd
movq %rax, %r14
movq %rax, %rdi
callq 0x5741b
testb %al, %al
je 0x1b0bb3
leaq 0x1ab2d0(%rip), %rdx    # 0x35bca0
leaq 0x14(%rsp), %rsi
pushq $0x4
popq %rcx
movq %r14, %rdi
callq 0x57621
movq %rbx, %rdi
callq 0x7055e
movq %rax, %r13
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x72260
movq %rax, %r15
movq %rbx, %rdi
callq 0x81dea
movl %eax, %ebp
movq %rbx, 0x18(%rsp)
movq %rbx, %rdi
callq 0x705a1
testb %bpl, %bpl
je 0x1b0a28
andq $-0x2, %rax
leaq 0x1ab265(%rip), %rdx    # 0x35bc86
pushq $0x8
popq %rsi
pushq $0x43
jmp 0x1b0a34
leaq 0x1ab257(%rip), %rdx    # 0x35bc86
pushq $0x8
popq %rsi
pushq $0x47
popq %rcx
movq %rax, %rdi
callq 0x9334a
movq %rax, %r12
movq $0x0, 0x8(%rsp)
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x74d9c
movq %rax, %rbp
movq %rbx, %rdi
xorl %esi, %esi
callq 0x75173
movq %rax, %rbx
addq %rbp, %rbx
xorl %ebp, %ebp
movq %r12, 0x20(%rsp)
cmpq %r13, %rbp
jae 0x1b0b39
cmpq %rbp, %rbx
jne 0x1b0aed
movq 0x8(%rsp), %rax
movq (%r12,%rax,8), %r14
movq %rax, %r12
movq 0x18(%rsp), %rbp
movq %rbp, %rdi
movq %rax, %rsi
callq 0x75173
cmpq %rax, %r14
ja 0x1b0b7d
incq %r12
movq %rbp, %rdi
movq %r12, %rsi
callq 0x74d9c
movq %r12, %rsi
movq %rbp, %r12
movq %rax, %rbp
movq %r12, %rdi
movq %rsi, 0x8(%rsp)
callq 0x75173
movq %rax, %r14
addq %rbp, %r14
movq %rbx, %rbp
incq %rbp
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
movq %rbp, %rcx
callq 0x71f38
movq %r14, %rbx
movq 0x20(%rsp), %r12
movq %r15, %rdi
callq 0x70f55
movd 0x14(%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 0x1b0b31
movq 0x8(%rsp), %rax
incq (%r12,%rax,8)
je 0x1b0b53
incq %rbp
jmp 0x1b0a72
movq %r15, %rdi
callq 0x722ae
movq %r12, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x28740e(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1344af(%rip), %rsi    # 0x2e5013
leaq 0x1ab17c(%rip), %rdx    # 0x35bce7
leaq 0x1ab101(%rip), %rcx    # 0x35bc73
leaq 0x1ab10d(%rip), %r8     # 0x35bc86
pushq $0x62
jmp 0x1b0ba5
movq 0x2873e4(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x134485(%rip), %rsi    # 0x2e5013
leaq 0x1ab110(%rip), %rdx    # 0x35bca5
leaq 0x1ab0d7(%rip), %rcx    # 0x35bc73
leaq 0x1ab0e3(%rip), %r8     # 0x35bc86
pushq $0x52
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x2873ae(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x13444f(%rip), %rsi    # 0x2e5013
leaq 0x159e4c(%rip), %rdx    # 0x30aa17
leaq 0x1ab0a1(%rip), %rcx    # 0x35bc73
leaq 0x1ab0ad(%rip), %r8     # 0x35bc86
pushq $0x39
jmp 0x1b0ba5