// File: /workspace/github_cpp_makefile_star2_O3/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 $0xc8, %rsp
movq %rcx, 0x8(%rsp)
movq %rdi, %r14
cmpl $0x2, %esi
jl 0x92bd
movq %rdx, %r15
movl %esi, %ebp
leaq 0x8(%r14), %rax
movq %rax, 0x10(%rsp)
leaq 0x28(%r14), %rax
movq %rax, (%rsp)
movl $0x1, %r12d
movslq %r12d, %rbx
movq (%r15,%rbx,8), %rdi
cmpb $0x2d, (%rdi)
jne 0x91be
cmpb $0x76, 0x1(%rdi)
jne 0x915e
cmpb $0x0, 0x2(%rdi)
je 0x9212
cmpb $0x64, 0x1(%rdi)
jne 0x916e
cmpb $0x0, 0x2(%rdi)
je 0x9219
cmpb $0x6b, 0x1(%rdi)
jne 0x917e
cmpb $0x0, 0x2(%rdi)
je 0x922a
cmpb $0x70, 0x1(%rdi)
jne 0x918e
cmpb $0x0, 0x2(%rdi)
je 0x923b
cmpb $0x6d, 0x1(%rdi)
jne 0x919e
cmpb $0x0, 0x2(%rdi)
je 0x9242
cmpb $0x6f, 0x1(%rdi)
jne 0x91ae
cmpb $0x0, 0x2(%rdi)
je 0x9249
cmpb $0x69, 0x1(%rdi)
jne 0x91be
cmpb $0x0, 0x2(%rdi)
je 0x9281
cmpq $0x0, 0x10(%r14)
jne 0x932d
leaq 0x38(%rsp), %rsi
callq 0x4320
cmpl $-0x1, %eax
je 0x9339
movq (%r15,%rbx,8), %rbx
movq 0x10(%r14), %r13
movq %rbx, %rdi
callq 0x4170
movq 0x10(%rsp), %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %rbx, %rcx
movq %rax, %r8
callq 0x45b0
incl %r12d
cmpl %ebp, %r12d
jl 0x9142
jmp 0x92bd
movb $0x1, 0x4(%r14)
jmp 0x9201
cmpb $0x0, 0x1(%r14)
jne 0x93f4
movb $0x1, (%r14)
jmp 0x9201
cmpb $0x0, (%r14)
jne 0x93f4
movb $0x1, 0x1(%r14)
jmp 0x9201
movb $0x1, 0x2(%r14)
jmp 0x9201
movb $0x1, 0x3(%r14)
jmp 0x9201
incl %r12d
cmpl %ebp, %r12d
je 0x9406
movslq %r12d, %rax
movq (%r15,%rax,8), %rbx
movq %rbx, %rdi
callq 0x9431
testb %al, %al
jne 0x9406
movq 0x30(%r14), %r13
movq %rbx, %rdi
callq 0x4170
movq (%rsp), %rdi
jmp 0x91f1
incl %r12d
cmpl %ebp, %r12d
je 0x93fd
movslq %r12d, %rax
movq (%r15,%rax,8), %rbx
movq %rbx, %rdi
callq 0x9431
testb %al, %al
jne 0x93fd
movq %rbx, %rdi
callq 0x45c0
testl %eax, %eax
je 0x93fd
movl %eax, 0x48(%r14)
jmp 0x9201
leaq 0x28(%r14), %r15
cmpq $0x0, 0x30(%r14)
jne 0x93af
leaq 0x28(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
addq %rsi, %rdx
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x9492
leaq 0x7878(%rip), %rsi      # 0x10b6d
movl $0x1, %ecx
movq %rbx, %rdi
movq $-0x1, %rdx
callq 0x44e0
cmpq $-0x1, %rax
je 0x9345
leaq 0x7cbe(%rip), %rcx      # 0x10fd4
leaq 0x18(%rsp), %rdi
movl $0x8, %r8d
movq %rax, %rsi
xorl %edx, %edx
callq 0x43f0
jmp 0x9356
leaq 0x7bed(%rip), %rcx      # 0x10f21
jmp 0x93d8
leaq 0x7c14(%rip), %rcx      # 0x10f54
jmp 0x93d8
leaq 0x7c88(%rip), %rsi      # 0x10fd4
leaq 0x18(%rsp), %rdi
callq 0x4730
leaq 0x48(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x38(%rsp), %rdi
callq 0x9492
leaq 0x38(%rsp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4450
movq (%rbx), %rdi
cmpq %r13, %rdi
je 0x9398
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x93af
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x43a0
leaq 0x8(%r14), %rdi
movq %r15, %rsi
callq 0x4050
testl %eax, %eax
je 0x93d1
movb $0x1, %al
cmpq $0x0, 0x10(%r14)
jne 0x93e2
leaq 0x7be7(%rip), %rcx      # 0x10fb6
jmp 0x93d8
leaq 0x7b9d(%rip), %rcx      # 0x10f75
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
xorl %eax, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7a72(%rip), %rcx      # 0x10e6d
jmp 0x93d8
leaq 0x7ad8(%rip), %rcx      # 0x10edc
jmp 0x93d8
leaq 0x7a91(%rip), %rcx      # 0x10e9e
jmp 0x93d8
movq %rax, %rbx
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x9429
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x43a0
movq %rbx, %rdi
callq 0x46d0