// File: /workspace/github_c_makefile_star2_O1/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 $0x18, %rsp
movq %r8, %rbx
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r13
testq %r8, %r8
je 0xa7f96
movq %rbx, %rdi
callq 0x101a9a
testb %al, %al
jne 0xa817f
movq %r14, 0x8(%rsp)
testq %r14, %r14
je 0xa817a
callq 0xf36ef
movq %rax, %r12
movslq %ebp, %r15
movq (%r13,%r15,8), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xf374b
movq %rax, %r14
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0xa8159
movq 0x8(%rsp), %rax
cmpb $0x0, 0x10(%rax)
je 0xa806b
movq %r14, %rdi
callq 0xf0ec3
testb %al, %al
je 0xa8143
movq %r14, %rdi
movq %rbx, %rsi
callq 0xf0e92
testq %rax, %rax
je 0xa8159
movq %rax, %rbx
movq %r12, (%rsp)
movq %r14, %rdi
callq 0xec1e8
testq %rax, %rax
movq 0x8(%rsp), %r15
je 0xa8058
leaq 0x2ace91(%rip), %r12    # 0x354eb4
xorl %r13d, %r13d
movq 0x8(%r15), %rbp
movq %rbx, %rdi
movq %r13, %rsi
callq 0x10c0bb
movq %rbp, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x103d21
incq %r13
movq %r14, %rdi
callq 0xec1e8
cmpq %rax, %r13
jb 0xa8026
movq %rbx, %rdi
callq 0x10c013
xorl %ebp, %ebp
movq (%rsp), %r12
jmp 0xa8159
movq %r14, %rdi
callq 0xec1e8
testq %rax, %rax
je 0xa813f
movq %r12, (%rsp)
xorl %ebx, %ebx
movq %r14, 0x10(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
callq 0xeffd3
movq %rax, %r12
movq %r14, %rdi
movq %rbx, %rsi
callq 0xefce0
movq %rax, %rbp
leaq (%r12,%rax), %r15
decq %r15
movq %r12, %rdi
leaq 0x2acd1d(%rip), %r14    # 0x354dd1
movq %r14, %rsi
movl $0x73, %edx
callq 0x1092b2
movq %rax, %r13
movq 0x10(%rsp), %rdi
movq %rax, %rsi
movq %rbp, %rdx
movq %r15, %rcx
callq 0xed87b
movq %r13, %rdi
movq %r12, %rsi
callq 0x10b95c
movq %rax, %r15
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x2acdbf(%rip), %rsi    # 0x354eb4
movq %rbx, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x103d21
movq %r13, %rdi
movq %r14, %rsi
movl $0x77, %edx
callq 0x109670
movq %r15, %rdi
movq %r14, %rsi
movq 0x10(%rsp), %r14
movl $0x78, %edx
callq 0x109670
incq %rbx
movq %r14, %rdi
callq 0xec1e8
cmpq %rax, %rbx
jb 0xa8087
movq (%rsp), %r12
xorl %ebp, %ebp
jmp 0xa8159
movq (%r13,%r15,8), %rdx
leaq 0x2acd22(%rip), %rsi    # 0x354e71
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1019cf
movq %r14, %rdi
callq 0xee90c
movq %r12, %rdi
callq 0xf424d
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1a64c
callq 0x1a615