// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/tools/gt_encseq_md5.c
// Function: gt_encseq_md5_runner
static int gt_encseq_md5_runner(GT_UNUSED int argc, const char **argv,
                           int parsed_args, void *tool_arguments,
                           GtError *err)
{
  GtEncseqInfoArguments *arguments = tool_arguments;
  int had_err = 0;
  GtEncseqLoader *encseq_loader;
  GtEncseq *encseq;
  gt_error_check(err);
  gt_assert(arguments);

  encseq_loader = gt_encseq_loader_new();
  if (!(encseq = gt_encseq_loader_load(encseq_loader,
                                       argv[parsed_args], err)))
    had_err = -1;

  if (!had_err) {
    GtUword i;

    if (arguments->fromindex) {
      GtMD5Tab *tab;

      if (!gt_encseq_has_md5_support(encseq)) {
        gt_error_set(err, "encoded sequence given by indexname \"%s\" does not "
                          "have MD5 support", argv[parsed_args]);
        had_err = -1;
      }
      if (!had_err) {
        tab = gt_encseq_get_md5_tab(encseq, err);
        if (tab) {
          for (i = 0; i < gt_encseq_num_of_sequences(encseq); i++) {
            gt_file_xprintf(arguments->outfp,
                            ""GT_WU": %s\n", i, gt_md5_tab_get(tab, i));
          }
          gt_md5_tab_delete(tab);
        } else had_err = -1;
      }
    } else {
      char *seq,
           *md5str;
      for (i = 0; i < gt_encseq_num_of_sequences(encseq); i++) {
        GtUword len, start, end;
        len = gt_encseq_seqlength(encseq, i);
        start = gt_encseq_seqstartpos(encseq, i);
        end = len + start -1;
        seq = gt_malloc(len * sizeof (char));
        gt_encseq_extract_decoded(encseq, seq, start, end);
        md5str = gt_md5_fingerprint(seq, len);
        gt_file_xprintf(arguments->outfp, ""GT_WU": %s\n", i, md5str);
        gt_free(seq);
        gt_free(md5str);
      }
    }
  }
  gt_encseq_delete(encseq);
  gt_encseq_loader_delete(encseq_loader);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %rbx
movq %rcx, 0x10(%rsp)
movl %edx, %ebp
movq %rsi, %r12
testq %r8, %r8
je 0x27ad4
movq %rbx, %rdi
callq 0x89eb7
testb %al, %al
jne 0x27cca
cmpq $0x0, 0x10(%rsp)
je 0x27ca0
callq 0x791cd
movslq %ebp, %r14
movq (%r12,%r14,8), %rsi
movq %rax, 0x20(%rsp)
movq %rax, %rdi
movq %rbx, %rdx
callq 0x7921d
movq %rax, %r15
pushq $-0x1
popq %rcx
testq %rax, %rax
je 0x27b85
movq 0x10(%rsp), %rax
cmpb $0x0, 0x10(%rax)
je 0x27b8f
movq %rcx, 0x8(%rsp)
movq %r15, %rdi
callq 0x76655
testb %al, %al
je 0x27c52
movq %r15, %rdi
movq %rbx, %rsi
callq 0x765c8
testq %rax, %rax
je 0x27c7a
movq %rax, %rbx
leaq 0x2c4340(%rip), %r12    # 0x2ebe85
xorl %r13d, %r13d
movq %r15, %rdi
callq 0x705a1
cmpq %rax, %r13
jae 0x27c69
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rbp
movq %rbx, %rdi
movq %r13, %rsi
callq 0x971ea
movq %rbp, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x8d432
incq %r13
jmp 0x27b48
movq %rcx, 0x8(%rsp)
jmp 0x27c7a
movq $0x0, 0x8(%rsp)
xorl %ebx, %ebx
movq %r15, 0x18(%rsp)
movq %r15, %rdi
callq 0x705a1
cmpq %rax, %rbx
jae 0x27c7a
movq %r15, %rdi
movq %rbx, %rsi
callq 0x75173
movq %rax, %r12
movq %r15, %rdi
movq %rbx, %rsi
callq 0x74d9c
movq %rax, %rbp
leaq (%r12,%rax), %r14
decq %r14
movq %r12, %rdi
leaq 0x2c41c5(%rip), %r15    # 0x2ebda2
movq %r15, %rsi
pushq $0x73
popq %rdx
callq 0x93160
movq %rax, %r13
movq 0x18(%rsp), %rdi
movq %rax, %rsi
movq %rbp, %rdx
movq %r14, %rcx
callq 0x7239d
movq %r13, %rdi
movq %r12, %rsi
callq 0x96924
movq %rax, %r14
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x2c4269(%rip), %rsi    # 0x2ebe85
movq %rbx, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x8d432
movq %r13, %rdi
movq %r15, %rsi
pushq $0x77
popq %rdx
callq 0x936f9
movq %r14, %rdi
movq %r15, %rsi
movq 0x18(%rsp), %r15
pushq $0x78
popq %rdx
callq 0x936f9
incq %rbx
jmp 0x27b9f
movq (%r12,%r14,8), %rdx
leaq 0x2c41e5(%rip), %rsi    # 0x2ebe42
movq %rbx, %rdi
xorl %eax, %eax
callq 0x89dbb
jmp 0x27c7a
movq %rbx, %rdi
callq 0x9714b
movq $0x0, 0x8(%rsp)
movq %r15, %rdi
callq 0x735fd
movq 0x20(%rsp), %rdi
callq 0x79f01
movq 0x8(%rsp), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x4102c1(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2bd362(%rip), %rsi    # 0x2e5013
leaq 0x32099b(%rip), %rdx    # 0x348653
leaq 0x2c416e(%rip), %rcx    # 0x2ebe2d
leaq 0x2c40dc(%rip), %r8     # 0x2ebda2
pushq $0x4f
jmp 0x27cf2
movq 0x410297(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2bd338(%rip), %rsi    # 0x2e5013
leaq 0x2bd4dd(%rip), %rdx    # 0x2e51bf
leaq 0x2c4144(%rip), %rcx    # 0x2ebe2d
leaq 0x2c40b2(%rip), %r8     # 0x2ebda2
pushq $0x4e
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390