// File: /workspace/github_c_makefile_star2_O2/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 0x354a3
movq %rbx, %rdi
callq 0x89eb7
testb %al, %al
jne 0x356cc
movq %rbx, %rdi
callq 0x89eb7
testb %al, %al
jne 0x356f6
leaq 0x2d05b3(%rip), %rdi    # 0x305a5d
leaq 0x2bc140(%rip), %rsi    # 0x2f15f1
callq 0x97df5
movq %rax, %r15
leaq 0x1c(%rsp), %rdx
leaq 0x2fa6ab(%rip), %rdi    # 0x32fb70
leaq 0x2bc16f(%rip), %rsi    # 0x2f163b
xorl %ecx, %ecx
callq 0x9a997
movq %r15, %rdi
movq %rax, %rsi
callq 0x97f31
leaq 0x2bc18e(%rip), %rdi    # 0x2f1673
leaq 0x2bc172(%rip), %rsi    # 0x2f165e
leaq 0x8(%rsp), %rdx
xorl %ecx, %ecx
callq 0x9a9e6
movq %r15, %rdi
movq %rax, %rsi
callq 0x97f31
leaq 0x10(%rsp), %r12
leaq 0x2bc169(%rip), %rdi    # 0x2f1678
leaq 0x2bc168(%rip), %rsi    # 0x2f167e
movl $0x186a0, %ecx          # imm = 0x186A0
movq %r12, %rdx
callq 0x9a9e6
movq %r15, %rdi
movq %rax, %rsi
callq 0x97f31
leaq 0x2bc177(%rip), %rdi    # 0x2f16ac
leaq 0x2bc17f(%rip), %rsi    # 0x2f16bb
leaq 0x3(%rsp), %r13
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x9a997
movq %r15, %rdi
movq %rax, %rsi
callq 0x97f31
pushq $0x1
popq %rdx
movq %r15, %rdi
movl %edx, %esi
callq 0x98c6b
leaq 0x7d6e6(%rip), %r8      # 0xb2c50
leaq 0x4(%rsp), %rsi
movq %r15, %rdi
movl %ebp, %edx
movq %r14, %rcx
movq %rbx, %r9
callq 0x98cb0
movl %eax, %ebp
movq %r15, %rdi
callq 0x9a844
movzbl (%r13), %eax
movl %eax, 0x8(%r12)
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, 0x10(%r12)
cmpl $0x1, %ebp
je 0x355b0
cmpl $0x2, %ebp
jne 0x355b5
xorl %ebp, %ebp
jmp 0x3561b
pushq $-0x1
popq %rbp
jmp 0x3561b
movslq 0x4(%rsp), %rax
movq (%r14,%rax,8), %r12
movzbl 0x1c(%rsp), %edi
movq 0x4028e6(%rip), %rax    # 0x437eb0
movq (%rax), %rdx
leaq 0x2b1300(%rip), %rsi    # 0x2e68d4
callq 0x92b50
movq %rax, %r14
movl 0x20(%rsp), %esi
movl 0x24(%rsp), %edx
movq %r12, %rdi
movq %rax, %rcx
movq %rbx, %r8
callq 0x14835b
testq %rax, %rax
jne 0x3562c
leaq 0x2bbf71(%rip), %rsi    # 0x2f156f
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %rbp
testq %r14, %r14
je 0x3561b
movq %r14, %rdi
callq 0x92fd0
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movq 0x402932(%rip), %r13    # 0x437f68
movq (%r13), %rdi
movq 0x10(%rax), %rdx
leaq 0x2bbf43(%rip), %rsi    # 0x2f1588
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x17a50
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq (%r13), %r8
movl 0x18(%rsp), %r9d
movq %r15, %rdi
movq %r12, %rsi
pushq %rbx
pushq %r14
callq 0x148401
popq %rcx
popq %rdx
movl %eax, %r12d
testl %eax, %eax
jne 0x35687
movq %r15, %rdi
callq 0x1483fc
negl %r12d
sbbl %ebp, %ebp
jmp 0x3560e
movq %rbx, %rdi
callq 0x89f41
movq (%r13), %rsi
movq %rax, %rdi
callq 0x17870
movq (%r13), %rsi
leaq 0x32ae49(%rip), %rdi    # 0x3604ef
callq 0x17870
movslq %r12d, %rax
leaq 0x403bab(%rip), %rcx    # 0x439260
movq (%rcx,%rax,8), %rdx
leaq 0x2bbef7(%rip), %rsi    # 0x2f15b7
movq %rbx, %rdi
xorl %eax, %eax
callq 0x89dbb
jmp 0x35678
movq 0x402895(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2af936(%rip), %rsi    # 0x2e5013
leaq 0x2afadb(%rip), %rdx    # 0x2e51bf
leaq 0x2bbe3e(%rip), %rcx    # 0x2f1529
leaq 0x2bbe54(%rip), %r8     # 0x2f1546
pushq $0x39
jmp 0x3571e
movq 0x40286b(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2af90c(%rip), %rsi    # 0x2e5013
leaq 0x2afab1(%rip), %rdx    # 0x2e51bf
leaq 0x2bbec7(%rip), %rcx    # 0x2f15dc
leaq 0x2bbe2a(%rip), %r8     # 0x2f1546
pushq $0x6e
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390