// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/tools/gt_packedindex_chk_integrity.c
// Function: gt_packedindex_chk_integrity
extern int
gt_packedindex_chk_integrity(int argc, const char *argv[], GtError *err)
{
  struct encIdxSeq *seq;
  struct chkIndexOptions params;
  const char *inputProject;
  int parsedArgs;
  int had_err = 0;
  GtLogger *logger = NULL;
  gt_error_check(err);

  switch (parseChkIndexOptions(&parsedArgs, argc, argv, &params, err))
  {
    case GT_OPTION_PARSER_OK:
      break;
    case GT_OPTION_PARSER_ERROR:
      return -1;
    case GT_OPTION_PARSER_REQUESTS_EXIT:
      return 0;
  }

  inputProject = argv[parsedArgs];

  logger = gt_logger_new(params.verboseOutput, GT_LOGGER_DEFLT_PREFIX, stdout);

  seq = gt_loadEncIdxSeq(inputProject, params.encType, params.EISFeatureSet,
                      logger, err);
  if ((had_err = seq == NULL))
  {
    gt_error_set(err, "Failed to load index: %s", inputProject);
  }
  else
  {
    fprintf(stderr, "# Using index over sequence "GT_WU""
            " symbols long.\n", EISLength(seq));
    {
      int corrupt
        = gt_EISVerifyIntegrity(seq, inputProject, params.skipCount,
                             params.progressInterval, stderr,
                             params.checkFlags, logger, err);
      if ((had_err = corrupt != 0))
      {
        fputs(gt_error_get(err), stderr); fputs("\n", stderr);
        gt_error_set(err, "Integrity check failed for index: %s",
                  EISIntegrityCheckResultStrings[corrupt]);
      }
    }
  }
  if (seq) gt_deleteEncIdxSeq(seq);
  if (logger) gt_logger_delete(logger);
  return had_err?-1:0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
testq %rdx, %rdx
je 0xb1c1f
movq %rbx, %rdi
callq 0xfcc32
testb %al, %al
jne 0xb1d2e
leaq 0x4(%rsp), %rdi
leaq 0x8(%rsp), %rcx
movl %ebp, %esi
movq %r14, %rdx
movq %rbx, %r8
jmp 0xb1c31
leaq 0x4(%rsp), %rdi
leaq 0x8(%rsp), %rcx
movl %ebp, %esi
movq %r14, %rdx
xorl %r8d, %r8d
callq 0xb1d33
cmpl $0x1, %eax
je 0xb1c44
cmpl $0x2, %eax
jne 0xb1c4b
xorl %ebp, %ebp
jmp 0xb1cb3
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0xb1cb3
movslq 0x4(%rsp), %rax
movq (%r14,%rax,8), %r15
movzbl 0x1c(%rsp), %edi
movq 0x407278(%rip), %rax    # 0x4b8ed8
movq (%rax), %rdx
leaq 0x294c6a(%rip), %rsi    # 0x3468d4
callq 0x103e40
movq %rax, %r14
movl 0x20(%rsp), %esi
movl 0x24(%rsp), %edx
movq %r15, %rdi
movq %rax, %rcx
movq %rbx, %r8
callq 0x19d07b
testq %rax, %rax
jne 0xb1cc4
leaq 0x29f8c8(%rip), %rsi    # 0x35155c
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %r14, %r14
je 0xb1cb3
movq %r14, %rdi
callq 0x1040e0
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
movq 0x4072b2(%rip), %r13    # 0x4b8f80
movq (%r13), %rdi
movq 0x10(%rax), %rdx
leaq 0x29f898(%rip), %rsi    # 0x351575
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x17ab0
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq (%r13), %r8
movl 0x18(%rsp), %r9d
movq %r12, %rdi
movq %r15, %rsi
pushq %rbx
pushq %r14
callq 0x19d121
addq $0x10, %rsp
movl %eax, %r15d
testl %eax, %eax
jne 0xb1d21
movq %r12, %rdi
callq 0x19d11c
negl %r15d
sbbl %ebp, %ebp
jmp 0xb1ca6
movq %rbx, %rdi
movl %r15d, %esi
callq 0x1ce2c
jmp 0xb1d12
callq 0x1cdf5