// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/hcr.c
// Function: hcr_write_seq
static GtUword hcr_write_seq(GtHcrSeqEncoder *seq_encoder,
                                   const GtUchar *seq,
                                   const GtUchar *qual,
                                   GtUword len,
                                   GtBitOutStream *bitstream,
                                   bool dry)
{
  unsigned bits_to_write,
           cur_char_code,
           cur_qual,
           symbol;
  GtUword i,
                written_bits = 0;
  GtBitsequence code;

  for (i = 0; i < len; i++) {
    cur_char_code = (unsigned) seq[i];

    if (cur_char_code == GT_WILDCARD)
      cur_char_code = gt_alphabet_size(seq_encoder->alpha) - 1;

    cur_qual = (unsigned) qual[i];

    if (seq_encoder->qrange.start != GT_UNDEF_UINT) {
      if (cur_qual <= seq_encoder->qrange.start)
        cur_qual = seq_encoder->qrange.start;
    }

    if (seq_encoder->qrange.end != GT_UNDEF_UINT) {
      if (cur_qual >= seq_encoder->qrange.end)
        cur_qual = seq_encoder->qrange.end;
    }

    cur_qual = cur_qual - seq_encoder->qual_offset;

    symbol = gt_alphabet_size(seq_encoder->alpha) * cur_qual + cur_char_code;
    gt_huffman_encode(seq_encoder->huffman, (GtUword) symbol,
                      &code, &bits_to_write);
    written_bits += bits_to_write;
    if (!dry) {
      gt_bitoutstream_append(bitstream, code, bits_to_write);
    }
  }
  return written_bits;
}

// Assembly:
subq $0x58, %rsp
movb %r9b, %al
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x30(%rsp)
andb $0x1, %al
movb %al, 0x2f(%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x38(%rsp), %rax
jae 0x18a509
movq 0x48(%rsp), %rax
movq 0x10(%rsp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, 0x24(%rsp)
cmpl $0xfe, 0x24(%rsp)
jne 0x18a429
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x7e920
subl $0x1, %eax
movl %eax, 0x24(%rsp)
movq 0x40(%rsp), %rax
movq 0x10(%rsp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, 0x20(%rsp)
movq 0x50(%rsp), %rax
cmpl $-0x1, (%rax)
je 0x18a45f
movl 0x20(%rsp), %eax
movq 0x50(%rsp), %rcx
cmpl (%rcx), %eax
ja 0x18a45d
movq 0x50(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x20(%rsp)
jmp 0x18a45f
movq 0x50(%rsp), %rax
cmpl $-0x1, 0x4(%rax)
je 0x18a486
movl 0x20(%rsp), %eax
movq 0x50(%rsp), %rcx
cmpl 0x4(%rcx), %eax
jb 0x18a484
movq 0x50(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x20(%rsp)
jmp 0x18a486
movl 0x20(%rsp), %eax
movq 0x50(%rsp), %rcx
subl 0x48(%rcx), %eax
movl %eax, 0x20(%rsp)
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x7e920
imull 0x20(%rsp), %eax
addl 0x24(%rsp), %eax
movl %eax, 0x1c(%rsp)
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rdi
movl 0x1c(%rsp), %eax
movl %eax, %esi
movq %rsp, %rdx
leaq 0x28(%rsp), %rcx
callq 0x192440
movl 0x28(%rsp), %eax
addq 0x8(%rsp), %rax
movq %rax, 0x8(%rsp)
testb $0x1, 0x2f(%rsp)
jne 0x18a4f4
movq 0x30(%rsp), %rdi
movq (%rsp), %rsi
movl 0x28(%rsp), %edx
callq 0x489fa0
jmp 0x18a4f6
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x18a3e8
movq 0x8(%rsp), %rax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)