// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/tools/gt_encseq_check.c
// Function: gt_encseq_check_runner
static int gt_encseq_check_runner(GT_UNUSED int argc, const char **argv,
                                  int parsed_args, void *tool_arguments,
                                  GtError *err)
{
  GtEncseqCheckArguments *arguments = tool_arguments;
  int had_err = 0;
  GtEncseqLoader *encseq_loader;
  GtEncseq *encseq;
  GtLogger *logger = NULL;

  gt_error_check(err);
  gt_assert(arguments);

  logger = gt_logger_new(arguments->verbose, GT_LOGGER_DEFLT_PREFIX, stdout);
  encseq_loader = gt_encseq_loader_new();
  if (arguments->mirror)
    gt_encseq_loader_mirror(encseq_loader);

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

    gt_encseq_check_startpositions(encseq,logger);
    for (readmode = 0; readmode < 4; readmode++) {
      if (gt_alphabet_is_dna(gt_encseq_alphabet(encseq)) ||
           ((GtReadmode) readmode) == GT_READMODE_FORWARD ||
           ((GtReadmode) readmode) == GT_READMODE_REVERSE) {
        gt_logger_log(logger,"check consistency for readmode %s",
                      gt_readmode_show((GtReadmode) readmode));
        if (gt_encseq_check_consistency(encseq,
                           gt_encseq_filenames(encseq),
                           (GtReadmode) readmode,
                           arguments->scantrials,
                           arguments->multicharcmptrials,
                           gt_encseq_has_multiseq_support(encseq),
                           !arguments->nocheckunit,
                           logger,
                           err) != 0) {
          had_err = -1;
          break;
        }
      }
    }
    if (!had_err)
      gt_encseq_check_specialranges(encseq);
    if (!had_err && !arguments->mirror)
      gt_encseq_check_markpos(encseq);
    if (!had_err)
      had_err = gt_encseq_check_minmax(encseq, err);
    if (!had_err && arguments->prefixlength > 0) {
      if (gt_verifymappedstr(encseq,
                             arguments->prefixlength,
                             err) != 0) {
        had_err = -1;
      }
    }
  }
  gt_encseq_delete(encseq);
  gt_encseq_loader_delete(encseq_loader);
  gt_logger_delete(logger);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r15
movq %r8, (%rsp)
testq %r8, %r8
je 0xa3caf
movq (%rsp), %rdi
callq 0xfcc32
testb %al, %al
jne 0xa3e5b
testq %r14, %r14
je 0xa3e56
movzbl 0x18(%r14), %edi
movq 0x415214(%rip), %rax    # 0x4b8ed8
movq (%rax), %rdx
leaq 0x2a2c06(%rip), %rsi    # 0x3468d4
callq 0x103e40
movq %rax, 0x10(%rsp)
callq 0xef0cd
cmpb $0x1, 0x19(%r14)
movq %rax, 0x8(%rsp)
jne 0xa3cf8
movq 0x8(%rsp), %rdi
callq 0xf237b
movq 0x8(%rsp), %rax
movslq %ebp, %rcx
movq (%r15,%rcx,8), %rsi
movq %rax, %rdi
movq (%rsp), %rdx
callq 0xef129
movq %rax, %r13
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0xa3e29
movq %r14, 0x18(%rsp)
movq %r13, %rdi
movq 0x10(%rsp), %rsi
callq 0xec3f2
xorl %ebp, %ebp
movq 0x10(%rsp), %r12
movq %r13, %rdi
callq 0xebcd9
movq %rax, %rdi
callq 0xd1749
cmpl $0x2, %ebp
jb 0xa3d4e
testb %al, %al
je 0xa3dca
movl %ebp, %edi
callq 0x1130f8
movq %r12, %rdi
leaq 0x2a7610(%rip), %rsi    # 0x34b36f
movq %rax, %rdx
xorl %eax, %eax
callq 0x103fe1
movq %r13, %rdi
callq 0xec2d5
movq %rax, %r15
movq %r13, %rbx
movq 0x18(%rsp), %r13
movq (%r13), %r14
movq 0x8(%r13), %rax
movq %rax, 0x20(%rsp)
movq %rbx, %rdi
callq 0xec555
movzbl 0x1a(%r13), %r10d
movq %rbx, %r13
subq $0x8, %rsp
xorl $0x1, %r10d
movzbl %al, %r9d
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
movq %r14, %rcx
movq 0x28(%rsp), %r8
pushq 0x8(%rsp)
pushq %r12
pushq %r10
callq 0xee041
addq $0x20, %rsp
testl %eax, %eax
jne 0xa3e20
incl %ebp
cmpl $0x4, %ebp
jne 0xa3d35
movq %r13, %rdi
callq 0xefbfa
movq 0x18(%rsp), %r14
cmpb $0x0, 0x19(%r14)
jne 0xa3df1
movq %r13, %rdi
callq 0xeba7f
movq %r13, %rdi
movq (%rsp), %rsi
callq 0xedf8c
movl %eax, %ebx
testl %eax, %eax
jne 0xa3e29
movq 0x10(%r14), %rsi
testq %rsi, %rsi
je 0xa3e27
movq %r13, %rdi
movq (%rsp), %rdx
callq 0x1ffb44
xorl %ebx, %ebx
negl %eax
sbbl %ebx, %ebx
jmp 0xa3e29
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0xa3e29
xorl %ebx, %ebx
movq %r13, %rdi
callq 0xea375
movq 0x8(%rsp), %rdi
callq 0xefbe3
movq 0x10(%rsp), %rdi
callq 0x1040e0
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1a27b
callq 0x1a244