// File: /workspace/github_c_makefile_star2_O1/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 0x1b508f(%rip), %rdx    # 0x3c9107
leaq 0x30(%rsp), %r14
movl $0xff, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x17c60
leaq 0x13a5d6(%rip), %rdx    # 0x34e669
xorl %edi, %edi
movq %r14, %rsi
movq %rbx, %rcx
callq 0x1039a2
testq %rax, %rax
je 0x214167
movq %rax, %rbx
movq %r13, 0x18(%rsp)
movq %r12, 0x10(%rsp)
movl %ebp, 0xc(%rsp)
leaq 0x1b4f0a(%rip), %rdx    # 0x3c8fcb
movl $0x401, %edi            # imm = 0x401
movl $0x1, %esi
movl $0x2c9, %ecx            # imm = 0x2C9
callq 0x1093ef
movq %rax, %r14
movl $0x400, %esi            # imm = 0x400
movq %rax, %rdi
callq 0x17360
testq %rax, %rax
jne 0x214129
movl $0x801, %r12d           # imm = 0x801
leaq 0x1b4ed4(%rip), %r13    # 0x3c8fcb
leaq -0x1(%r12), %rbp
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
movl $0x2cd, %ecx            # imm = 0x2CD
callq 0x1094e6
movq %rax, %r14
movq %rax, %rdi
movq %rbp, %rsi
callq 0x17360
addq $0x400, %r12            # imm = 0x400
testq %rax, %rax
je 0x2140f7
testq %r14, %r14
je 0x2143f0
cmpb $0x0, (%r14)
je 0x2143f0
testq %r15, %r15
movl 0xc(%rsp), %r12d
movq 0x18(%rsp), %r13
je 0x214171
cmpb $0x2f, (%r15)
jne 0x214184
leaq 0x1b503a(%rip), %rsi    # 0x3c9192
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x103d21
jmp 0x21419b
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x2143dc
leaq 0x1b4fea(%rip), %rsi    # 0x3c9162
movq %rbx, %rdi
xorl %eax, %eax
callq 0x103d21
jmp 0x21419b
leaq 0x1b4ff0(%rip), %rsi    # 0x3c917b
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x103d21
testb $0x1, %r12b
je 0x2141f4
movl 0x180(%rsp), %ebp
leaq 0x170(%rsp), %r15
leaq 0x1b4fef(%rip), %rsi    # 0x3c91a6
movq %rbx, %rdi
movq 0x20(%rsp), %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x103d21
movq (%r15), %rdx
movq 0x8(%r15), %rcx
leaq 0x1b4fec(%rip), %rsi    # 0x3c91c3
movq %rbx, %rdi
xorl %eax, %eax
callq 0x103d21
leaq 0x1b4ffa(%rip), %rsi    # 0x3c91e2
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x103d21
testb $0x2, %r12b
je 0x2142cd
leaq 0x1b0(%rsp), %r13
leaq 0x1a0(%rsp), %rbp
movl 0x198(%rsp), %r12d
leaq 0x188(%rsp), %r15
movq 0x10(%rsp), %rcx
cmpb $0x2f, (%rcx)
jne 0x21423e
leaq 0x1b4ff2(%rip), %rsi    # 0x3c9221
movq %rbx, %rdi
movq %rcx, %rdx
xorl %eax, %eax
callq 0x103d21
jmp 0x214252
leaq 0x1b4fb6(%rip), %rsi    # 0x3c91fb
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x103d21
movq (%r15), %rdx
movq 0x8(%r15), %rcx
leaq 0x1b4fe4(%rip), %rsi    # 0x3c9244
movq %rbx, %rdi
xorl %eax, %eax
callq 0x103d21
leaq 0x1b500e(%rip), %rsi    # 0x3c927f
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0x103d21
movq (%rbp), %rdx
movq 0x8(%rbp), %rcx
leaq 0x1b501c(%rip), %rsi    # 0x3c92a9
movq %rbx, %rdi
xorl %eax, %eax
callq 0x103d21
movq (%r13), %rdx
movq 0x8(%r13), %rcx
leaq 0x1b5039(%rip), %rsi    # 0x3c92df
movq %rbx, %rdi
xorl %eax, %eax
callq 0x103d21
leaq 0x1b5063(%rip), %rsi    # 0x3c931a
movq %rbx, %rdi
movl 0x1c0(%rsp), %edx
xorl %eax, %eax
callq 0x103d21
movl 0xc(%rsp), %r12d
testb $0x4, %r12b
je 0x2143ad
movq 0x1c8(%rsp), %r15
movq %r15, %rdi
callq 0x121e78
leaq 0x1b5045(%rip), %rsi    # 0x3c9333
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x103d21
movq %r15, %rdi
callq 0x121e78
testq %rax, %rax
je 0x214360
leaq 0x1bdec2(%rip), %r12    # 0x3d21d1
leaq 0x19a88d(%rip), %r13    # 0x3aeba3
xorl %ebp, %ebp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x121cfa
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x103d21
movq %r15, %rdi
callq 0x121e78
decq %rax
cmpq %rax, %rbp
je 0x214350
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x103d21
incq %rbp
movq %r15, %rdi
callq 0x121e78
cmpq %rax, %rbp
jb 0x214318
leaq 0x15f34e(%rip), %rsi    # 0x3736b5
movq %rbx, %rdi
xorl %eax, %eax
callq 0x103d21
leaq 0x1b4fd7(%rip), %rsi    # 0x3c934f
movsd 0x1522d0(%rip), %xmm1   # 0x366650
movq %rbx, %rdi
movsd 0x28(%rsp), %xmm0
movb $0x2, %al
callq 0x103d21
leaq 0x1b4fd4(%rip), %rsi    # 0x3c936b
movq %rbx, %rdi
movl 0x1d0(%rsp), %edx
movl $0x32, %ecx
xorl %eax, %eax
callq 0x103d21
leaq 0x1b536b(%rip), %rsi    # 0x3c971f
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %eax, %eax
callq 0x103d21
movq %rbx, %rdi
callq 0x1040fc
leaq 0x1b4bfc(%rip), %rsi    # 0x3c8fcb
movq %r14, %rdi
movl $0x325, %edx            # imm = 0x325
callq 0x109670
movl %ebp, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x8293b