// File: /workspace/github_c_makefile_star2_O3/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 $0x4038, %rsp           # imm = 0x4038
movq %r9, %r12
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, 0x8(%rsp)
movq %rsi, %r14
movq %rdi, 0x10(%rsp)
movq 0x4070(%rsp), %r13
leaq 0x2030(%rsp), %rdi
movl $0x2000, %edx           # imm = 0x2000
xorl %esi, %esi
callq 0x173a0
leaq 0x30(%rsp), %rdi
movl $0x2000, %edx           # imm = 0x2000
xorl %esi, %esi
callq 0x173a0
callq 0x11ac6c
movq %rax, 0x18(%rsp)
testq %r13, %r13
je 0x14f44a
movq %r13, %rdi
callq 0xfcc32
testb %al, %al
jne 0x14f69b
cmpq $0x0, 0x10(%rsp)
je 0x14f68c
testq %r14, %r14
je 0x14f68c
cmpq %r15, 0x8(%rsp)
ja 0x14f691
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
cmpq %r15, 0x60(%rax)
jbe 0x14f696
testq %r12, %r12
je 0x14f49b
movq 0x369a4f(%rip), %rax    # 0x4b8ed8
movq (%rax), %rdx
leaq 0x23330e(%rip), %rsi    # 0x3827a1
movq %r12, %rdi
callq 0x11cc90
leaq 0x23330a(%rip), %rsi    # 0x3827ac
leaq 0x24410c(%rip), %rdx    # 0x3935b5
leaq 0x23319c(%rip), %rcx    # 0x38264c
movq %r14, %rdi
movl $0x418, %r8d            # imm = 0x418
movq %r13, %r9
callq 0xfcf97
movq %rax, %r13
testq %rax, %rax
je 0x14f65f
leaq 0x30(%rsp), %r14
leaq 0x2030(%rsp), %rbp
movq %r15, 0x28(%rsp)
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbp, %rcx
movq 0x18(%rsp), %r8
movq 0x4070(%rsp), %r9
callq 0x14ef46
testl %eax, %eax
jne 0x14f65f
movl %eax, 0x24(%rsp)
movl $0x40, %edi
movq %r13, %rsi
callq 0x11f81a
cmpq $0x0, (%r12)
movq %r15, 0x8(%rsp)
je 0x14f543
movq 0x18(%rsp), %rdi
callq 0x11b0a1
movq %rax, %rdi
movq %r13, %rsi
callq 0x11f82c
jmp 0x14f557
movq %r13, %rdi
leaq 0x26ca6f(%rip), %rsi    # 0x3bbfbc
movq %r15, %rdx
xorl %eax, %eax
callq 0x17ab0
movl $0xa, %edi
movq %r13, %rsi
callq 0x11f81a
cmpb $0x0, 0x30(%rsp)
je 0x14f5b5
xorl %r15d, %r15d
xorl %r12d, %r12d
testq %rbx, %rbx
setne %al
cmpq %rbx, %r15
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x14f594
movl $0xa, %edi
movq %r13, %rsi
callq 0x11f81a
xorl %r15d, %r15d
movsbl 0x30(%rsp,%r12), %edi
movq %r13, %rsi
callq 0x11f81a
incq %r12
incq %r15
movq %r14, %rdi
callq 0x172f0
cmpq %rax, %r12
jb 0x14f571
movl $0xa, %edi
movq %r13, %rsi
callq 0x11f81a
movl $0x2b, %edi
movq %r13, %rsi
callq 0x11f81a
movl $0xa, %edi
movq %r13, %rsi
callq 0x11f81a
cmpb $0x0, 0x2030(%rsp)
je 0x14f633
xorl %r15d, %r15d
xorl %r12d, %r12d
testq %rbx, %rbx
setne %al
cmpq %rbx, %r15
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x14f60f
movl $0xa, %edi
movq %r13, %rsi
callq 0x11f81a
xorl %r15d, %r15d
movsbl 0x2030(%rsp,%r12), %edi
movq %r13, %rsi
callq 0x11f81a
incq %r12
incq %r15
movq %rbp, %rdi
callq 0x172f0
cmpq %rax, %r12
jb 0x14f5ec
movl $0xa, %edi
movq %r13, %rsi
callq 0x11f81a
xorl %r12d, %r12d
cmpl $0x0, 0x24(%rsp)
jne 0x14f665
movq 0x8(%rsp), %r15
incq %r15
cmpq 0x28(%rsp), %r15
jbe 0x14f4e4
jmp 0x14f665
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq %r13, %rdi
callq 0xfd09a
movq 0x18(%rsp), %rdi
callq 0x11bdbf
movl %r12d, %eax
addq $0x4038, %rsp           # imm = 0x4038
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x47502
callq 0x47574
callq 0x4753b
callq 0x474c9