// File: /workspace/github_cpp_makefile_star2_O1/cpearce[P]OggIndex/src/Options.cpp
// Function: Options::DoParse(int, char**, char const**)
bool Options::DoParse(int argc, char** argv, const char** error) {

  for (ogg_int32_t argIndex=1; argIndex < argc; argIndex++) {
    const char* arg = argv[argIndex];

    if (strcmp(arg, "-v") == 0) {
      mVerifyIndex = true;
      continue;
    }

    if (strcmp(arg, "-d") == 0) {
      if (mDumpKeyPackets) {
        *error = "ERROR: You can't use -d and -k at the same time.";
        return false;
      }
      mDumpPackets = true;
      continue;
    }

    if (strcmp(arg, "-k") == 0) {
      if (mDumpPackets) {
        *error = "ERROR: You can't use -d and -k at the same time.";
        return false;
      }
      mDumpKeyPackets = true;
      continue;
    }

    if (strcmp(arg, "-p") == 0) {
      mDumpPages = true;
      continue;
    }

    if (strcmp(arg, "-m") == 0) {
      mDumpMerge = true;
      continue;
    }

    if (strcmp(arg, "-o") == 0) {
      if (argIndex+1 == argc || IsArgument(argv[argIndex+1])) {
        *error = "ERROR: You must specify an output filename with '-o' argument";
        return false;
      }
      mOutputFilename = argv[argIndex+1];
      argIndex++;
      continue;
    }
    
    if (strcmp(arg, "-i") == 0) {
      ogg_int32_t interval = 0;
      if (argIndex+1 == argc || IsArgument(argv[argIndex+1]) ||  (interval = atoi(argv[argIndex+1])) == 0) {
        *error = "ERROR: You must specify an integer interval in ms with '-i' argument";
        return false;
      }
      mKeyPointInterval = interval;
      argIndex++;
      continue;
    }

    if (!mInputFilename.empty()) {
      *error = "ERROR: You cannot specify more than one input file";
      return false;
    }

    // Assume argument is input filename.
    if (!FileExists(argv[argIndex])) {
      *error = "ERROR: Input file does not exist";
      return false;
    }

    mInputFilename = argv[argIndex];
  }

  if (mOutputFilename.empty()) {
    // No output filename specified, use input.indexed.extension.
    mOutputFilename = OutputFilename(mInputFilename);
  }

  if (mInputFilename.compare(mOutputFilename) == 0) {
    *error = "ERROR: output filename must be different from the input filename";
    return false;
  }

  if (mInputFilename.empty()) {
    *error = "ERROR: specify input filename";
    return false;
  }

  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rcx, (%rsp)
movq %rdx, 0x8(%rsp)
movq %rdi, %r14
cmpl $0x2, %esi
setge %r13b
jl 0x9492
movl %esi, %ebp
leaq 0x8(%r14), %rax
movq %rax, 0x18(%rsp)
leaq 0x28(%r14), %rax
movq %rax, 0x20(%rsp)
movl $0x1, %r12d
movslq %r12d, %r15
movq 0x8(%rsp), %rax
movq (%rax,%r15,8), %rbx
movq %rbx, %rdi
leaq 0x7bfb(%rip), %rsi      # 0x10e6d
callq 0x44f0
testl %eax, %eax
je 0x9321
movq %rbx, %rdi
leaq 0x7be7(%rip), %rsi      # 0x10e70
callq 0x44f0
testl %eax, %eax
je 0x9328
movq %rbx, %rdi
leaq 0x7c04(%rip), %rsi      # 0x10ea4
callq 0x44f0
testl %eax, %eax
je 0x9335
movq %rbx, %rdi
leaq 0x7bf0(%rip), %rsi      # 0x10ea7
callq 0x44f0
testl %eax, %eax
je 0x9351
movq %rbx, %rdi
leaq 0x7bdc(%rip), %rsi      # 0x10eaa
callq 0x44f0
testl %eax, %eax
je 0x935f
movq %rbx, %rdi
leaq 0x7bc8(%rip), %rsi      # 0x10ead
callq 0x44f0
testl %eax, %eax
je 0x9389
movq %rbx, %rdi
leaq 0x7bf2(%rip), %rsi      # 0x10eee
callq 0x44f0
testl %eax, %eax
je 0x93bb
cmpq $0x0, 0x10(%r14)
je 0x93fe
movq (%rsp), %rax
leaq 0x7c17(%rip), %rcx      # 0x10f36
jmp 0x9346
movb $0x1, 0x4(%r14)
jmp 0x9364
cmpb $0x1, 0x1(%r14)
je 0x933b
movb $0x1, (%r14)
jmp 0x9364
cmpb $0x1, (%r14)
jne 0x9358
movq (%rsp), %rax
leaq 0x7b2d(%rip), %rcx      # 0x10e73
movq %rcx, (%rax)
movl $0x1, %r15d
jmp 0x936a
movb $0x1, 0x2(%r14)
jmp 0x9364
movb $0x1, 0x1(%r14)
jmp 0x9364
movb $0x1, 0x3(%r14)
movl $0x4, %r15d
testb $0x3, %r15b
jne 0x9488
incl %r12d
cmpl %ebp, %r12d
setl %r13b
jl 0x925c
jmp 0x9492
leal 0x1(%r12), %ebx
cmpl %ebp, %ebx
je 0x93ae
movslq %ebx, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %r15
movq %r15, %rdi
callq 0x95d6
testb %al, %al
je 0x9449
movq (%rsp), %rax
leaq 0x7af7(%rip), %rcx      # 0x10eb0
jmp 0x9346
leal 0x1(%r12), %ebx
cmpl %ebp, %ebx
je 0x93ee
movslq %ebx, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %r15
movq %r15, %rdi
callq 0x95d6
testb %al, %al
jne 0x93ee
movq %r15, %rdi
callq 0x45d0
testl %eax, %eax
je 0x93ee
movl %eax, 0x48(%r14)
jmp 0x946a
movq (%rsp), %rax
leaq 0x7af8(%rip), %rcx      # 0x10ef1
jmp 0x9346
movq %rbx, %rdi
leaq 0x48(%rsp), %rsi
callq 0x4320
cmpl $-0x1, %eax
je 0x9478
movq 0x8(%rsp), %rax
movq (%rax,%r15,8), %rbx
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
callq 0x4170
xorl %r15d, %r15d
movq 0x18(%rsp), %rdi
xorl %esi, %esi
movq 0x10(%rsp), %rdx
movq %rbx, %rcx
movq %rax, %r8
callq 0x45c0
jmp 0x936a
movq 0x30(%r14), %r12
movq %r15, %rdi
callq 0x4170
movq 0x20(%rsp), %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r15, %rcx
movq %rax, %r8
callq 0x45c0
movl $0x4, %r15d
movl %ebx, %r12d
jmp 0x936a
movq (%rsp), %rax
leaq 0x7ae6(%rip), %rcx      # 0x10f69
jmp 0x9346
testb $0x1, %r13b
jne 0x95a0
leaq 0x28(%r14), %r15
cmpq $0x0, 0x30(%r14)
jne 0x9570
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0x966c
leaq 0x76a3(%rip), %rsi      # 0x10b6d
movl $0x1, %ecx
movq %rbx, %rdi
movq $-0x1, %rdx
callq 0x44e0
cmpq $-0x1, %rax
je 0x9502
leaq 0x7afe(%rip), %rcx      # 0x10fe9
leaq 0x28(%rsp), %rdi
movl $0x8, %r8d
movq %rax, %rsi
xorl %edx, %edx
callq 0x43f0
jmp 0x9513
leaq 0x7ae0(%rip), %rsi      # 0x10fe9
leaq 0x28(%rsp), %rdi
callq 0x4740
leaq 0x58(%rsp), %rcx
leaq 0x48(%rsp), %rdi
movq %rcx, (%rdi)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
callq 0x966c
leaq 0x48(%rsp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4450
movq (%rbx), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x9559
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x9570
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x43a0
leaq 0x8(%r14), %rdi
movq %r15, %rsi
callq 0x4050
testl %eax, %eax
je 0x9592
movb $0x1, %al
cmpq $0x0, 0x10(%r14)
jne 0x95a2
leaq 0x7a3b(%rip), %rax      # 0x10fcb
jmp 0x9599
leaq 0x79f1(%rip), %rax      # 0x10f8a
movq (%rsp), %rcx
movq %rax, (%rcx)
xorl %eax, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x95ce
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x43a0
movq %rbx, %rdi
callq 0x46e0