// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/hcr.c
// Function: gt_hcr_decoder_decode_range
int gt_hcr_decoder_decode_range(GtHcrDecoder *hcr_dec, const char *name,
                                GtUword start, GtUword end, GtUword width,
                                GtTimer *timer, GtError *err)
{
  char qual[BUFSIZ] = {0},
       seq[BUFSIZ] = {0};
  GtStr *desc = gt_str_new();
  int had_err = 0;
  GtUword cur_width,
                cur_read;
  size_t i;
  FILE *output;
  GT_UNUSED GtHcrSeqDecoder *seq_dec;

  gt_error_check(err);
  gt_assert(hcr_dec && name);
  seq_dec = hcr_dec->seq_dec;
  gt_assert(start <= end);
  gt_assert(start < seq_dec->num_of_reads && end < seq_dec->num_of_reads);
  if (timer != NULL)
    gt_timer_show_progress(timer, "decode hcr", stdout);
  output = gt_fa_fopen_with_suffix(name, HCRFILEDECODEDSUFFIX, "w", err);
  if (output == NULL)
    had_err = -1;

  for (cur_read = start; had_err == 0 && cur_read <= end; cur_read++) {
    if (gt_hcr_decoder_decode(hcr_dec, cur_read, seq, qual, desc, err) != 0)
      had_err = -1;
    else {
      gt_xfputc(HCR_DESCSEPSEQ, output);
      if (hcr_dec->encdesc != NULL)
        gt_xfputs(gt_str_get(desc), output);
      else
        fprintf(output, ""GT_WU"", cur_read);
      gt_xfputc('\n', output);
      for (i = 0, cur_width = 0; i < strlen(seq); i++, cur_width++) {
        if (width != 0 && cur_width == width) {
          cur_width = 0;
          gt_xfputc('\n', output);
        }
        gt_xfputc(seq[i], output);
      }
      gt_xfputc('\n', output);
      gt_xfputc(HCR_DESCSEPQUAL, output);
      gt_xfputc('\n', output);
      for (i = 0, cur_width = 0; i < strlen(qual); i++, cur_width++) {
        if (width != 0 && cur_width == width) {
          cur_width = 0;
          gt_xfputc('\n', output);
        }
        gt_xfputc(qual[i], output);
      }
      gt_xfputc('\n', output);
    }
  }
  gt_fa_xfclose(output);
  gt_str_delete(desc);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4028, %rsp           # imm = 0x4028
movq %r9, %r12
movq %r8, %rbx
movq %rcx, 0x18(%rsp)
movq %rdx, (%rsp)
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
movq 0x4060(%rsp), %r15
leaq 0x2020(%rsp), %rdi
movl $0x2000, %edx           # imm = 0x2000
xorl %esi, %esi
callq 0x17380
leaq 0x20(%rsp), %rdi
movl $0x2000, %edx           # imm = 0x2000
xorl %esi, %esi
callq 0x17380
callq 0xacb84
movq %rax, 0x10(%rsp)
testq %r15, %r15
je 0xea868
movq %r15, %rdi
callq 0x89eb7
testb %al, %al
jne 0xeab1e
cmpq $0x0, 0x8(%rsp)
je 0xeaa91
testq %r14, %r14
je 0xeaa91
movq 0x18(%rsp), %rcx
cmpq %rcx, (%rsp)
ja 0xeaac2
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
cmpq %rcx, 0x60(%rax)
jbe 0xeaaf0
testq %r12, %r12
je 0xea8bd
movq 0x34d605(%rip), %rax    # 0x437eb0
movq (%rax), %rdx
leaq 0x2382f8(%rip), %rsi    # 0x322bad
movq %r12, %rdi
callq 0xaf86f
leaq 0x2382f4(%rip), %rsi    # 0x322bb8
leaq 0x249043(%rip), %rdx    # 0x33390e
leaq 0x238186(%rip), %rcx    # 0x322a58
movq %r14, %rdi
movl $0x418, %r8d            # imm = 0x418
movq %r15, %r9
callq 0x8a449
movq %rax, %r13
cmpq $0x1, %rax
movl $0x0, %r15d
sbbl %r15d, %r15d
leaq 0x2020(%rsp), %rbp
pushq $0xa
popq %r12
movq (%rsp), %r14
testl %r15d, %r15d
jne 0xeaa6a
cmpq 0x18(%rsp), %r14
ja 0xeaa6a
movq 0x8(%rsp), %rdi
movq %r14, %rsi
leaq 0x20(%rsp), %rdx
movq %rbp, %rcx
movq 0x10(%rsp), %r8
movq 0x4060(%rsp), %r9
callq 0xea1c4
pushq $-0x1
popq %r15
testl %eax, %eax
jne 0xeaa62
movq %r14, (%rsp)
pushq $0x40
popq %rdi
movq %r13, %rsi
callq 0xb2f2e
movq 0x8(%rsp), %rax
cmpq $0x0, (%rax)
je 0xea976
movq 0x10(%rsp), %rdi
callq 0xad1fa
movq %rax, %rdi
movq %r13, %rsi
callq 0xb2f4f
jmp 0xea98b
movq %r13, %rdi
leaq 0x271a8e(%rip), %rsi    # 0x35c40e
movq (%rsp), %rdx
xorl %eax, %eax
callq 0x17a50
movl %r12d, %edi
movq %r13, %rsi
callq 0xb2f2e
xorl %r15d, %r15d
xorl %r14d, %r14d
leaq 0x20(%rsp), %rdi
callq 0x172d0
cmpq %rax, %r15
jae 0xea9e2
testq %rbx, %rbx
setne %al
cmpq %rbx, %r14
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xea9cc
movl %r12d, %edi
movq %r13, %rsi
callq 0xb2f2e
xorl %r14d, %r14d
movsbl 0x20(%rsp,%r15), %edi
movq %r13, %rsi
callq 0xb2f2e
incq %r15
incq %r14
jmp 0xea99c
movl %r12d, %edi
movq %r13, %rsi
callq 0xb2f2e
pushq $0x2b
popq %rdi
movq %r13, %rsi
callq 0xb2f2e
movl %r12d, %edi
movq %r13, %rsi
callq 0xb2f2e
xorl %r15d, %r15d
xorl %r14d, %r14d
movq %rbp, %rdi
callq 0x172d0
cmpq %rax, %r15
jae 0xeaa50
testq %rbx, %rbx
setne %al
cmpq %rbx, %r14
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xeaa37
movl %r12d, %edi
movq %r13, %rsi
callq 0xb2f2e
xorl %r14d, %r14d
movsbl 0x2020(%rsp,%r15), %edi
movq %r13, %rsi
callq 0xb2f2e
incq %r15
incq %r14
jmp 0xeaa09
movl %r12d, %edi
movq %r13, %rsi
callq 0xb2f2e
xorl %r15d, %r15d
movq (%rsp), %r14
incq %r14
jmp 0xea903
movq %r13, %rdi
callq 0x8a5e5
movq 0x10(%rsp), %rdi
callq 0xae103
movl %r15d, %eax
addq $0x4028, %rsp           # imm = 0x4028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x34d4d0(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1fa571(%rip), %rsi    # 0x2e5013
leaq 0x2380b7(%rip), %rdx    # 0x322b60
leaq 0x238094(%rip), %rcx    # 0x322b44
leaq 0x237fa1(%rip), %r8     # 0x322a58
movl $0x412, %r9d            # imm = 0x412
jmp 0xeab4a
movq 0x34d49f(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1fa540(%rip), %rsi    # 0x2e5013
leaq 0x22069b(%rip), %rdx    # 0x30b175
leaq 0x238063(%rip), %rcx    # 0x322b44
leaq 0x237f70(%rip), %r8     # 0x322a58
movl $0x414, %r9d            # imm = 0x414
jmp 0xeab4a
movq 0x34d471(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1fa512(%rip), %rsi    # 0x2e5013
leaq 0x238068(%rip), %rdx    # 0x322b70
leaq 0x238035(%rip), %rcx    # 0x322b44
leaq 0x237f42(%rip), %r8     # 0x322a58
movl $0x415, %r9d            # imm = 0x415
jmp 0xeab4a
movq 0x34d443(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1fa4e4(%rip), %rsi    # 0x2e5013
leaq 0x1fa689(%rip), %rdx    # 0x2e51bf
leaq 0x238007(%rip), %rcx    # 0x322b44
leaq 0x237f14(%rip), %r8     # 0x322a58
movl $0x411, %r9d            # imm = 0x411
xorl %eax, %eax
callq 0x17a50
callq 0x17390