// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/tools/gt_gdiffcalc.c
// Function: gt_gdiffcalc_runner
static int gt_gdiffcalc_runner(int argc, const char **argv, int parsed_args,
                              void *tool_arguments, GT_UNUSED GtError *err)
{
  GtGenomediffArguments *arguments = tool_arguments;
  int had_err = 0, i;
  GtUword lcounter = 0, zcounter = 0;
  double **shusums = NULL;
  GtEncseq              *encseq = NULL;
  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("load encseq");
    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 (!had_err) {
    GtEncseqLoader *el = gt_encseq_loader_new_from_options(arguments->loadopts,
                                                           err);
    encseq =
      gt_encseq_loader_load(el, gt_str_get(arguments->indexname), err);
    gt_encseq_loader_delete(el);
  }
  if (encseq == NULL)
    had_err = -1;

  if (timer != NULL)
    gt_timer_show_progress(timer, "load units", stdout);

  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 (timer != NULL)
    gt_timer_show_progress(timer, "read table", stdout);

  if (!had_err) {
    GtIO *table_file = NULL;
    GtTokenizer *tokenizer = NULL;
    GtStr *line = NULL;

    gt_assert(unit_info != NULL);
    gt_array2dim_calloc(shusums, unit_info->num_of_genomes,
                        unit_info->num_of_genomes);

    table_file = gt_io_new(gt_str_array_get(arguments->filenames, 0), "r");
    tokenizer = gt_tokenizer_new(table_file);
    line = gt_tokenizer_get_token(tokenizer);
    while (line != NULL && !had_err) {
      char *cline = gt_str_get(line);
      char *elem = strtok(cline, ";");
      zcounter = 0;
      while (elem != NULL && !had_err) {
        if (*elem != '#') {
          if (1 != sscanf(elem, "%lf",
                          &shusums[lcounter][zcounter])) {
            had_err = 1;
            gt_error_set(err, "couldn't scan");
            break;
          }
          gt_logger_log(logger,"wert: %lf", shusums[lcounter][zcounter]);
          zcounter++;
        }
        else {
          gt_logger_log(logger, "name: %s", elem++);
        }
        elem = strtok(NULL, ";");
      }
      gt_tokenizer_next_token(tokenizer);
      gt_str_delete(line);
      line = gt_tokenizer_get_token(tokenizer);
      lcounter++;
      gt_logger_log(logger, "line "GT_WD"", lcounter);
    }
  }
  if (!had_err) {
    GtUword num_of_seq, file_idx, seq_idx, startpos;
    GT_UNUSED GtUword oldpos = 0;

    gt_assert(unit_info != NULL);
    gt_assert(lcounter == zcounter);
    gt_assert(lcounter == unit_info->num_of_genomes);

    num_of_seq = gt_encseq_num_of_sequences(unit_info->encseq);

    for (seq_idx = 0; seq_idx < num_of_seq; seq_idx++) {
      startpos = gt_encseq_seqstartpos(unit_info->encseq, seq_idx);
      file_idx = gt_encseq_filenum(unit_info->encseq, startpos);
      gt_log_log("seq: "GT_WU" starts at: "GT_WU"\n"
                 "belonges to file: "GT_WU" which is part of genome: %s",
                 seq_idx, startpos, file_idx,
                 gt_str_array_get(unit_info->genome_names,
                                  unit_info->map_files[file_idx]));
      gt_assert(oldpos <= startpos);
      oldpos = startpos;
    }
  }
  if (!had_err && shusums != NULL) {
    had_err = gt_genomediff_calculate_div_from_avg(shusums, arguments,
                                                   unit_info,
                                                   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 $0x108, %rsp            # imm = 0x108
movl %edi, 0x104(%rsp)
movq %rsi, 0xf8(%rsp)
movl %edx, 0xf4(%rsp)
movq %rcx, 0xe8(%rsp)
movq %r8, 0xe0(%rsp)
movq 0xe8(%rsp), %rax
movq %rax, 0xd8(%rsp)
movl $0x0, 0xd4(%rsp)
movq $0x0, 0xc8(%rsp)
movq $0x0, 0xc0(%rsp)
movq $0x0, 0xb8(%rsp)
movq $0x0, 0xb0(%rsp)
movq $0x0, 0xa0(%rsp)
movq $0x0, 0x98(%rsp)
cmpq $0x0, 0xe0(%rsp)
je 0x39376
movq 0xe0(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x3933e
jmp 0x39376
movq 0x602c5b(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4dccc4(%rip), %rsi    # 0x516013
leaq 0x4dce69(%rip), %rdx    # 0x5161bf
leaq 0x4e518f(%rip), %rcx    # 0x51e4ec
leaq 0x4e4f04(%rip), %r8     # 0x51e268
movl $0xc2, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x39378
jmp 0x3937a
cmpq $0x0, 0xd8(%rsp)
jne 0x393bd
movq 0x602c14(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4dcc7d(%rip), %rsi    # 0x516013
leaq 0x5417c2(%rip), %rdx    # 0x57ab5f
leaq 0x4e5148(%rip), %rcx    # 0x51e4ec
leaq 0x4e4ebd(%rip), %r8     # 0x51e268
movl $0xc3, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x393bf
movq 0xd8(%rsp), %rax
movb 0x1(%rax), %al
movq 0x602b67(%rip), %rcx    # 0x63bf38
movq (%rcx), %rdx
leaq 0x4de511(%rip), %rsi    # 0x5178ec
andb $0x1, %al
movzbl %al, %edi
callq 0xe7870
movq %rax, 0xa8(%rsp)
cmpq $0x0, 0xa8(%rsp)
jne 0x39430
movq 0x602ba1(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4dcc0a(%rip), %rsi    # 0x516013
leaq 0x4fd98b(%rip), %rdx    # 0x536d9b
leaq 0x4e50d5(%rip), %rcx    # 0x51e4ec
leaq 0x4e4e4a(%rip), %r8     # 0x51e268
movl $0xc8, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x39432
movl 0xf4(%rsp), %eax
movl %eax, 0xd0(%rsp)
movl 0xd0(%rsp), %eax
cmpl 0x104(%rsp), %eax
jge 0x39488
movq 0xd8(%rsp), %rax
movq 0x68(%rax), %rdi
movq 0xf8(%rsp), %rax
movslq 0xd0(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x11f720
movl 0xd0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd0(%rsp)
jmp 0x39440
callq 0x11aa90
testb $0x1, %al
jne 0x39493
jmp 0x394fb
leaq 0x4df43b(%rip), %rdi    # 0x5188d5
callq 0x1213a0
movq %rax, 0x98(%rsp)
movq 0x98(%rsp), %rdi
callq 0x1213f0
cmpq $0x0, 0x98(%rsp)
jne 0x394f7
movq 0x602ada(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4dcb43(%rip), %rsi    # 0x516013
leaq 0x4fd075(%rip), %rdx    # 0x53654c
leaq 0x4e500e(%rip), %rcx    # 0x51e4ec
leaq 0x4e4d83(%rip), %r8     # 0x51e268
movl $0xd1, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x394f9
jmp 0x394fb
movq 0xd8(%rsp), %rax
testb $0x1, 0x4(%rax)
je 0x3953d
movq 0xa8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0xd8(%rsp), %rax
movq 0x60(%rax), %rdi
callq 0x11dee0
movq 0x30(%rsp), %rdi
movq %rax, %rdx
leaq 0x4e4fca(%rip), %rsi    # 0x51e500
movb $0x0, %al
callq 0xe7cd0
cmpl $0x0, 0xd4(%rsp)
jne 0x395b0
movq 0xd8(%rsp), %rax
movq 0x38(%rax), %rdi
movq 0xe0(%rsp), %rsi
callq 0xba630
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0xd8(%rsp), %rax
movq 0x50(%rax), %rdi
callq 0x11dee0
movq 0x28(%rsp), %rdi
movq %rax, %rsi
movq 0xe0(%rsp), %rdx
callq 0xb7aa0
movq %rax, 0xb0(%rsp)
movq 0x90(%rsp), %rdi
callq 0xb7e50
cmpq $0x0, 0xb0(%rsp)
jne 0x395c6
movl $0xffffffff, 0xd4(%rsp) # imm = 0xFFFFFFFF
cmpq $0x0, 0x98(%rsp)
je 0x395ef
movq 0x98(%rsp), %rdi
movq 0x602958(%rip), %rax    # 0x63bf38
movq (%rax), %rdx
leaq 0x4e4f3b(%rip), %rsi    # 0x51e525
callq 0x121930
cmpl $0x0, 0xd4(%rsp)
jne 0x3964e
movq 0xb0(%rsp), %rdi
callq 0x2ee1e0
movq %rax, 0xa0(%rsp)
movq 0xd8(%rsp), %rax
testb $0x1, 0x4(%rax)
je 0x3964c
movq 0xd8(%rsp), %rax
movq 0x60(%rax), %rdi
movq 0xa0(%rsp), %rsi
movq 0xa8(%rsp), %rdx
movq 0xe0(%rsp), %rcx
callq 0x2edd50
movl %eax, 0xd4(%rsp)
jmp 0x3964e
cmpq $0x0, 0x98(%rsp)
je 0x39677
movq 0x98(%rsp), %rdi
movq 0x6028d0(%rip), %rax    # 0x63bf38
movq (%rax), %rdx
leaq 0x4e4ebe(%rip), %rsi    # 0x51e530
callq 0x121930
cmpl $0x0, 0xd4(%rsp)
jne 0x399f5
movq $0x0, 0x88(%rsp)
movq $0x0, 0x80(%rsp)
movq $0x0, 0x78(%rsp)
cmpq $0x0, 0xa0(%rsp)
jne 0x396e9
movq 0x6028e8(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4dc951(%rip), %rsi    # 0x516013
leaq 0x4e4e72(%rip), %rdx    # 0x51e53b
leaq 0x4e4e1c(%rip), %rcx    # 0x51e4ec
leaq 0x4e4b91(%rip), %r8     # 0x51e268
movl $0xf5, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x396eb
movq 0xa0(%rsp), %rax
movq (%rax), %rdi
shlq $0x3, %rdi
leaq 0x4e4b67(%rip), %rsi    # 0x51e268
movl $0xf7, %edx
callq 0xe80f0
movq %rax, 0xb8(%rsp)
movq 0xa0(%rsp), %rax
movq (%rax), %rdi
movq 0xa0(%rsp), %rax
imulq (%rax), %rdi
movl $0x8, %esi
leaq 0x4e4b32(%rip), %rdx    # 0x51e268
movl $0xf7, %ecx
callq 0xe83c0
movq %rax, %rcx
movq 0xb8(%rsp), %rax
movq %rcx, (%rax)
movq $0x1, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq 0xa0(%rsp), %rcx
cmpq (%rcx), %rax
jae 0x397b1
movq 0xb8(%rsp), %rax
movq 0x70(%rsp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rdx
movq 0xa0(%rsp), %rax
movq (%rax), %rax
shlq $0x3, %rax
addq %rax, %rdx
movq 0xb8(%rsp), %rax
movq 0x70(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x70(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x70(%rsp)
jmp 0x39757
movq 0xd8(%rsp), %rax
movq 0x68(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x11f8c0
movq %rax, %rdi
leaq 0x4f280a(%rip), %rsi    # 0x52bfda
callq 0xe6f60
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rdi
callq 0x121f50
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rdi
callq 0x122030
movq %rax, 0x78(%rsp)
xorl %eax, %eax
cmpq $0x0, 0x78(%rsp)
movb %al, 0x27(%rsp)
je 0x39823
cmpl $0x0, 0xd4(%rsp)
setne %al
xorb $-0x1, %al
movb %al, 0x27(%rsp)
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0x39830
jmp 0x399f3
movq 0x78(%rsp), %rdi
callq 0x11dee0
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rdi
leaq 0x562807(%rip), %rsi    # 0x59c052
callq 0x19b40
movq %rax, 0x60(%rsp)
movq $0x0, 0xc0(%rsp)
xorl %eax, %eax
cmpq $0x0, 0x60(%rsp)
movb %al, 0x26(%rsp)
je 0x39880
cmpl $0x0, 0xd4(%rsp)
setne %al
xorb $-0x1, %al
movb %al, 0x26(%rsp)
movb 0x26(%rsp), %al
testb $0x1, %al
jne 0x3988d
jmp 0x39993
movq 0x60(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
je 0x39952
movq 0x60(%rsp), %rdi
movq 0xb8(%rsp), %rax
movq 0xc8(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq 0xc0(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rdx
leaq 0x4e4c94(%rip), %rsi    # 0x51e561
movb $0x0, %al
callq 0x19770
movl %eax, %ecx
movl $0x1, %eax
cmpl %ecx, %eax
je 0x39905
movl $0x1, 0xd4(%rsp)
movq 0xe0(%rsp), %rdi
leaq 0x4e4c54(%rip), %rsi    # 0x51e54d
movb $0x0, %al
callq 0xd88c0
jmp 0x39993
movq 0xa8(%rsp), %rdi
movq 0xb8(%rsp), %rax
movq 0xc8(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0xc0(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x4e4c26(%rip), %rsi    # 0x51e55b
movb $0x1, %al
callq 0xe7cd0
movq 0xc0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xc0(%rsp)
jmp 0x39979
movq 0xa8(%rsp), %rdi
movq 0x60(%rsp), %rdx
movq %rdx, %rax
addq $0x1, %rax
movq %rax, 0x60(%rsp)
leaq 0x575a16(%rip), %rsi    # 0x5af388
movb $0x0, %al
callq 0xe7cd0
xorl %eax, %eax
movl %eax, %edi
leaq 0x5626ce(%rip), %rsi    # 0x59c052
callq 0x19b40
movq %rax, 0x60(%rsp)
jmp 0x39861
movq 0x80(%rsp), %rdi
callq 0x122420
movq 0x78(%rsp), %rdi
callq 0x11f560
movq 0x80(%rsp), %rdi
callq 0x122030
movq %rax, 0x78(%rsp)
movq 0xc8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xc8(%rsp)
movq 0xa8(%rsp), %rdi
movq 0xc8(%rsp), %rdx
leaq 0x4e4b7e(%rip), %rsi    # 0x51e565
movb $0x0, %al
callq 0xe7cd0
jmp 0x39804
jmp 0x399f5
cmpl $0x0, 0xd4(%rsp)
jne 0x39c1e
movq $0x0, 0x38(%rsp)
cmpq $0x0, 0xa0(%rsp)
jne 0x39a4f
movq 0x602582(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4dc5eb(%rip), %rsi    # 0x516013
leaq 0x4e4b0c(%rip), %rdx    # 0x51e53b
leaq 0x4e4ab6(%rip), %rcx    # 0x51e4ec
leaq 0x4e482b(%rip), %r8     # 0x51e268
movl $0x11b, %r9d            # imm = 0x11B
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x39a51
jmp 0x39a53
movq 0xc8(%rsp), %rax
cmpq 0xc0(%rsp), %rax
je 0x39a9d
movq 0x602534(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4dc59d(%rip), %rsi    # 0x516013
leaq 0x4e4af1(%rip), %rdx    # 0x51e56e
leaq 0x4e4a68(%rip), %rcx    # 0x51e4ec
leaq 0x4e47dd(%rip), %r8     # 0x51e268
movl $0x11c, %r9d            # imm = 0x11C
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x39a9f
jmp 0x39aa1
movq 0xc8(%rsp), %rax
movq 0xa0(%rsp), %rcx
cmpq (%rcx), %rax
je 0x39aee
movq 0x6024e3(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4dc54c(%rip), %rsi    # 0x516013
leaq 0x4e4ab5(%rip), %rdx    # 0x51e583
leaq 0x4e4a17(%rip), %rcx    # 0x51e4ec
leaq 0x4e478c(%rip), %r8     # 0x51e268
movl $0x11d, %r9d            # imm = 0x11D
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x39af0
movq 0xa0(%rsp), %rax
movq 0x28(%rax), %rdi
callq 0xa9d50
movq %rax, 0x58(%rsp)
movq $0x0, 0x48(%rsp)
movq 0x48(%rsp), %rax
cmpq 0x58(%rsp), %rax
jae 0x39c1c
movq 0xa0(%rsp), %rax
movq 0x28(%rax), %rdi
movq 0x48(%rsp), %rsi
callq 0xb0530
movq %rax, 0x40(%rsp)
movq 0xa0(%rsp), %rax
movq 0x28(%rax), %rdi
movq 0x40(%rsp), %rsi
callq 0xc2af0
movq %rax, 0x50(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0xa0(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0xa0(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x50(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x11f8c0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq %rax, %r8
leaq 0x4e49f7(%rip), %rdi    # 0x51e5a9
movb $0x0, %al
callq 0xe7740
movq 0x38(%rsp), %rax
cmpq 0x40(%rsp), %rax
jbe 0x39bfd
movq 0x6023d4(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4dc43d(%rip), %rsi    # 0x516013
leaq 0x4e4a16(%rip), %rdx    # 0x51e5f3
leaq 0x4e4908(%rip), %rcx    # 0x51e4ec
leaq 0x4e467d(%rip), %r8     # 0x51e268
movl $0x129, %r9d            # imm = 0x129
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x39bff
movq 0x40(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0x39b0f
jmp 0x39c1e
cmpl $0x0, 0xd4(%rsp)
jne 0x39ca4
cmpq $0x0, 0xb8(%rsp)
je 0x39ca4
movq 0xb8(%rsp), %rdi
movq 0xd8(%rsp), %rsi
movq 0xa0(%rsp), %rdx
movq 0xa8(%rsp), %rcx
movq 0x98(%rsp), %r8
movq 0xe0(%rsp), %r9
callq 0x2ec820
movl %eax, 0xd4(%rsp)
movq 0xb8(%rsp), %rax
movq (%rax), %rdi
leaq 0x4e45e7(%rip), %rsi    # 0x51e268
movl $0x131, %edx            # imm = 0x131
callq 0xe88c0
movq 0xb8(%rsp), %rdi
leaq 0x4e45ce(%rip), %rsi    # 0x51e268
movl $0x131, %edx            # imm = 0x131
callq 0xe88c0
cmpq $0x0, 0x98(%rsp)
je 0x39cd3
movq 0x98(%rsp), %rdi
movq 0x60227a(%rip), %rax    # 0x63bf38
movq (%rax), %rsi
callq 0x121d70
movq 0x98(%rsp), %rdi
callq 0x121f00
movq 0xa8(%rsp), %rdi
callq 0xe7ed0
movq 0xb0(%rsp), %rdi
callq 0xae070
movq 0xa0(%rsp), %rdi
callq 0x2ee190
movl 0xd4(%rsp), %eax
addq $0x108, %rsp            # imm = 0x108
retq
nopl (%rax)