// File: /workspace/github_c_makefile_star2_O3/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 0xa5c2e
movq %rbx, %rdi
callq 0xfcc32
testb %al, %al
jne 0xa5e17
movq %r14, 0x8(%rsp)
testq %r14, %r14
je 0xa5e12
callq 0xef0cd
movq %rax, %r12
movslq %ebp, %r15
movq (%r13,%r15,8), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xef129
movq %rax, %r14
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0xa5df1
movq 0x8(%rsp), %rax
cmpb $0x0, 0x10(%rax)
je 0xa5d03
movq %r14, %rdi
callq 0xec8c4
testb %al, %al
je 0xa5ddb
movq %r14, %rdi
movq %rbx, %rsi
callq 0xec893
testq %rax, %rax
je 0xa5df1
movq %rax, %rbx
movq %r12, (%rsp)
movq %r14, %rdi
callq 0xe7bac
testq %rax, %rax
movq 0x8(%rsp), %r15
je 0xa5cf0
leaq 0x2a61ca(%rip), %r12    # 0x34be85
xorl %r13d, %r13d
movq 0x8(%r15), %rbp
movq %rbx, %rdi
movq %r13, %rsi
callq 0x10702c
movq %rbp, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xfee51
incq %r13
movq %r14, %rdi
callq 0xe7bac
cmpq %rax, %r13
jb 0xa5cbe
movq %rbx, %rdi
callq 0x106f84
xorl %ebp, %ebp
movq (%rsp), %r12
jmp 0xa5df1
movq %r14, %rdi
callq 0xe7bac
testq %rax, %rax
je 0xa5dd7
movq %r12, (%rsp)
xorl %ebx, %ebx
movq %r14, 0x10(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
callq 0xeb9d2
movq %rax, %r12
movq %r14, %rdi
movq %rbx, %rsi
callq 0xeb6ee
movq %rax, %rbp
leaq (%r12,%rax), %r15
decq %r15
movq %r12, %rdi
leaq 0x2a6056(%rip), %r14    # 0x34bda2
movq %r14, %rsi
movl $0x73, %edx
callq 0x104226
movq %rax, %r13
movq 0x10(%rsp), %rdi
movq %rax, %rsi
movq %rbp, %rdx
movq %r15, %rcx
callq 0xe92be
movq %r13, %rdi
movq %r12, %rsi
callq 0x1068d0
movq %rax, %r15
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x2a60f8(%rip), %rsi    # 0x34be85
movq %rbx, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0xfee51
movq %r13, %rdi
movq %r14, %rsi
movl $0x77, %edx
callq 0x1045eb
movq %r15, %rdi
movq %r14, %rsi
movq 0x10(%rsp), %r14
movl $0x78, %edx
callq 0x1045eb
incq %rbx
movq %r14, %rdi
callq 0xe7bac
cmpq %rax, %rbx
jb 0xa5d1f
movq (%rsp), %r12
xorl %ebp, %ebp
jmp 0xa5df1
movq (%r13,%r15,8), %rdx
leaq 0x2a605b(%rip), %rsi    # 0x34be42
movq %rbx, %rdi
xorl %eax, %eax
callq 0xfcb67
movq %r14, %rdi
callq 0xea375
movq %r12, %rdi
callq 0xefbe3
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1a589
callq 0x1a552