// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/tools/gt_condenseq_compress.c
// Function: gt_condenseq_compress_runner
static int gt_condenseq_compress_runner(GT_UNUSED int argc, const char **argv,
                                        int parsed_args, void *tool_arguments,
                                        GtError *err)
{
  GtCondenseqCompressArguments *arguments = tool_arguments;
  GtLogger *logger,
           *kdb_logger;
  FILE *kmer_fp = NULL;
  int had_err = 0;

  gt_error_check(err);
  gt_assert(arguments);

  logger = gt_logger_new(arguments->verbose, GT_LOGGER_DEFLT_PREFIX, stderr);
  kdb_logger = gt_logger_new(arguments->kdb, GT_LOGGER_DEFLT_PREFIX, stderr);
  if (arguments->kdb) {
    kmer_fp = gt_fa_fopen("kmer_db.out", "w", err);
    gt_logger_set_target(kdb_logger, kmer_fp);
  }

  if (gt_str_length(arguments->indexname) == 0UL) {
    char *basenameptr;
    basenameptr = gt_basename(argv[parsed_args]);
    gt_str_set(arguments->indexname, basenameptr);
    gt_free(basenameptr);
  }

  if (!had_err) {
    GtEncseqLoader *es_l = gt_encseq_loader_new();
    arguments->input_es = gt_encseq_loader_load(es_l, argv[parsed_args], err);
    if (arguments->input_es == NULL)
      had_err = -1;
    gt_encseq_loader_delete(es_l);
  }

/* TODO DW: this should be adjusted to reflect the parameter tests done. it
   could get fairly complicated heuristic, or we leave it as is.
   setting hard defaults for dna or protein would work, too.
  carefull: adjusting these might break test cases. */
  if (!had_err) {
    if (arguments->minalignlength == GT_UNDEF_UWORD)
      arguments->minalignlength = arguments->initsize != GT_UNDEF_UWORD ?
                                  arguments->initsize / (GtUword) 3UL :
                                  GT_UNDEF_UWORD;
    if (arguments->windowsize == GT_UNDEF_UINT)
      arguments->windowsize = arguments->minalignlength != GT_UNDEF_UWORD ?
                              (unsigned int) (arguments->minalignlength / 5U) :
                              GT_UNDEF_UINT;
    if (arguments->windowsize < 4U)
      arguments->windowsize = 4U;
    if (arguments->kmersize == GT_UNDEF_UINT) {
      unsigned int size =
        gt_alphabet_num_of_chars(gt_encseq_alphabet(arguments->input_es));
      /* size^k ~= 100000 */
      gt_safe_assign(arguments->kmersize,
                     gt_round_to_long(gt_log_base(100000.0, (double) size)));
      gt_logger_log(logger, "|A|: %u, k: %u",
                    size, arguments->kmersize);
    }

    if (arguments->windowsize == GT_UNDEF_UINT) {
      arguments->windowsize = 5U * arguments->kmersize;
    }
    if (arguments->minalignlength == GT_UNDEF_UWORD) {
      arguments->minalignlength = (GtUword) (3UL * arguments->windowsize);
    }
    if (arguments->initsize == GT_UNDEF_UWORD) {
      arguments->initsize = (GtUword) (3UL * arguments->minalignlength);
    }
  }
  if (!had_err &&
      arguments->windowsize <= arguments->kmersize) {
    gt_error_set(err, "-windowsize (%u) must be larger -kmersize (%u)!",
                 arguments->windowsize, arguments->kmersize);
    had_err = -1;
  }
  if (!had_err &&
      arguments->minalignlength < (GtUword) arguments->windowsize) {
    gt_error_set(err, "-alignlength (" GT_WU ") must be at least "
                 "-windowsize (%u)!", arguments->minalignlength,
                 arguments->windowsize);
    had_err = -1;
  }
  if (!had_err && (arguments->initsize < arguments->minalignlength)) {
    gt_error_set(err, "-initsize (" GT_WU ") must be at least "
                 "-alignlength (" GT_WU ")!", arguments->initsize,
                 arguments->minalignlength);
    had_err = -1;
  }

  if (!had_err) {
    GtCondenseqCreator *ces_c;

    if (!had_err) {
      ces_c = gt_condenseq_creator_new(arguments->initsize,
                                       arguments->minalignlength,
                                       arguments->xdrop,
                                       &(arguments->scores),
                                       arguments->kmersize,
                                       arguments->windowsize,
                                       logger,
                                       err);
      if (ces_c == NULL)
        had_err = -1;
    }
    if (!had_err) {
      if (arguments->cutoff_value == GT_UNDEF_UWORD)
        gt_condenseq_creator_use_mean_cutoff(ces_c);
      else if (arguments->cutoff_value == 0)
        gt_condenseq_creator_disable_cutoff(ces_c);
      else
        gt_condenseq_creator_set_cutoff(ces_c, arguments->cutoff_value);
      gt_condenseq_creator_set_mean_fraction(ces_c, arguments->fraction);
      if (arguments->prune)
        gt_condenseq_creator_disable_prune(ces_c);
      if (arguments->brute)
        gt_condenseq_creator_enable_brute_force(ces_c);
      if (!arguments->diags)
        gt_condenseq_creator_disable_diagonals(ces_c);
      if (arguments->full_diags)
        gt_condenseq_creator_enable_full_diagonals(ces_c);
      if (arguments->clean_percent != GT_UNDEF_UINT)
        gt_condenseq_creator_set_diags_clean_limit(ces_c,
                                                   arguments->clean_percent);

      had_err = gt_condenseq_creator_create(ces_c,
                                            arguments->indexname,
                                            arguments->input_es,
                                            logger, kdb_logger, err);

      gt_condenseq_creator_delete(ces_c);
    }
  }

  gt_logger_delete(logger);
  gt_logger_delete(kdb_logger);
  if (arguments->kdb)
    gt_fa_fclose(kmer_fp);
  return had_err;
}

// Assembly:
subq $0xa8, %rsp
movl %edi, 0xa4(%rsp)
movq %rsi, 0x98(%rsp)
movl %edx, 0x94(%rsp)
movq %rcx, 0x88(%rsp)
movq %r8, 0x80(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0x78(%rsp)
movq $0x0, 0x60(%rsp)
movl $0x0, 0x5c(%rsp)
cmpq $0x0, 0x80(%rsp)
je 0x263d1
movq 0x80(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x26399
jmp 0x263d1
movq 0x615c00(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4efc69(%rip), %rsi    # 0x516013
leaq 0x4efe0e(%rip), %rdx    # 0x5161bf
leaq 0x4f3a46(%rip), %rcx    # 0x519dfe
leaq 0x4f3219(%rip), %r8     # 0x5195d8
movl $0x11c, %r9d            # imm = 0x11C
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x263d3
jmp 0x263d5
cmpq $0x0, 0x78(%rsp)
jne 0x26415
movq 0x615bbc(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4efc25(%rip), %rsi    # 0x516013
leaq 0x55476a(%rip), %rdx    # 0x57ab5f
leaq 0x4f3a02(%rip), %rcx    # 0x519dfe
leaq 0x4f31d5(%rip), %r8     # 0x5195d8
movl $0x11d, %r9d            # imm = 0x11D
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x26417
movq 0x78(%rsp), %rax
movb 0x57(%rax), %al
movq 0x615b7a(%rip), %rcx    # 0x63bfa0
movq (%rcx), %rdx
leaq 0x4f14bc(%rip), %rsi    # 0x5178ec
andb $0x1, %al
movzbl %al, %edi
callq 0xe7870
movq %rax, 0x70(%rsp)
movq 0x78(%rsp), %rax
movb 0x58(%rax), %al
movq 0x615b52(%rip), %rcx    # 0x63bfa0
movq (%rcx), %rdx
leaq 0x4f1494(%rip), %rsi    # 0x5178ec
andb $0x1, %al
movzbl %al, %edi
callq 0xe7870
movq %rax, 0x68(%rsp)
movq 0x78(%rsp), %rax
testb $0x1, 0x58(%rax)
je 0x264ad
movq 0x80(%rsp), %r8
leaq 0x4f399a(%rip), %rdi    # 0x519e1b
leaq 0x53fa3d(%rip), %rsi    # 0x565ec5
leaq 0x4f3149(%rip), %rdx    # 0x5195d8
movl $0x122, %ecx            # imm = 0x122
callq 0xd8df0
movq %rax, 0x60(%rsp)
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0xe7a80
movq 0x78(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x11dfa0
cmpq $0x0, %rax
jne 0x26508
movq 0x98(%rsp), %rax
movslq 0x94(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x83ee0
movq %rax, 0x50(%rsp)
movq 0x78(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x50(%rsp), %rsi
callq 0x11d650
movq 0x50(%rsp), %rdi
leaq 0x4f30da(%rip), %rsi    # 0x5195d8
movl $0x12a, %edx            # imm = 0x12A
callq 0xe88c0
cmpl $0x0, 0x5c(%rsp)
jne 0x26567
callq 0xb7a40
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rdi
movq 0x98(%rsp), %rax
movslq 0x94(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
movq 0x80(%rsp), %rdx
callq 0xb7aa0
movq %rax, %rcx
movq 0x78(%rsp), %rax
movq %rcx, (%rax)
movq 0x78(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x2655d
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
movq 0x48(%rsp), %rdi
callq 0xb7e50
cmpl $0x0, 0x5c(%rsp)
jne 0x26778
movq 0x78(%rsp), %rax
cmpq $-0x1, 0x20(%rax)
jne 0x265c0
movq 0x78(%rsp), %rax
cmpq $-0x1, 0x38(%rax)
je 0x265a4
movq 0x78(%rsp), %rax
movq 0x38(%rax), %rax
movl $0x3, %ecx
xorl %edx, %edx
divq %rcx
movq %rax, 0x20(%rsp)
jmp 0x265b2
movq $-0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x265b2
movq 0x20(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x78(%rsp), %rax
cmpl $-0x1, 0x4c(%rax)
jne 0x26607
movq 0x78(%rsp), %rax
cmpq $-0x1, 0x20(%rax)
je 0x265f0
movq 0x78(%rsp), %rax
movq 0x20(%rax), %rax
movl $0x5, %ecx
xorl %edx, %edx
divq %rcx
movl %eax, 0x1c(%rsp)
jmp 0x265fb
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x1c(%rsp)
jmp 0x265fb
movl 0x1c(%rsp), %ecx
movq 0x78(%rsp), %rax
movl %ecx, 0x4c(%rax)
movq 0x78(%rsp), %rax
cmpl $0x4, 0x4c(%rax)
jae 0x2661e
movq 0x78(%rsp), %rax
movl $0x4, 0x4c(%rax)
movq 0x78(%rsp), %rax
cmpl $-0x1, 0x48(%rax)
jne 0x2671a
movq 0x78(%rsp), %rax
movq (%rax), %rdi
callq 0xb0f00
movq %rax, %rdi
callq 0x7e8c0
movl %eax, 0x44(%rsp)
movl 0x44(%rsp), %eax
cvtsi2sd %rax, %xmm1
movsd 0x4f2f79(%rip), %xmm0   # 0x5195d0
callq 0xecb10
callq 0xec8b0
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movl %eax, 0x34(%rsp)
movq 0x38(%rsp), %rax
movl 0x34(%rsp), %ecx
cmpq %rcx, %rax
jne 0x266b1
cmpq $0x1, 0x38(%rsp)
setl %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, 0x34(%rsp)
setb %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x266b1
movl 0x34(%rsp), %ecx
movq 0x78(%rsp), %rax
movl %ecx, 0x48(%rax)
xorl %eax, %eax
movl %eax, 0x18(%rsp)
jmp 0x266bc
movl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x266bc
movl 0x18(%rsp), %eax
movl %eax, 0x30(%rsp)
cmpl $0x0, 0x30(%rsp)
je 0x266f9
movq 0x6158ce(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4f1949(%rip), %rsi    # 0x518025
leaq 0x4f2ef5(%rip), %rdx    # 0x5195d8
movl $0x149, %ecx            # imm = 0x149
movb $0x0, %al
callq 0x199f0
movl $0x1, %edi
callq 0x19890
jmp 0x266fb
movq 0x70(%rsp), %rdi
movl 0x44(%rsp), %edx
movq 0x78(%rsp), %rax
movl 0x48(%rax), %ecx
leaq 0x4f3714(%rip), %rsi    # 0x519e27
movb $0x0, %al
callq 0xe7cd0
movq 0x78(%rsp), %rax
cmpl $-0x1, 0x4c(%rax)
jne 0x26736
movq 0x78(%rsp), %rax
imull $0x5, 0x48(%rax), %ecx
movq 0x78(%rsp), %rax
movl %ecx, 0x4c(%rax)
movq 0x78(%rsp), %rax
cmpq $-0x1, 0x20(%rax)
jne 0x26757
movq 0x78(%rsp), %rax
movl 0x4c(%rax), %eax
imulq $0x3, %rax, %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x78(%rsp), %rax
cmpq $-0x1, 0x38(%rax)
jne 0x26776
movq 0x78(%rsp), %rax
imulq $0x3, 0x20(%rax), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x38(%rax)
jmp 0x26778
cmpl $0x0, 0x5c(%rsp)
jne 0x267bf
movq 0x78(%rsp), %rax
movl 0x4c(%rax), %eax
movq 0x78(%rsp), %rcx
cmpl 0x48(%rcx), %eax
ja 0x267bf
movq 0x80(%rsp), %rdi
movq 0x78(%rsp), %rax
movl 0x4c(%rax), %edx
movq 0x78(%rsp), %rax
movl 0x48(%rax), %ecx
leaq 0x4f3686(%rip), %rsi    # 0x519e36
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0x5c(%rsp)
jne 0x2680b
movq 0x78(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x78(%rsp), %rcx
movl 0x4c(%rcx), %ecx
cmpq %rcx, %rax
jae 0x2680b
movq 0x80(%rsp), %rdi
movq 0x78(%rsp), %rax
movq 0x20(%rax), %rdx
movq 0x78(%rsp), %rax
movl 0x4c(%rax), %ecx
leaq 0x4f366a(%rip), %rsi    # 0x519e66
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0x5c(%rsp)
jne 0x26856
movq 0x78(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x78(%rsp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x26856
movq 0x80(%rsp), %rdi
movq 0x78(%rsp), %rax
movq 0x38(%rax), %rdx
movq 0x78(%rsp), %rax
movq 0x20(%rax), %rcx
leaq 0x4f3655(%rip), %rsi    # 0x519e9c
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0x5c(%rsp)
jne 0x269e1
cmpl $0x0, 0x5c(%rsp)
jne 0x268d0
movq 0x78(%rsp), %rax
movq 0x38(%rax), %rdi
movq 0x78(%rsp), %rax
movq 0x20(%rax), %rsi
movq 0x78(%rsp), %rax
movq 0x40(%rax), %rdx
movq 0x78(%rsp), %rcx
addq $0x10, %rcx
movq 0x78(%rsp), %rax
movl 0x48(%rax), %r8d
movq 0x78(%rsp), %rax
movl 0x4c(%rax), %r9d
movq 0x70(%rsp), %r10
movq 0x80(%rsp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x142ff0
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
jne 0x268ce
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
jmp 0x268d0
cmpl $0x0, 0x5c(%rsp)
jne 0x269df
movq 0x78(%rsp), %rax
cmpq $-0x1, 0x28(%rax)
jne 0x268f3
movq 0x28(%rsp), %rdi
callq 0x144ec0
jmp 0x26920
movq 0x78(%rsp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x2690b
movq 0x28(%rsp), %rdi
callq 0x144e50
jmp 0x2691e
movq 0x28(%rsp), %rdi
movq 0x78(%rsp), %rax
movq 0x28(%rax), %rsi
callq 0x144dd0
jmp 0x26920
movq 0x28(%rsp), %rdi
movq 0x78(%rsp), %rax
movq 0x30(%rax), %rsi
callq 0x144f90
movq 0x78(%rsp), %rax
testb $0x1, 0x59(%rax)
je 0x26948
movq 0x28(%rsp), %rdi
callq 0x144f30
movq 0x78(%rsp), %rax
testb $0x1, 0x56(%rax)
je 0x2695d
movq 0x28(%rsp), %rdi
callq 0x143cd0
movq 0x78(%rsp), %rax
testb $0x1, 0x54(%rax)
jne 0x26972
movq 0x28(%rsp), %rdi
callq 0x144d20
movq 0x78(%rsp), %rax
testb $0x1, 0x55(%rax)
je 0x26987
movq 0x28(%rsp), %rdi
callq 0x144d60
movq 0x78(%rsp), %rax
cmpl $-0x1, 0x50(%rax)
je 0x269a4
movq 0x28(%rsp), %rdi
movq 0x78(%rsp), %rax
movl 0x50(%rax), %esi
callq 0x143c60
movq 0x28(%rsp), %rdi
movq 0x78(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x78(%rsp), %rax
movq (%rax), %rdx
movq 0x70(%rsp), %rcx
movq 0x68(%rsp), %r8
movq 0x80(%rsp), %r9
callq 0x145160
movl %eax, 0x5c(%rsp)
movq 0x28(%rsp), %rdi
callq 0x145040
jmp 0x269e1
movq 0x70(%rsp), %rdi
callq 0xe7ed0
movq 0x68(%rsp), %rdi
callq 0xe7ed0
movq 0x78(%rsp), %rax
testb $0x1, 0x58(%rax)
je 0x26a0a
movq 0x60(%rsp), %rdi
callq 0xd9390
movl 0x5c(%rsp), %eax
addq $0xa8, %rsp
retq
nopw %cs:(%rax,%rax)