// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
movq %rcx, 0x68(%rsp)
movl $0x0, 0x54(%rsp)
movq $0x0, 0x40(%rsp)
cmpq $0x0, 0x80(%rsp)
je 0x1a9d32
cmpq $0x0, 0x78(%rsp)
jne 0x1a9d6a
movq 0x492267(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x36c2d0(%rip), %rsi    # 0x516013
leaq 0x3afc20(%rip), %rdx    # 0x55996a
leaq 0x3afc2c(%rip), %rcx    # 0x55997d
leaq 0x3afb46(%rip), %r8     # 0x55989e
movl $0xb0, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1a9d6c
jmp 0x1a9d6e
cmpq $0x0, 0x68(%rsp)
je 0x1a9dbe
movq 0x68(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x1a9d86
jmp 0x1a9dbe
movq 0x492213(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x36c27c(%rip), %rsi    # 0x516013
leaq 0x36c421(%rip), %rdx    # 0x5161bf
leaq 0x3afbd8(%rip), %rcx    # 0x55997d
leaq 0x3afaf2(%rip), %r8     # 0x55989e
movl $0xb1, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1a9dc0
movq 0x80(%rsp), %rsi
movq 0x68(%rsp), %rcx
xorl %edi, %edi
leaq 0x3bc0ef(%rip), %rdx    # 0x565ec5
callq 0xdd3f0
movq %rax, 0x48(%rsp)
cmpq $0x0, %rax
jne 0x1a9dee
movl $0xffffffff, 0x54(%rsp) # imm = 0xFFFFFFFF
callq 0x11d4a0
movq %rax, 0x40(%rsp)
cmpl $0x0, 0x54(%rsp)
jne 0x1a9f80
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x78(%rsp), %rdi
callq 0xa9d50
movq %rax, %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
jae 0x1a9f76
movq 0x78(%rsp), %rdi
movq 0x30(%rsp), %rdx
leaq 0x38(%rsp), %rsi
callq 0xb1b40
movq %rax, 0x58(%rsp)
movq 0x38(%rsp), %rdi
addq $0x1, %rdi
movl $0x1, %esi
leaq 0x3afa3f(%rip), %rdx    # 0x55989e
movl $0xbb, %ecx
callq 0xe83c0
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x38(%rsp), %rdx
callq 0x19330
movq 0x78(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0xb0530
movq %rax, 0x20(%rsp)
movq 0x78(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0xb09f0
movq %rax, 0x28(%rsp)
movq 0x70(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x30(%rsp), %rdx
callq 0xe0fc0
movq 0x20(%rsp), %rax
addq 0x28(%rsp), %rax
subq $0x1, %rax
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rdi
shlq $0x0, %rdi
leaq 0x3af9bd(%rip), %rsi    # 0x55989e
movl $0xc1, %edx
callq 0xe80f0
movq %rax, 0x60(%rsp)
movq 0x40(%rsp), %rdi
callq 0x11e110
movq 0x40(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x38(%rsp), %rdx
callq 0x11d830
movq 0x78(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rcx
callq 0xac570
movq 0x40(%rsp), %rdi
callq 0x11dee0
movq %rax, %rdi
movq 0x60(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x48(%rsp), %r8
movl $0x50, %ecx
callq 0xdbd10
movq 0x60(%rsp), %rdi
leaq 0x3af945(%rip), %rsi    # 0x55989e
movl $0xc6, %edx
callq 0xe88c0
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
jmp 0x1a9e0c
movq 0x48(%rsp), %rdi
callq 0xde430
movq 0x40(%rsp), %rdi
callq 0x11f560
movl 0x54(%rsp), %eax
addq $0x88, %rsp
retq
nopw %cs:(%rax,%rax)