// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/bioseq.c
// Function: construct_bioseq_files
static int construct_bioseq_files(GtBioseq *bs, GtStr *bioseq_indexname,
                                  GtError *err)
{
  GtStr *sequence_filename;
  GtEncseqEncoder *ee;
  GtStrArray *indexfn;
  int had_err = 0;

  gt_error_check(err);

  /* register the signal handler to remove incomplete files upon termination */
  if (!bs->use_stdin) {
    gt_bioseq_index_filename = gt_str_get(bs->sequence_file);
    gt_sig_register_all(remove_bioseq_files_sig);
  }

  /* if stdin is used as input, we need to create a tempfile containing the
     sequence as GtEncseq cannot be built from stdin directly */
  if (bs->use_stdin) {
    GtStr *tmpfilename;
    FILE *tmpfile = NULL;
    int i;
    char buf[BUFSIZ];
    tmpfilename = gt_str_new();
    tmpfile = gt_xtmpfp(tmpfilename);
    gt_assert(tmpfile);
    i = 1;
    while (i > 0) {
      i = fread(buf, 1, BUFSIZ, stdin);
      if (i > 0) fwrite(buf, 1, i, tmpfile);
    }
    gt_fa_xfclose(tmpfile);
    sequence_filename = tmpfilename;
  } else {
    sequence_filename = gt_str_ref(bs->sequence_file);
  }
  gt_assert(gt_str_length(sequence_filename) > 0);
  ee = gt_encseq_encoder_new();
  gt_encseq_encoder_enable_description_support(ee);
  gt_encseq_encoder_enable_md5_support(ee);
  gt_encseq_encoder_enable_multiseq_support(ee);
  gt_encseq_encoder_enable_lossless_support(ee);
  indexfn = gt_str_array_new();
  gt_str_array_add(indexfn, sequence_filename);
  gt_str_delete(sequence_filename);
  had_err = gt_encseq_encoder_encode(ee, indexfn,
                                     gt_str_get(bioseq_indexname), err);
  /* unregister the signal handler */
   if (!bs->use_stdin)
    gt_sig_unregister_all();

  gt_str_array_delete(indexfn);
  gt_encseq_encoder_delete(ee);
  return had_err;
}

// Assembly:
subq $0x2068, %rsp           # imm = 0x2068
movq %rdi, 0x2060(%rsp)
movq %rsi, 0x2058(%rsp)
movq %rdx, 0x2050(%rsp)
movl $0x0, 0x2034(%rsp)
cmpq $0x0, 0x2050(%rsp)
je 0x10de50
movq 0x2050(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0x10de18
jmp 0x10de50
movq 0xa61b9(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x5023d(%rip), %rsi     # 0x15e066
leaq 0x50818(%rip), %rdx     # 0x15e648
leaq 0x76866(%rip), %rcx     # 0x18469d
leaq 0x76314(%rip), %r8      # 0x184152
movl $0x64, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x10de52
movq 0x2060(%rsp), %rax
testb $0x1, (%rax)
jne 0x10de83
movq 0x2060(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x19940
movq %rax, 0xa87e9(%rip)     # 0x1b6660
leaq 0x282(%rip), %rdi       # 0x10e100
callq 0x14b490
movq 0x2060(%rsp), %rax
testb $0x1, (%rax)
je 0x10df99
movq $0x0, 0x2020(%rsp)
callq 0x18f00
movq %rax, 0x2028(%rsp)
movq 0x2028(%rsp), %rdi
xorl %esi, %esi
leaq 0x76294(%rip), %rdx     # 0x184152
movl $0x74, %ecx
callq 0x80630
movq %rax, 0x2020(%rsp)
cmpq $0x0, 0x2020(%rsp)
jne 0x10df13
movq 0xa60f6(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x5017a(%rip), %rsi     # 0x15e066
leaq 0x5de1d(%rip), %rdx     # 0x16bd10
leaq 0x767a3(%rip), %rcx     # 0x18469d
leaq 0x76251(%rip), %r8      # 0x184152
movl $0x75, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x10df15
movl $0x1, 0x201c(%rsp)
cmpl $0x0, 0x201c(%rsp)
jle 0x10df7a
leaq 0x10(%rsp), %rdi
movq 0xa6092(%rip), %rax     # 0x1b3fc8
movq (%rax), %rcx
movl $0x1, %esi
movl $0x2000, %edx           # imm = 0x2000
callq 0xb900
movl %eax, 0x201c(%rsp)
cmpl $0x0, 0x201c(%rsp)
jle 0x10df78
leaq 0x10(%rsp), %rdi
movslq 0x201c(%rsp), %rdx
movq 0x2020(%rsp), %rcx
movl $0x1, %esi
callq 0xbc70
jmp 0x10df20
movq 0x2020(%rsp), %rdi
callq 0x7fd50
movq 0x2028(%rsp), %rax
movq %rax, 0x2048(%rsp)
jmp 0x10dfb2
movq 0x2060(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x19dc0
movq %rax, 0x2048(%rsp)
jmp 0x10dfb4
movq 0x2048(%rsp), %rdi
callq 0x19a00
cmpq $0x0, %rax
ja 0x10dfff
movq 0xa600a(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x5008e(%rip), %rsi     # 0x15e066
leaq 0x766d5(%rip), %rdx     # 0x1846b4
leaq 0x766b7(%rip), %rcx     # 0x18469d
leaq 0x76165(%rip), %r8      # 0x184152
movl $0x80, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x10e001
callq 0x122270
movq %rax, 0x2040(%rsp)
movq 0x2040(%rsp), %rdi
callq 0x122360
movq 0x2040(%rsp), %rdi
callq 0x1223c0
movq 0x2040(%rsp), %rdi
callq 0x122300
movq 0x2040(%rsp), %rdi
callq 0x122a60
callq 0x1b020
movq %rax, 0x2038(%rsp)
movq 0x2038(%rsp), %rdi
movq 0x2048(%rsp), %rsi
callq 0x1b2a0
movq 0x2048(%rsp), %rdi
callq 0x1afc0
movq 0x2040(%rsp), %rax
movq %rax, (%rsp)
movq 0x2038(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x2058(%rsp), %rdi
callq 0x19940
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %rax, %rdx
movq 0x2050(%rsp), %rcx
callq 0x123500
movl %eax, 0x2034(%rsp)
movq 0x2060(%rsp), %rax
testb $0x1, (%rax)
jne 0x10e0c9
callq 0x14b5a0
movq 0x2038(%rsp), %rdi
callq 0x1b780
movq 0x2040(%rsp), %rdi
callq 0x122d50
movl 0x2034(%rsp), %eax
addq $0x2068, %rsp           # imm = 0x2068
retq
nopw %cs:(%rax,%rax)