// File: /workspace/github_c_makefile_star2_O2/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, %r12
movq %r8, 0x20(%rsp)
movq %rcx, %r13
movq %rdx, %r15
movl %esi, %ebp
movq 0x1d8(%rsp), %rbx
movq 0x20(%rdi), %rcx
leaq 0x1a1115(%rip), %rdx    # 0x35fed7
leaq 0x30(%rsp), %r14
movl $0xff, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x17bf0
leaq 0x12688c(%rip), %rdx    # 0x2e5669
xorl %edi, %edi
movq %r14, %rsi
movq %rbx, %rcx
callq 0x8cea6
testq %rax, %rax
je 0x1beea3
movq %rax, %rbx
movq %r12, 0x10(%rsp)
movq %r15, 0x18(%rsp)
movl %ebp, 0xc(%rsp)
movq 0x1c8(%rsp), %r15
leaq 0x1a0f88(%rip), %rbp    # 0x35fd9b
pushq $0x1
popq %rsi
movl $0x401, %edi            # imm = 0x401
movq %rbp, %rdx
movl $0x2c9, %ecx            # imm = 0x2C9
callq 0x9334a
movq %rax, %r14
movl $0x400, %r12d           # imm = 0x400
movq %r14, %rdi
movq %r12, %rsi
callq 0x17340
testq %rax, %rax
jne 0x1bee65
leaq 0x401(%r12), %rsi
movq %r14, %rdi
movq %rbp, %rdx
movl $0x2cd, %ecx            # imm = 0x2CD
callq 0x93472
movq %rax, %r14
addq $0x400, %r12            # imm = 0x400
jmp 0x1bee31
testq %r14, %r14
je 0x1bf10a
cmpb $0x0, (%r14)
je 0x1bf10a
testq %r13, %r13
movl 0xc(%rsp), %ebp
movq 0x18(%rsp), %r12
je 0x1beeab
cmpb $0x2f, (%r13)
jne 0x1beebe
leaq 0x1a10ce(%rip), %rsi    # 0x35ff62
movq %rbx, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x8d432
jmp 0x1beed5
pushq $-0x1
popq %rbp
jmp 0x1bf0f6
leaq 0x1a1080(%rip), %rsi    # 0x35ff32
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8d432
jmp 0x1beed5
leaq 0x1a1086(%rip), %rsi    # 0x35ff4b
movq %rbx, %rdi
movq %r14, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x8d432
testb $0x1, %bpl
je 0x1bef2e
leaq 0x1a1094(%rip), %rsi    # 0x35ff76
movq %rbx, %rdi
movq 0x20(%rsp), %rdx
movq 0x10(%rsp), %rcx
xorl %eax, %eax
callq 0x8d432
leaq 0x170(%rsp), %rax
movq (%rax), %rdx
movq 0x8(%rax), %rcx
leaq 0x1a1087(%rip), %rsi    # 0x35ff93
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8d432
leaq 0x1a1095(%rip), %rsi    # 0x35ffb2
movq %rbx, %rdi
movl 0x180(%rsp), %edx
xorl %eax, %eax
callq 0x8d432
testb $0x2, %bpl
je 0x1beffc
cmpb $0x2f, (%r12)
jne 0x1bef55
leaq 0x1a10ab(%rip), %rsi    # 0x35fff1
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x8d432
jmp 0x1bef6c
leaq 0x1a106f(%rip), %rsi    # 0x35ffcb
movq %rbx, %rdi
movq %r14, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x8d432
leaq 0x188(%rsp), %rax
movq (%rax), %rdx
movq 0x8(%rax), %rcx
leaq 0x1a1092(%rip), %rsi    # 0x360014
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8d432
leaq 0x1a10bc(%rip), %rsi    # 0x36004f
movq %rbx, %rdi
movl 0x198(%rsp), %edx
xorl %eax, %eax
callq 0x8d432
leaq 0x1a0(%rsp), %rax
movq (%rax), %rdx
movq 0x8(%rax), %rcx
leaq 0x1a10bf(%rip), %rsi    # 0x360079
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8d432
leaq 0x1b0(%rsp), %rax
movq (%rax), %rdx
movq 0x8(%rax), %rcx
leaq 0x1a10d5(%rip), %rsi    # 0x3600af
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8d432
leaq 0x1a10ff(%rip), %rsi    # 0x3600ea
movq %rbx, %rdi
movl 0x1c0(%rsp), %edx
xorl %eax, %eax
callq 0x8d432
testb $0x4, %bpl
je 0x1bf0c7
movq %r15, %rdi
callq 0xae61c
leaq 0x1a10ee(%rip), %rsi    # 0x360103
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8d432
leaq 0x1a9e80(%rip), %r12    # 0x368ea9
leaq 0x186951(%rip), %r13    # 0x345981
xorl %ebp, %ebp
movq %r15, %rdi
callq 0xae61c
cmpq %rax, %rbp
jae 0x1bf07c
movq %r15, %rdi
movq %rbp, %rsi
callq 0xae386
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8d432
movq %r15, %rdi
callq 0xae61c
decq %rax
cmpq %rax, %rbp
je 0x1bf077
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x8d432
incq %rbp
jmp 0x1bf032
leaq 0x14b33a(%rip), %rsi    # 0x30a3bd
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8d432
leaq 0x1a108b(%rip), %rsi    # 0x36011f
movsd 0x13e46c(%rip), %xmm1   # 0x2fd508
movq %rbx, %rdi
movsd 0x28(%rsp), %xmm0
movb $0x2, %al
callq 0x8d432
leaq 0x1a1088(%rip), %rsi    # 0x36013b
pushq $0x32
popq %rcx
movq %rbx, %rdi
movl 0x1d0(%rsp), %edx
xorl %eax, %eax
callq 0x8d432
leaq 0x1a1421(%rip), %rsi    # 0x3604ef
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8d432
movq %rbx, %rdi
callq 0x8da06
leaq 0x1a0cb2(%rip), %rsi    # 0x35fd9b
movq %r14, %rdi
movl $0x325, %edx            # imm = 0x325
callq 0x936f9
movl %ebp, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x278e57(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x125ef8(%rip), %rsi    # 0x2e5013
leaq 0x1a0dc7(%rip), %rdx    # 0x35fee9
leaq 0x1a0ddd(%rip), %rcx    # 0x35ff06
leaq 0x1a0c6b(%rip), %r8     # 0x35fd9b
movl $0x2cf, %r9d            # imm = 0x2CF
xorl %eax, %eax
callq 0x17a50
callq 0x17390