// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/ltr/ltrdigest_file_out_stream.c
// Function: gt_ltrdigest_file_out_stream_write_metadata
int gt_ltrdigest_file_out_stream_write_metadata(GtLTRdigestFileOutStream *ls,
                                         int tests_to_run,
                                         const char *trnafilename,
                                         const char *gfffilename,
                                         GtRange ppt_len,
                                         GtRange ubox_len,
                                         unsigned int ppt_radius,
                                         GtRange alilen,
                                         unsigned int max_edist,
                                         GtRange offsetlen,
                                         GtRange trnaoffsetlen,
                                         unsigned int pbs_radius,
                                         GtStrArray *hmm_files,
                                         unsigned int chain_max_gap_length,
                                         double evalue_cutoff,
                                         GtError *err)
{
  int buflen = 1024;
  GtFile *metadata_file;
  char *buffer,
       fn[GT_MAXFILENAMELEN];

  (void) snprintf(fn, (size_t) (GT_MAXFILENAMELEN-1),
                  "%s_conditions.csv", ls->fileprefix);
  metadata_file = gt_file_open(GT_FILE_MODE_UNCOMPRESSED, fn, "w+", err);
  if (!metadata_file)
    return -1;

  buffer = gt_calloc((size_t) (buflen+1), sizeof (char));
  /* get working directory */
  while (getcwd(buffer, (size_t) buflen) == NULL) {
    buflen += 1024;
    buffer = gt_realloc(buffer, (buflen+1) * sizeof (char));
  }
  gt_assert(buffer && strlen(buffer) > 0);

  /* append working dir to relative paths if necessary */
  if (gfffilename == NULL) {
    gt_file_xprintf(metadata_file,
                       "GFF3 input used\t<stdin>\n");
  } else {
    if (gfffilename[0] != GT_PATH_SEPARATOR)
      gt_file_xprintf(metadata_file,
                         "GFF3 input used\t%s/%s\n", buffer, gfffilename);
    else
      gt_file_xprintf(metadata_file,
                         "GFF3 input used\t%s\n", gfffilename);
  }

  if (tests_to_run & GT_LTRDIGEST_RUN_PPT)
  {
    gt_file_xprintf(metadata_file,
                       "PPT length\t"GT_WU"-"GT_WU"nt\t8-30nt\n",
                       ppt_len.start,
                       ppt_len.end);
    gt_file_xprintf(metadata_file,
                       "U-box length\t"GT_WU"-"GT_WU"nt\t3-30nt\n",
                       ubox_len.start,
                       ubox_len.end);
    gt_file_xprintf(metadata_file,
                       "PPT search radius\t%u\t30\n", ppt_radius);
  }

  if (tests_to_run & GT_LTRDIGEST_RUN_PBS)
  {
    if (trnafilename[0] != GT_PATH_SEPARATOR)
      gt_file_xprintf(metadata_file,
                         "tRNA library for PBS detection\t%s/%s\n",
                         buffer, trnafilename);
    else
      gt_file_xprintf(metadata_file,
                         "tRNA library for PBS detection\t%s\n",
                         trnafilename);
    gt_file_xprintf(metadata_file,
                       "allowed PBS/tRNA alignment length"
                       " range\t"GT_WU"-"GT_WU"nt\t11-30nt\n",
                       alilen.start,
                       alilen.end);
    gt_file_xprintf(metadata_file,
                       "PBS/tRNA maximum unit edit distance\t%u\t1\n",
                       max_edist);
    gt_file_xprintf(metadata_file,
                       "allowed PBS offset from 5' LTR range"
                       "\t"GT_WU"-"GT_WU"nt\t0-5nt\n",
                       offsetlen.start,
                       offsetlen.end);
    gt_file_xprintf(metadata_file,
                       "allowed PBS offset from 3' tRNA end"
                       " range\t"GT_WU"-"GT_WU"nt\t0-5nt\n",
                       trnaoffsetlen.start,
                       trnaoffsetlen.end);
    gt_file_xprintf(metadata_file,
                       "PBS search radius\t%d\t30\n", pbs_radius);
  }

  if (tests_to_run & GT_LTRDIGEST_RUN_PDOM)
  {
    GtUword i;
    gt_file_xprintf(metadata_file,
                       "Protein domain models\t"GT_WU" (",
                       gt_str_array_size(hmm_files));
    for (i=0;i<gt_str_array_size(hmm_files);i++)
    {
      gt_file_xprintf(metadata_file, "%s", gt_str_array_get(hmm_files, i));
      if (i != gt_str_array_size(hmm_files)-1)
        gt_file_xprintf(metadata_file, ", ");
    }
    gt_file_xprintf(metadata_file, ")\n");
    gt_file_xprintf(metadata_file,
                       "pHMM e-value cutoff \t%g\t%g\n",
                       evalue_cutoff, 0.000001);
    gt_file_xprintf(metadata_file,
                       "maximal allowed gap length between fragments to chain"
                       " \t%u\t%u\n",
                       chain_max_gap_length, 50);
  }

  gt_file_xprintf(metadata_file, "\n");
  if (metadata_file != NULL)
    gt_file_delete(metadata_file);
  gt_free(buffer);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movsd %xmm0, 0x28(%rsp)
movq %r9, %r13
movq %r8, 0x20(%rsp)
movq %rcx, %r15
movq %rdx, %r12
movl %esi, %ebp
movq 0x1d8(%rsp), %rbx
movq 0x20(%rdi), %rcx
leaq 0x1b5373(%rip), %rdx    # 0x3bfa87
leaq 0x30(%rsp), %r14
movl $0xff, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x17c60
leaq 0x13af3a(%rip), %rdx    # 0x345669
xorl %edi, %edi
movq %r14, %rsi
movq %rbx, %rcx
callq 0xfead5
testq %rax, %rax
je 0x20a803
movq %rax, %rbx
movq %r13, 0x18(%rsp)
movq %r12, 0x10(%rsp)
movl %ebp, 0xc(%rsp)
leaq 0x1b51ee(%rip), %rdx    # 0x3bf94b
movl $0x401, %edi            # imm = 0x401
movl $0x1, %esi
movl $0x2c9, %ecx            # imm = 0x2C9
callq 0x10436a
movq %rax, %r14
movl $0x400, %esi            # imm = 0x400
movq %rax, %rdi
callq 0x17360
testq %rax, %rax
jne 0x20a7c5
movl $0x801, %r12d           # imm = 0x801
leaq 0x1b51b8(%rip), %r13    # 0x3bf94b
leaq -0x1(%r12), %rbp
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
movl $0x2cd, %ecx            # imm = 0x2CD
callq 0x104461
movq %rax, %r14
movq %rax, %rdi
movq %rbp, %rsi
callq 0x17360
addq $0x400, %r12            # imm = 0x400
testq %rax, %rax
je 0x20a793
testq %r14, %r14
je 0x20aa8c
cmpb $0x0, (%r14)
je 0x20aa8c
testq %r15, %r15
movl 0xc(%rsp), %r12d
movq 0x18(%rsp), %r13
je 0x20a80d
cmpb $0x2f, (%r15)
jne 0x20a820
leaq 0x1b531e(%rip), %rsi    # 0x3bfb12
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xfee51
jmp 0x20a837
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x20aa78
leaq 0x1b52ce(%rip), %rsi    # 0x3bfae2
movq %rbx, %rdi
xorl %eax, %eax
callq 0xfee51
jmp 0x20a837
leaq 0x1b52d4(%rip), %rsi    # 0x3bfafb
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0xfee51
testb $0x1, %r12b
je 0x20a890
movl 0x180(%rsp), %ebp
leaq 0x170(%rsp), %r15
leaq 0x1b52d3(%rip), %rsi    # 0x3bfb26
movq %rbx, %rdi
movq 0x20(%rsp), %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0xfee51
movq (%r15), %rdx
movq 0x8(%r15), %rcx
leaq 0x1b52d0(%rip), %rsi    # 0x3bfb43
movq %rbx, %rdi
xorl %eax, %eax
callq 0xfee51
leaq 0x1b52de(%rip), %rsi    # 0x3bfb62
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xfee51
testb $0x2, %r12b
je 0x20a969
leaq 0x1b0(%rsp), %r13
leaq 0x1a0(%rsp), %rbp
movl 0x198(%rsp), %r12d
leaq 0x188(%rsp), %r15
movq 0x10(%rsp), %rcx
cmpb $0x2f, (%rcx)
jne 0x20a8da
leaq 0x1b52d6(%rip), %rsi    # 0x3bfba1
movq %rbx, %rdi
movq %rcx, %rdx
xorl %eax, %eax
callq 0xfee51
jmp 0x20a8ee
leaq 0x1b529a(%rip), %rsi    # 0x3bfb7b
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xfee51
movq (%r15), %rdx
movq 0x8(%r15), %rcx
leaq 0x1b52c8(%rip), %rsi    # 0x3bfbc4
movq %rbx, %rdi
xorl %eax, %eax
callq 0xfee51
leaq 0x1b52f2(%rip), %rsi    # 0x3bfbff
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xfee51
movq (%rbp), %rdx
movq 0x8(%rbp), %rcx
leaq 0x1b5300(%rip), %rsi    # 0x3bfc29
movq %rbx, %rdi
xorl %eax, %eax
callq 0xfee51
movq (%r13), %rdx
movq 0x8(%r13), %rcx
leaq 0x1b531d(%rip), %rsi    # 0x3bfc5f
movq %rbx, %rdi
xorl %eax, %eax
callq 0xfee51
leaq 0x1b5347(%rip), %rsi    # 0x3bfc9a
movq %rbx, %rdi
movl 0x1c0(%rsp), %edx
xorl %eax, %eax
callq 0xfee51
movl 0xc(%rsp), %r12d
testb $0x4, %r12b
je 0x20aa49
movq 0x1c8(%rsp), %r15
movq %r15, %rdi
callq 0x11c131
leaq 0x1b5329(%rip), %rsi    # 0x3bfcb3
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xfee51
movq %r15, %rdi
callq 0x11c131
testq %rax, %rax
je 0x20a9fc
leaq 0x1be0fe(%rip), %r12    # 0x3c8aa9
leaq 0x19ac4f(%rip), %r13    # 0x3a5601
xorl %ebp, %ebp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x11bfb3
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xfee51
movq %r15, %rdi
callq 0x11c131
decq %rax
cmpq %rax, %rbp
je 0x20a9ec
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0xfee51
incq %rbp
movq %r15, %rdi
callq 0x11c131
cmpq %rax, %rbp
jb 0x20a9b4
leaq 0x15fa5a(%rip), %rsi    # 0x36a45d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xfee51
leaq 0x1b52bb(%rip), %rsi    # 0x3bfccf
movsd 0x152b64(%rip), %xmm1   # 0x35d580
movq %rbx, %rdi
movsd 0x28(%rsp), %xmm0
movb $0x2, %al
callq 0xfee51
leaq 0x1b52b8(%rip), %rsi    # 0x3bfceb
movq %rbx, %rdi
movl 0x1d0(%rsp), %edx
movl $0x32, %ecx
xorl %eax, %eax
callq 0xfee51
leaq 0x1b564f(%rip), %rsi    # 0x3c009f
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %eax, %eax
callq 0xfee51
movq %rbx, %rdi
callq 0xff22c
leaq 0x1b4ee0(%rip), %rsi    # 0x3bf94b
movq %r14, %rdi
movl $0x325, %edx            # imm = 0x325
callq 0x1045eb
movl %ebp, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x80a16