// File: /workspace/github_c_makefile_star2_O1/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, (%rsp)
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
movq 0x4060(%rsp), %r13
leaq 0x2020(%rsp), %rdi
movl $0x2000, %edx           # imm = 0x2000
xorl %esi, %esi
callq 0x173a0
leaq 0x20(%rsp), %rdi
movl $0x2000, %edx           # imm = 0x2000
xorl %esi, %esi
callq 0x173a0
callq 0x1208f8
movq %rax, 0x10(%rsp)
testq %r13, %r13
je 0x156d08
movq %r13, %rdi
callq 0x101a9a
testb %al, %al
jne 0x156f6b
cmpq $0x0, 0x8(%rsp)
je 0x156f5c
testq %r14, %r14
je 0x156f5c
cmpq (%rsp), %r15
ja 0x156f61
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x60(%rax), %rax
cmpq %r15, %rax
jbe 0x156f66
cmpq (%rsp), %rax
jbe 0x156f66
testq %r12, %r12
je 0x156d65
movq 0x36d195(%rip), %rax    # 0x4c3ee8
movq (%rax), %rdx
leaq 0x234e07(%rip), %rsi    # 0x38bb64
movq %r12, %rdi
callq 0x1229c8
leaq 0x234e03(%rip), %rsi    # 0x38bb6f
leaq 0x245cbe(%rip), %rdx    # 0x39ca31
leaq 0x234c95(%rip), %rcx    # 0x38ba0f
movq %r14, %rdi
movl $0x418, %r8d            # imm = 0x418
movq %r13, %r9
callq 0x101dff
movq %rax, %r13
xorl %r12d, %r12d
testq %rax, %rax
sete %al
movq (%rsp), %r14
cmpq %r14, %r15
seta %cl
orb %al, %cl
je 0x156db0
movb %al, %r12b
negl %r12d
jmp 0x156f35
leaq 0x2020(%rsp), %rbp
movq 0x8(%rsp), %rdi
movq %r15, %rsi
leaq 0x20(%rsp), %rdx
movq %rbp, %rcx
movq 0x10(%rsp), %r8
movq 0x4060(%rsp), %r9
callq 0x1567ea
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x156f25
movl %eax, 0x1c(%rsp)
movl $0x40, %edi
movq %r13, %rsi
callq 0x1255d6
movq 0x8(%rsp), %rax
cmpq $0x0, (%rax)
je 0x156e1b
movq 0x10(%rsp), %rdi
callq 0x120d23
movq %rax, %rdi
movq %r13, %rsi
callq 0x1255e8
jmp 0x156e2f
movq %r13, %rdi
leaq 0x26e807(%rip), %rsi    # 0x3c562c
movq %r15, %rdx
xorl %eax, %eax
callq 0x17ab0
movl $0xa, %edi
movq %r13, %rsi
callq 0x1255d6
cmpb $0x0, 0x20(%rsp)
je 0x156e8f
xorl %r14d, %r14d
xorl %r12d, %r12d
testq %rbx, %rbx
setne %al
cmpq %rbx, %r14
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x156e6c
movl $0xa, %edi
movq %r13, %rsi
callq 0x1255d6
xorl %r14d, %r14d
movsbl 0x20(%rsp,%r12), %edi
movq %r13, %rsi
callq 0x1255d6
incq %r12
incq %r14
leaq 0x20(%rsp), %rdi
callq 0x172f0
cmpq %rax, %r12
jb 0x156e49
movl $0xa, %edi
movq %r13, %rsi
callq 0x1255d6
movl $0x2b, %edi
movq %r13, %rsi
callq 0x1255d6
movl $0xa, %edi
movq %r13, %rsi
callq 0x1255d6
cmpb $0x0, 0x2020(%rsp)
je 0x156f0d
xorl %r14d, %r14d
xorl %r12d, %r12d
testq %rbx, %rbx
setne %al
cmpq %rbx, %r14
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x156ee9
movl $0xa, %edi
movq %r13, %rsi
callq 0x1255d6
xorl %r14d, %r14d
movsbl 0x2020(%rsp,%r12), %edi
movq %r13, %rsi
callq 0x1255d6
incq %r12
incq %r14
movq %rbp, %rdi
callq 0x172f0
cmpq %rax, %r12
jb 0x156ec6
movl $0xa, %edi
movq %r13, %rsi
callq 0x1255d6
xorl %r12d, %r12d
movq (%rsp), %r14
movl 0x1c(%rsp), %eax
testl %eax, %eax
jne 0x156f35
incq %r15
cmpq %r14, %r15
jbe 0x156db8
movq %r13, %rdi
callq 0x101f02
movq 0x10(%rsp), %rdi
callq 0x121b03
movl %r12d, %eax
addq $0x4028, %rsp           # imm = 0x4028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x48376
callq 0x483e8
callq 0x483af
callq 0x4833d