// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/tools/gt_genomediff.c
// Function: gt_genomediff_runner
static int gt_genomediff_runner(int argc, const char **argv,
                                int parsed_args, void *tool_arguments,
                                GtError *err)
{
  bool mirrored = false;
  int had_err = 0,
      i;
  GtEncseq              *encseq = NULL;
  GtGenomediffArguments *arguments = tool_arguments;
  GtLogger              *logger;
  GtShuUnitFileInfo     *unit_info = NULL;
  GtTimer               *timer = NULL;

  gt_error_check(err);
  gt_assert(arguments);

  logger = gt_logger_new(arguments->verbose,
                         GT_LOGGER_DEFLT_PREFIX,
                         stdout);
  gt_assert(logger);

  for (i = parsed_args; i < argc; i++) {
    gt_str_array_add_cstr(arguments->filenames, argv[i]);
  }

  if (gt_showtime_enabled()) {
    timer = gt_timer_new_with_progress_description("start");
    gt_timer_start(timer);
    gt_assert(timer);
  }

  if (arguments->with_units) {
    gt_logger_log(logger, "unitfile option set, filename is %s\n",
                  gt_str_get(arguments->unitfile));
  }

  if (timer != NULL)
    gt_timer_show_progress(timer, "start shu search", stdout);

  if (gt_str_array_size(arguments->filenames) > 1UL) {
    GtEncseqEncoder *ee = gt_encseq_encoder_new();
    gt_encseq_encoder_set_timer(ee, timer);
    gt_encseq_encoder_set_logger(ee, logger);
    /* kr only makes sense for dna, so we can check this already with ee */
    gt_encseq_encoder_set_input_dna(ee);
    had_err = gt_encseq_encoder_encode(ee, arguments->filenames,
                                       gt_str_get(arguments->indexname), err);
    gt_encseq_encoder_delete(ee);
  }
  else {
    gt_str_append_str(arguments->indexname,
                      gt_str_array_get_str(arguments->filenames, 0));
    if (arguments->with_esa || arguments->with_pck) {
      GtStr *current_line = gt_str_new();
      FILE *prj_fp;
      const char *buffer;
      char **elements = NULL;

      prj_fp = gt_fa_fopen_with_suffix(gt_str_get(arguments->indexname),
                                       GT_PROJECTFILESUFFIX,"rb",err);
      if (prj_fp == NULL)
        had_err = -1;
      while (!had_err && gt_str_read_next_line(current_line, prj_fp) != EOF) {
        buffer = gt_str_get(current_line);
        if (elements != NULL) {
          gt_free(elements[0]);
          gt_free(elements[1]);
        }
        gt_free(elements);
        elements = gt_cstr_split(buffer, '=');
        gt_log_log("%s", elements[0]);
        if (strcmp("mirrored", elements[0]) == 0) {
          gt_log_log("%s", elements[1]);
          if (strcmp("1", elements[1]) == 0) {
            mirrored = true;
            gt_log_log("sequences are treated as mirrored");
          }
        }
        gt_str_reset(current_line);
      }
      gt_str_delete(current_line);
      if (elements != NULL) {
        gt_free(elements[0]);
        gt_free(elements[1]);
      }
      gt_free(elements);
      gt_fa_xfclose(prj_fp);
    }
  }

  if (!had_err) {
    GtEncseqLoader *el = gt_encseq_loader_new_from_options(arguments->loadopts,
                                                           err);
    if (mirrored)
      gt_encseq_loader_mirror(el);
    encseq =
      gt_encseq_loader_load(el, gt_str_get(arguments->indexname), err);
    gt_encseq_loader_delete(el);
  }
  if (encseq == NULL)
    had_err = -1;
  if (!had_err) {
    unit_info = gt_shu_unit_info_new(encseq);
    if (arguments->with_units)
      had_err = gt_shu_unit_file_info_read(arguments->unitfile, unit_info,
                                           logger, err);
  }

  if (!had_err) {
    uint64_t **shusums = NULL;
    if (arguments->with_esa || arguments->with_pck) {
      shusums = gt_genomediff_shulen_sum(arguments, unit_info,
                                         logger, timer, err);
      if (shusums == NULL)
        had_err = -1;
    }
    else {
      const bool doesa = true;
      GenomediffInfo gd_info;
      Suffixeratoroptions sopts;
      sopts.beverbose = arguments->verbose;
      sopts.indexname = arguments->indexname;
      sopts.db = NULL;
      sopts.encopts = NULL;
      sopts.genomediff = true;
      sopts.inputindex = arguments->indexname;
      sopts.loadopts = arguments->loadopts;
      sopts.showprogress = false;
      sopts.idxopts = arguments->idxopts;

      gt_assert(unit_info != NULL);
      gt_array2dim_calloc(shusums, unit_info->num_of_genomes,
                          unit_info->num_of_genomes);
      gd_info.shulensums = shusums;
      gd_info.unit_info = unit_info;
      had_err = gt_runsuffixerator(doesa, &sopts, &gd_info, logger, err);
    }
    if (!had_err && shusums != NULL) {
      had_err = gt_genomediff_kr_calc(shusums, arguments, unit_info,
                                      arguments->with_pck, logger, timer, err);
      gt_array2dim_delete(shusums);
    }
  }

  if (timer != NULL) {
    gt_timer_show_progress_final(timer, stdout);
    gt_timer_delete(timer);
  }
  gt_logger_delete(logger);
  gt_encseq_delete(encseq);
  gt_shu_unit_info_delete(unit_info);

  return had_err;
}

// Assembly:
subq $0x128, %rsp            # imm = 0x128
movl %edi, 0x124(%rsp)
movq %rsi, 0x118(%rsp)
movl %edx, 0x114(%rsp)
movq %rcx, 0x108(%rsp)
movq %r8, 0x100(%rsp)
movb $0x0, 0xff(%rsp)
movl $0x0, 0xf8(%rsp)
movq $0x0, 0xe8(%rsp)
movq 0x108(%rsp), %rax
movq %rax, 0xe0(%rsp)
movq $0x0, 0xd0(%rsp)
movq $0x0, 0xc8(%rsp)
cmpq $0x0, 0x100(%rsp)
je 0x3a57a
movq 0x100(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x3a542
jmp 0x3a57a
movq 0x601a57(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4dbac0(%rip), %rsi    # 0x516013
leaq 0x4dbc65(%rip), %rdx    # 0x5161bf
leaq 0x4e443a(%rip), %rcx    # 0x51e99b
leaq 0x4e409e(%rip), %r8     # 0x51e606
movl $0xff, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x3a57c
jmp 0x3a57e
cmpq $0x0, 0xe0(%rsp)
jne 0x3a5c1
movq 0x601a10(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4dba79(%rip), %rsi    # 0x516013
leaq 0x5405be(%rip), %rdx    # 0x57ab5f
leaq 0x4e43f3(%rip), %rcx    # 0x51e99b
leaq 0x4e4057(%rip), %r8     # 0x51e606
movl $0x100, %r9d            # imm = 0x100
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x3a5c3
movq 0xe0(%rsp), %rax
movb 0x1(%rax), %al
movq 0x601963(%rip), %rcx    # 0x63bf38
movq (%rcx), %rdx
leaq 0x4dd30d(%rip), %rsi    # 0x5178ec
andb $0x1, %al
movzbl %al, %edi
callq 0xe7870
movq %rax, 0xd8(%rsp)
cmpq $0x0, 0xd8(%rsp)
jne 0x3a634
movq 0x60199d(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4dba06(%rip), %rsi    # 0x516013
leaq 0x4fc787(%rip), %rdx    # 0x536d9b
leaq 0x4e4380(%rip), %rcx    # 0x51e99b
leaq 0x4e3fe4(%rip), %r8     # 0x51e606
movl $0x105, %r9d            # imm = 0x105
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x3a636
movl 0x114(%rsp), %eax
movl %eax, 0xf4(%rsp)
movl 0xf4(%rsp), %eax
cmpl 0x124(%rsp), %eax
jge 0x3a68c
movq 0xe0(%rsp), %rax
movq 0x68(%rax), %rdi
movq 0x118(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x11f720
movl 0xf4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf4(%rsp)
jmp 0x3a644
callq 0x11aa90
testb $0x1, %al
jne 0x3a697
jmp 0x3a6ff
leaq 0x53a0b3(%rip), %rdi    # 0x574751
callq 0x1213a0
movq %rax, 0xc8(%rsp)
movq 0xc8(%rsp), %rdi
callq 0x1213f0
cmpq $0x0, 0xc8(%rsp)
jne 0x3a6fb
movq 0x6018d6(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4db93f(%rip), %rsi    # 0x516013
leaq 0x4fbe71(%rip), %rdx    # 0x53654c
leaq 0x4e42b9(%rip), %rcx    # 0x51e99b
leaq 0x4e3f1d(%rip), %r8     # 0x51e606
movl $0x10e, %r9d            # imm = 0x10E
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x3a6fd
jmp 0x3a6ff
movq 0xe0(%rsp), %rax
testb $0x1, 0x4(%rax)
je 0x3a741
movq 0xd8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0xe0(%rsp), %rax
movq 0x60(%rax), %rdi
callq 0x11dee0
movq 0x30(%rsp), %rdi
movq %rax, %rdx
leaq 0x4e3dc6(%rip), %rsi    # 0x51e500
movb $0x0, %al
callq 0xe7cd0
cmpq $0x0, 0xc8(%rsp)
je 0x3a76a
movq 0xc8(%rsp), %rdi
movq 0x6017dd(%rip), %rax    # 0x63bf38
movq (%rax), %rdx
leaq 0x4e424b(%rip), %rsi    # 0x51e9b0
callq 0x121930
movq 0xe0(%rsp), %rax
movq 0x68(%rax), %rdi
callq 0x11fcc0
cmpq $0x1, %rax
jbe 0x3a82b
callq 0xb8090
movq %rax, 0xc0(%rsp)
movq 0xc0(%rsp), %rdi
movq 0xc8(%rsp), %rsi
callq 0xb8bb0
movq 0xc0(%rsp), %rdi
movq 0xd8(%rsp), %rsi
callq 0xb92b0
movq 0xc0(%rsp), %rdi
callq 0xb8760
movq 0xc0(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0xe0(%rsp), %rax
movq 0x68(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0xe0(%rsp), %rax
movq 0x50(%rax), %rdi
callq 0x11dee0
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %rax, %rdx
movq 0x100(%rsp), %rcx
callq 0xb9320
movl %eax, 0xf8(%rsp)
movq 0xc0(%rsp), %rdi
callq 0xb8b70
jmp 0x3aaca
movq 0xe0(%rsp), %rax
movq 0x50(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0xe0(%rsp), %rax
movq 0x68(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x11f960
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x11d750
movq 0xe0(%rsp), %rax
testb $0x1, 0x2(%rax)
jne 0x3a87e
movq 0xe0(%rsp), %rax
testb $0x1, 0x3(%rax)
je 0x3aac8
callq 0x11d4a0
movq %rax, 0xb8(%rsp)
movq $0x0, 0xa0(%rsp)
movq 0xe0(%rsp), %rax
movq 0x50(%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
movq 0x100(%rsp), %r9
leaq 0x4e4107(%rip), %rsi    # 0x51e9c1
leaq 0x53d624(%rip), %rdx    # 0x577ee5
leaq 0x4e3d3e(%rip), %rcx    # 0x51e606
movl $0x12d, %r8d            # imm = 0x12D
callq 0xd92c0
movq %rax, 0xb0(%rsp)
cmpq $0x0, 0xb0(%rsp)
jne 0x3a8f1
movl $0xffffffff, 0xf8(%rsp) # imm = 0xFFFFFFFF
jmp 0x3a8f3
xorl %eax, %eax
cmpl $0x0, 0xf8(%rsp)
movb %al, 0x17(%rsp)
jne 0x3a922
movq 0xb8(%rsp), %rdi
movq 0xb0(%rsp), %rsi
callq 0x11e3a0
cmpl $-0x1, %eax
setne %al
movb %al, 0x17(%rsp)
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x3a92f
jmp 0x3aa51
movq 0xb8(%rsp), %rdi
callq 0x11dee0
movq %rax, 0xa8(%rsp)
cmpq $0x0, 0xa0(%rsp)
je 0x3a988
movq 0xa0(%rsp), %rax
movq (%rax), %rdi
leaq 0x4e3ca5(%rip), %rsi    # 0x51e606
movl $0x133, %edx            # imm = 0x133
callq 0xe88c0
movq 0xa0(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x4e3c88(%rip), %rsi    # 0x51e606
movl $0x134, %edx            # imm = 0x134
callq 0xe88c0
movq 0xa0(%rsp), %rdi
leaq 0x4e3c6f(%rip), %rsi    # 0x51e606
movl $0x136, %edx            # imm = 0x136
callq 0xe88c0
movq 0xa8(%rsp), %rdi
movl $0x3d, %esi
callq 0xa2b40
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rax
movq (%rax), %rsi
leaq 0x561654(%rip), %rdi    # 0x59c021
movb $0x0, %al
callq 0xe7740
movq 0xa0(%rsp), %rax
movq (%rax), %rsi
leaq 0x4e3ff9(%rip), %rdi    # 0x51e9df
callq 0x19980
cmpl $0x0, %eax
jne 0x3aa3f
movq 0xa0(%rsp), %rax
movq 0x8(%rax), %rsi
leaq 0x56161e(%rip), %rdi    # 0x59c021
movb $0x0, %al
callq 0xe7740
movq 0xa0(%rsp), %rax
movq 0x8(%rax), %rsi
leaq 0x505ced(%rip), %rdi    # 0x54070a
callq 0x19980
cmpl $0x0, %eax
jne 0x3aa3d
movb $0x1, 0xff(%rsp)
leaq 0x4e3f90(%rip), %rdi    # 0x51e9c6
movb $0x0, %al
callq 0xe7740
jmp 0x3aa3f
movq 0xb8(%rsp), %rdi
callq 0x11e110
jmp 0x3a8f3
movq 0xb8(%rsp), %rdi
callq 0x11f560
cmpq $0x0, 0xa0(%rsp)
je 0x3aaa2
movq 0xa0(%rsp), %rax
movq (%rax), %rdi
leaq 0x4e3b8b(%rip), %rsi    # 0x51e606
movl $0x144, %edx            # imm = 0x144
callq 0xe88c0
movq 0xa0(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x4e3b6e(%rip), %rsi    # 0x51e606
movl $0x145, %edx            # imm = 0x145
callq 0xe88c0
movq 0xa0(%rsp), %rdi
leaq 0x4e3b55(%rip), %rsi    # 0x51e606
movl $0x147, %edx            # imm = 0x147
callq 0xe88c0
movq 0xb0(%rsp), %rdi
callq 0xd9570
jmp 0x3aaca
cmpl $0x0, 0xf8(%rsp)
jne 0x3ab58
movq 0xe0(%rsp), %rax
movq 0x38(%rax), %rdi
movq 0x100(%rsp), %rsi
callq 0xba630
movq %rax, 0x98(%rsp)
testb $0x1, 0xff(%rsp)
je 0x3ab10
movq 0x98(%rsp), %rdi
callq 0xba710
movq 0x98(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0xe0(%rsp), %rax
movq 0x50(%rax), %rdi
callq 0x11dee0
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movq 0x100(%rsp), %rdx
callq 0xb7aa0
movq %rax, 0xe8(%rsp)
movq 0x98(%rsp), %rdi
callq 0xb7e50
cmpq $0x0, 0xe8(%rsp)
jne 0x3ab6e
movl $0xffffffff, 0xf8(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0xf8(%rsp)
jne 0x3abcd
movq 0xe8(%rsp), %rdi
callq 0x2ee1e0
movq %rax, 0xd0(%rsp)
movq 0xe0(%rsp), %rax
testb $0x1, 0x4(%rax)
je 0x3abcb
movq 0xe0(%rsp), %rax
movq 0x60(%rax), %rdi
movq 0xd0(%rsp), %rsi
movq 0xd8(%rsp), %rdx
movq 0x100(%rsp), %rcx
callq 0x2edd50
movl %eax, 0xf8(%rsp)
jmp 0x3abcd
cmpl $0x0, 0xf8(%rsp)
jne 0x3aec4
movq $0x0, 0x90(%rsp)
movq 0xe0(%rsp), %rax
testb $0x1, 0x2(%rax)
jne 0x3ac03
movq 0xe0(%rsp), %rax
testb $0x1, 0x3(%rax)
je 0x3ac53
movq 0xe0(%rsp), %rdi
movq 0xd0(%rsp), %rsi
movq 0xd8(%rsp), %rdx
movq 0xc8(%rsp), %rcx
movq 0x100(%rsp), %r8
callq 0x2ec180
movq %rax, 0x90(%rsp)
cmpq $0x0, 0x90(%rsp)
jne 0x3ac4e
movl $0xffffffff, 0xf8(%rsp) # imm = 0xFFFFFFFF
jmp 0x3ae1f
movb $0x1, 0x8f(%rsp)
movq 0xe0(%rsp), %rax
movb 0x1(%rax), %al
andb $0x1, %al
movb %al, 0x40(%rsp)
movq 0xe0(%rsp), %rax
movq 0x50(%rax), %rax
movq %rax, 0x60(%rsp)
movq $0x0, 0x70(%rsp)
movq $0x0, 0x48(%rsp)
movb $0x1, 0x42(%rsp)
movq 0xe0(%rsp), %rax
movq 0x50(%rax), %rax
movq %rax, 0x68(%rsp)
movq 0xe0(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, 0x50(%rsp)
movb $0x0, 0x41(%rsp)
movq 0xe0(%rsp), %rax
movq 0x40(%rax), %rax
movq %rax, 0x58(%rsp)
cmpq $0x0, 0xd0(%rsp)
jne 0x3ad0f
movq 0x6012c2(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4db32b(%rip), %rsi    # 0x516013
leaq 0x4e384c(%rip), %rdx    # 0x51e53b
leaq 0x4e3ca5(%rip), %rcx    # 0x51e99b
leaq 0x4e3909(%rip), %r8     # 0x51e606
movl $0x174, %r9d            # imm = 0x174
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x3ad11
movq 0xd0(%rsp), %rax
movq (%rax), %rdi
shlq $0x3, %rdi
leaq 0x4e38df(%rip), %rsi    # 0x51e606
movl $0x176, %edx            # imm = 0x176
callq 0xe80f0
movq %rax, 0x90(%rsp)
movq 0xd0(%rsp), %rax
movq (%rax), %rdi
movq 0xd0(%rsp), %rax
imulq (%rax), %rdi
movl $0x8, %esi
leaq 0x4e38aa(%rip), %rdx    # 0x51e606
movl $0x176, %ecx            # imm = 0x176
callq 0xe83c0
movq %rax, %rcx
movq 0x90(%rsp), %rax
movq %rcx, (%rax)
movq $0x1, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq 0xd0(%rsp), %rcx
cmpq (%rcx), %rax
jae 0x3add7
movq 0x90(%rsp), %rax
movq 0x38(%rsp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rdx
movq 0xd0(%rsp), %rax
movq (%rax), %rax
shlq $0x3, %rax
addq %rax, %rdx
movq 0x90(%rsp), %rax
movq 0x38(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x38(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
jmp 0x3ad7d
movq 0x90(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0xd0(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0xd8(%rsp), %rcx
movq 0x100(%rsp), %r8
movl $0x1, %edi
leaq 0x40(%rsp), %rsi
leaq 0x78(%rsp), %rdx
callq 0x2cead0
movl %eax, 0xf8(%rsp)
cmpl $0x0, 0xf8(%rsp)
jne 0x3aec2
cmpq $0x0, 0x90(%rsp)
je 0x3aec2
movq 0x90(%rsp), %rdi
movq 0xe0(%rsp), %rsi
movq 0xd0(%rsp), %rdx
movq 0xe0(%rsp), %rax
movb 0x3(%rax), %cl
movq 0xd8(%rsp), %r8
movq 0xc8(%rsp), %r9
movq 0x100(%rsp), %rax
andb $0x1, %cl
movzbl %cl, %ecx
movq %rax, (%rsp)
callq 0x2ed760
movl %eax, 0xf8(%rsp)
movq 0x90(%rsp), %rax
movq (%rax), %rdi
leaq 0x4e3767(%rip), %rsi    # 0x51e606
movl $0x17e, %edx            # imm = 0x17E
callq 0xe88c0
movq 0x90(%rsp), %rdi
leaq 0x4e374e(%rip), %rsi    # 0x51e606
movl $0x17e, %edx            # imm = 0x17E
callq 0xe88c0
jmp 0x3aec4
cmpq $0x0, 0xc8(%rsp)
je 0x3aef3
movq 0xc8(%rsp), %rdi
movq 0x60105a(%rip), %rax    # 0x63bf38
movq (%rax), %rsi
callq 0x121d70
movq 0xc8(%rsp), %rdi
callq 0x121f00
movq 0xd8(%rsp), %rdi
callq 0xe7ed0
movq 0xe8(%rsp), %rdi
callq 0xae070
movq 0xd0(%rsp), %rdi
callq 0x2ee190
movl 0xf8(%rsp), %eax
addq $0x128, %rsp            # imm = 0x128
retq
nopl (%rax)