// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/extended/match_iterator_last.c
// Function: last_prepare_fasta_seqs
static int last_prepare_fasta_seqs(const char *filename, GtEncseq *encseq,
                                   GtHashmap *desc_to_seqno,
                                   GT_UNUSED GtError *err)
{
  char *seq;
  const char *desc;
  int had_err = 0;
  GtFile *fp;
  GtStr *header = NULL;
  GtUword desclen;
  gt_assert(filename && encseq);
  gt_error_check(err);

  if (!(fp = gt_file_open(GT_FILE_MODE_UNCOMPRESSED, filename, "w", err)))
    had_err = -1;
  header = gt_str_new();
  if (!had_err) {
    GtUword i, length, startpos, endpos;
    for (i = 0; i < gt_encseq_num_of_sequences(encseq); i++) {
      char *desccpy;
      desc = gt_encseq_description(encseq, &desclen, i);
      desccpy = gt_calloc(desclen+1, sizeof (char));
      strncpy(desccpy, desc, desclen);
      startpos = gt_encseq_seqstartpos(encseq, i);
      length = gt_encseq_seqlength(encseq, i);
      gt_hashmap_add(desc_to_seqno, desccpy, (void*) i);
      endpos = startpos + length - 1;
      seq = gt_malloc(sizeof (char) * length);
      gt_str_reset(header);
      gt_str_append_cstr_nt(header, desc, desclen);
      gt_encseq_extract_decoded(encseq, seq, startpos, endpos);
      gt_fasta_show_entry(gt_str_get(header), seq, length, 80, fp);
      gt_free(seq);
    }
    gt_file_delete(fp);
  }
  gt_str_delete(header);

  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, 0x20(%rsp)
testq %rdi, %rdi
je 0x167589
movq %rsi, %r12
testq %rsi, %rsi
je 0x167589
movq %rcx, %rbx
movq %rdi, %r15
testq %rcx, %rcx
je 0x167402
movq %rbx, %rdi
callq 0x101a9a
testb %al, %al
jne 0x16758e
leaq 0x235628(%rip), %rdx    # 0x39ca31
xorl %ebp, %ebp
xorl %edi, %edi
movq %r15, %rsi
movq %rbx, %rcx
callq 0x1039a2
movq %rax, %rbx
callq 0x1208f8
testq %rbx, %rbx
je 0x16756a
movq %rax, 0x10(%rsp)
movq %r12, %rdi
callq 0xec1e8
testq %rax, %rax
je 0x16755b
xorl %r13d, %r13d
movq %rbx, 0x18(%rsp)
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
movq %r13, %rdx
callq 0xf079f
movq %rax, %rbx
movq %rax, 0x30(%rsp)
movq 0x8(%rsp), %rdi
incq %rdi
movl $0x1, %esi
leaq 0x22908b(%rip), %r14    # 0x3904fe
movq %r14, %rdx
movl $0xbb, %ecx
callq 0x1093ef
movq %rax, %rbp
movq 0x8(%rsp), %rdx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x17370
movq %r12, %rdi
movq %r13, %rsi
callq 0xefce0
movq %rax, %rbx
movq %r12, %rdi
movq %r13, %rsi
callq 0xeffd3
movq %rax, %r15
movq 0x20(%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x105a4c
leaq (%rbx,%r15), %rax
decq %rax
movq %rax, 0x28(%rsp)
movq %r15, %rdi
movq %r14, %rsi
movl $0xc1, %edx
callq 0x1092b2
movq %rax, %rbp
movq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x120db4
movq 0x8(%rsp), %rdx
movq %r14, %rdi
movq 0x30(%rsp), %rsi
callq 0x120a9d
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movq 0x18(%rsp), %rbx
movq 0x28(%rsp), %rcx
callq 0xed87b
movq %r14, %rdi
callq 0x120d23
movl $0x50, %ecx
movq %rax, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movq %rbx, %r8
callq 0x102ec0
movq %rbp, %rdi
leaq 0x228fc1(%rip), %rsi    # 0x3904fe
movl $0xc6, %edx
callq 0x109670
incq %r13
movq %r12, %rdi
callq 0xec1e8
cmpq %rax, %r13
jb 0x167447
movq %rbx, %rdi
callq 0x1040fc
xorl %ebp, %ebp
movq 0x10(%rsp), %rax
cmpq $0x1, %rbx
sbbl %ebp, %ebp
movq %rax, %rdi
callq 0x121b03
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4d3dd
callq 0x4d416
nop