// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/extended/hcr.c
// Function: gt_hcr_encoder_encode
int gt_hcr_encoder_encode(GtHcrEncoder *hcr_enc, const char *name,
                          GtTimer *timer, GtError *err)
{
  int had_err = 0;
  GtStr *name1;
  gt_error_check(err);
  if (timer != NULL)
    gt_timer_show_progress(timer, "write encoding", stdout);
  if (hcr_enc->encdesc_encoder != NULL) {
    GtCstrIterator *cstr_iterator = gt_fasta_header_iterator_new(hcr_enc->files,
                                                                 err);
    had_err = gt_encdesc_encoder_encode(hcr_enc->encdesc_encoder,
                                        cstr_iterator, name, err);
    gt_cstr_iterator_delete(cstr_iterator);
  }

  if (!had_err)
    had_err = hcr_write_seq_qual_data(name, hcr_enc, timer, err);

  if (!had_err && gt_log_enabled()) {
    name1 = gt_str_new_cstr(name);
    gt_str_append_cstr(name1, HCRFILESUFFIX);
    gt_log_log("sequences with qualities encoding overview:");
    gt_log_log("**>");
    if (hcr_enc->page_sampling)
        gt_log_log("applied sampling technique: sampling every " GT_WU
                   "th page",
                   hcr_enc->sampling_rate);
    else if (hcr_enc->regular_sampling)
        gt_log_log("applied sampling technique: sampling every " GT_WU
                   "th read",
                   hcr_enc->sampling_rate);
    else
        gt_log_log("applied sampling technique: none");

    gt_log_log("total number of encoded nucleotide sequences with qualities: "
               GT_WU, hcr_enc->num_of_reads);
    gt_log_log("total number of encoded nucleotides: " GT_LLU,
               hcr_enc->seq_encoder->total_num_of_symbols);
    gt_log_log("bits per nucleotide encoding: %f",
               (gt_file_estimate_size(gt_str_get(name1)) * 8.0) /
                 hcr_enc->seq_encoder->total_num_of_symbols);
    gt_log_log("<**");
    gt_str_delete(name1);
  }
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, %r13
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
testq %rcx, %rcx
je 0x14fe7c
movq %r13, %rdi
callq 0xfcc32
testb %al, %al
jne 0x150517
testq %r14, %r14
je 0x14fe9a
movq 0x369050(%rip), %rax    # 0x4b8ed8
movq (%rax), %rdx
leaq 0x22c034(%rip), %rsi    # 0x37bec6
movq %r14, %rdi
callq 0x11cc90
cmpq $0x0, (%rbx)
je 0x14fed2
movq 0x10(%rbx), %rdi
movq %r13, %rsi
callq 0x2fe15a
movq %rax, %r15
movq (%rbx), %rdi
movq %rax, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x13ae0e
movl %eax, %ebp
movq %r15, %rdi
callq 0x2fd476
testl %ebp, %ebp
jne 0x15041e
movq $0x0, 0x48(%rsp)
testq %r13, %r13
je 0x14fef0
movq %r13, %rdi
callq 0xfcc32
testb %al, %al
jne 0x15051c
leaq 0x232adb(%rip), %rsi    # 0x3829d2
leaq 0x205be3(%rip), %rdx    # 0x355ae1
leaq 0x232747(%rip), %rcx    # 0x38264c
movq %r12, %rdi
movl $0x217, %r8d            # imm = 0x217
movq %r13, (%rsp)
movq %r13, %r9
callq 0xfcf97
testq %rax, %rax
je 0x15030b
movq %rax, %r13
testq %r14, %r14
je 0x14ff44
movq 0x368fa6(%rip), %rax    # 0x4b8ed8
movq (%rax), %rdx
leaq 0x232d86(%rip), %rsi    # 0x382cc2
movq %r14, %rdi
callq 0x11cc90
leaq 0x20(%rbx), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x11f89c
cmpq $0x0, 0x20(%rbx)
je 0x14ffb3
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rax
leaq (%rax,%r14), %rdi
addq $0x8, %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x11f89c
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rdi
addq %r14, %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x11f89c
incq %r15
addq $0x10, %r14
cmpq 0x20(%rbx), %r15
jb 0x14ff67
leaq 0x232692(%rip), %r14    # 0x38264c
movl $0x1, %edi
movl $0x18, %esi
movq %r14, %rdx
movl $0x1f2, %ecx            # imm = 0x1F2
callq 0x10436a
movq %rax, %r15
movq 0x8(%rbx), %rax
movq 0x10(%rax), %rcx
movq %rcx, 0x8(%r15)
movl 0x48(%rax), %ecx
movl %ecx, 0x10(%r15)
movq %r13, (%r15)
movq 0x18(%rax), %rdi
callq 0x154521
leaq 0x10(%rsp), %rdi
movq %rax, (%rdi)
movl $0x8, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x11f89c
movq 0x8(%rbx), %rax
movq 0x18(%rax), %rdi
leaq 0x753(%rip), %rsi       # 0x15076f
movq %r15, %rdx
callq 0x15436c
movl %eax, %ebp
movq %r15, %rdi
movq %r14, %rsi
movl $0x1fd, %edx            # imm = 0x1FD
callq 0x1045eb
testl %ebp, %ebp
jne 0x150303
movq %r13, %rdi
callq 0x17030
movq %rax, %rbp
leaq 0x48(%rsp), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x11f89c
movq %r13, %rdi
callq 0x17030
xorl %edx, %edx
divq 0x30(%rbx)
movq %rdx, %r14
movq %r13, %rdi
callq 0x17030
testq %r14, %r14
je 0x15008e
movq 0x30(%rbx), %rcx
xorl %edx, %edx
divq %rcx
incq %rax
imulq %rcx, %rax
movq 0x8(%rbx), %rcx
movq %rax, 0x40(%rcx)
cmpb $0x1, 0x38(%rbx)
jne 0x1500aa
movq 0x28(%rbx), %rdi
movq %rax, %rsi
callq 0x170ca4
jmp 0x1500bc
cmpb $0x1, 0x39(%rbx)
jne 0x1500c4
movq 0x28(%rbx), %rdi
movq %rax, %rsi
callq 0x170bfc
movq 0x8(%rbx), %rcx
movq %rax, 0x20(%rcx)
movq (%rsp), %r15
testq %r15, %r15
je 0x1500e5
movq %r15, %rdi
callq 0xfcc32
testb %al, %al
jne 0x150521
movq 0x8(%rbx), %rcx
movq (%rsp), %r15
movq 0x30(%rbx), %r14
movq 0x40(%rcx), %rsi
movq %r13, %rdi
xorl %edx, %edx
callq 0x11f87a
movq %r13, %rdi
callq 0x2faef8
movq %rax, 0x8(%rsp)
movq 0x10(%rbx), %rdi
movq %r15, %rsi
callq 0x114cc9
testq %rax, %rax
movq %rax, 0x18(%rsp)
je 0x1502b3
movq %r13, 0x30(%rsp)
leaq 0x38(%rsp), %rsi
movq %rax, %r13
movq %rax, %rdi
callq 0x1142fa
movq 0x8(%rbx), %rax
movq 0x10(%rax), %rdi
callq 0xd11ab
movq %r13, %rdi
movq %rax, %rsi
callq 0x1142c4
movq 0x8(%rbx), %rax
movq $0x0, 0x28(%rax)
leaq 0x20(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x50(%rsp), %rcx
movq %r13, %rdi
movq %r15, %r8
callq 0x11433d
cmpl $0x1, %eax
jne 0x1502c4
movq %rbp, 0x40(%rsp)
movq %r12, 0x28(%rsp)
shlq $0x3, %r14
xorl %r13d, %r13d
xorl %ebp, %ebp
xorl %r12d, %r12d
movq 0x8(%rbx), %rdi
movq 0x20(%rdi), %r15
movq 0x20(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %r8
movl $0x1, %r9d
callq 0x150877
testq %r15, %r15
je 0x15021e
movq %r15, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movq %rax, %rcx
movq %r14, %r8
callq 0x17130e
testb %al, %al
je 0x15021e
leaq 0x232b1d(%rip), %rdi    # 0x382cf8
movq %r13, %rsi
xorl %eax, %eax
callq 0x103d72
movq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x2fb083
movq %r14, %rdi
callq 0x2fb10a
testq %rax, %rax
js 0x1504dd
movq %r15, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x171222
movq 0x30(%rbx), %r14
shlq $0x3, %r14
xorl %ebp, %ebp
xorl %r12d, %r12d
movq 0x8(%rbx), %rdi
movq 0x20(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %r8
xorl %r9d, %r9d
callq 0x150877
cmpq %rax, %r14
jae 0x150263
movq 0x30(%rbx), %rcx
shlq $0x3, %rcx
movq 0x18(%rsp), %rdi
subq %r14, %rax
incq %rbp
movq %rcx, %r14
cmpq %rax, %rcx
jb 0x150250
movq %rcx, %r14
jmp 0x150268
movq 0x18(%rsp), %rdi
subq %rax, %r14
cmpq $0x1, %rbp
adcq $0x0, %rbp
incq %r12
movq 0x10(%rsp), %rax
movq 0x8(%rbx), %rcx
addq %rax, 0x28(%rcx)
incq %r13
leaq 0x20(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x50(%rsp), %rcx
movq (%rsp), %r8
callq 0x11433d
cmpl $0x1, %eax
je 0x150190
movq 0x28(%rsp), %r12
movq 0x40(%rsp), %rbp
jmp 0x1502c7
movq %r15, %rdi
callq 0xfcc32
testb %al, %al
jne 0x1502ef
callq 0x4793d
xorl %r13d, %r13d
cmpq %r13, 0x18(%rbx)
movq 0x30(%rsp), %r13
jne 0x150512
testl %eax, %eax
je 0x15042f
movq (%rsp), %rdi
callq 0xfcc32
testb %al, %al
je 0x150526
movq 0x8(%rsp), %rdi
callq 0x2fb112
movq 0x18(%rsp), %rdi
callq 0x11437f
movq %r13, %rdi
callq 0xfd09a
xorl %ebp, %ebp
callq 0x103d66
testb %al, %al
je 0x15041e
movq %r12, %rdi
callq 0x11acc9
movq %rax, %r14
leaq 0x2326a6(%rip), %rsi    # 0x3829d2
movq %rax, %rdi
callq 0x11acf3
leaq 0x23269c(%rip), %rdi    # 0x3829d7
xorl %eax, %eax
callq 0x103d72
leaq 0x2326ba(%rip), %rdi    # 0x382a03
xorl %eax, %eax
callq 0x103d72
cmpb $0x1, 0x38(%rbx)
jne 0x150363
movq 0x28(%rbx), %rsi
leaq 0x22bbf2(%rip), %rdi    # 0x37bf53
jmp 0x150374
cmpb $0x1, 0x39(%rbx)
jne 0x15037d
movq 0x28(%rbx), %rsi
leaq 0x232693(%rip), %rdi    # 0x382a07
xorl %eax, %eax
callq 0x103d72
jmp 0x15038b
leaq 0x22bc05(%rip), %rdi    # 0x37bf89
xorl %eax, %eax
callq 0x103d72
movq 0x18(%rbx), %rsi
leaq 0x2326a7(%rip), %rdi    # 0x382a3d
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x103d72
movq 0x8(%rbx), %rax
movq 0x28(%rax), %rsi
leaq 0x2326d0(%rip), %rdi    # 0x382a7e
xorl %eax, %eax
callq 0x103d72
movq %r14, %rdi
callq 0x11b0a1
movq %rax, %rdi
callq 0xff6cf
cvtsi2sd %rax, %xmm0
mulsd 0x22b94e(%rip), %xmm0   # 0x37bd20
movq 0x8(%rbx), %rax
movsd 0x28(%rax), %xmm1
unpcklps 0x1f74fe(%rip), %xmm1   # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1f7506(%rip), %xmm1   # 0x3478f0
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
leaq 0x2326a7(%rip), %rdi    # 0x382aa8
movb $0x1, %al
callq 0x103d72
leaq 0x2326ba(%rip), %rdi    # 0x382ac9
xorl %eax, %eax
callq 0x103d72
movq %r14, %rdi
callq 0x11bdbf
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x2fb03b
movq %r14, %rdi
callq 0x2fb10a
testq %rax, %rax
js 0x1504b7
movq 0x8(%rbx), %rcx
movq %rax, 0x38(%rcx)
leaq 0x2328e7(%rip), %rdi    # 0x382d3f
movq %rax, %rsi
xorl %eax, %eax
callq 0x103d72
movq 0x8(%rbx), %rax
movq 0x20(%rax), %rdi
testq %rdi, %rdi
je 0x150477
movq %r13, %rsi
callq 0x170cf3
movq 0x8(%rsp), %rdi
callq 0x2fb112
movq 0x18(%rsp), %rdi
callq 0x11437f
movq %r13, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x11f87a
movq 0x8(%rbx), %rdi
addq $0x38, %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x11f89c
jmp 0x150303
callq 0x17060
movl (%rax), %edi
callq 0x17240
leaq 0x232840(%rip), %rsi    # 0x382d0a
movq (%rsp), %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xfcb67
jmp 0x1502ef
callq 0x17060
movl (%rax), %edi
callq 0x17240
leaq 0x23281a(%rip), %rsi    # 0x382d0a
movq (%rsp), %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xfcb67
cmpq %r13, 0x18(%rbx)
movq 0x28(%rsp), %r12
movq 0x30(%rsp), %r13
je 0x1502ef
callq 0x478cb
callq 0x47820
callq 0x47859
callq 0x47892
callq 0x47904