// File: /workspace/github_c_makefile_star2_O1/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 %r8, %rbx
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r12
testq %r8, %r8
je 0xa5fc9
movq %rbx, %rdi
callq 0x101a9a
testb %al, %al
jne 0xa6191
testq %r14, %r14
je 0xa618c
movzbl 0x18(%r14), %edi
movq 0x41df0a(%rip), %rax    # 0x4c3ee8
movq (%rax), %rdx
leaq 0x2a98ec(%rip), %rsi    # 0x34f8d4
callq 0x108ed0
movq %rax, 0x10(%rsp)
callq 0xf36ef
cmpb $0x1, 0x19(%r14)
movq %rax, (%rsp)
jne 0xa600f
movq (%rsp), %rdi
callq 0xf69bc
movq (%rsp), %rax
movslq %ebp, %rcx
movq (%r12,%rcx,8), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xf374b
movq %rax, %r15
testq %rax, %rax
je 0xa6126
movq %r14, 0x8(%rsp)
movq %r15, %rdi
movq 0x10(%rsp), %rsi
callq 0xf09ef
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %rbx, 0x18(%rsp)
movq 0x10(%rsp), %r13
incl %ebp
movq %r15, %rdi
callq 0xf02da
movq %rax, %rdi
callq 0xd3c75
cmpl $0x2, %ebp
jb 0xa6069
testb %al, %al
je 0xa60e6
movl %ebp, %edi
callq 0x118794
movq %r13, %rdi
leaq 0x2ae304(%rip), %rsi    # 0x35437e
movq %rax, %rdx
xorl %eax, %eax
callq 0x10906e
movq %r15, %rdi
callq 0xf08d6
movq %rax, %r12
movq %r15, %rbx
movq 0x8(%rsp), %r15
movq (%r15), %rax
movq %rax, 0x20(%rsp)
movq 0x8(%r15), %r14
movq %rbx, %rdi
callq 0xf0b51
movzbl 0x1a(%r15), %r10d
movq %rbx, %r15
subq $0x8, %rsp
xorl $0x1, %r10d
movzbl %al, %r9d
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %rbx
movq %r14, %r8
pushq %rbx
pushq %r13
pushq %r10
callq 0xf2691
addq $0x20, %rsp
testl %eax, %eax
jne 0xa612e
cmpl $0x3, %ebp
jne 0xa604e
movq %r15, %rdi
callq 0xf4264
movq 0x8(%rsp), %r14
cmpb $0x0, 0x19(%r14)
jne 0xa610b
movq %r15, %rdi
callq 0xf0080
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
cmpl $0x3, %ebp
jb 0xa6139
movq %r15, %rdi
movq %rbx, %rsi
callq 0xf25c8
movl %eax, %r12d
jmp 0xa6139
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jmp 0xa615f
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq 0x8(%rsp), %r14
testl %r12d, %r12d
jne 0xa615f
movq 0x10(%r14), %rsi
testq %rsi, %rsi
je 0xa615c
movq %r15, %rdi
movq %rbx, %rdx
callq 0x2092fc
xorl %r12d, %r12d
negl %eax
sbbl %r12d, %r12d
jmp 0xa615f
xorl %r12d, %r12d
movq %r15, %rdi
callq 0xee90c
movq (%rsp), %rdi
callq 0xf424d
movq 0x10(%rsp), %rdi
callq 0x10916a
movl %r12d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1a2cc
callq 0x1a295
nop