// File: /workspace/github_c_makefile_star2_O2/PoulinV[P]AxiCLASS/build/../tools/parser.c
// Function: parser_check_options
int parser_check_options(char * strinput, char ** options, int N_options, int* valid){

  int i, j, n_option, string_length, option_length;
  int found;
  char str[_ARGUMENT_LENGTH_MAX_];
  strcpy(str,strinput);

  *valid = _TRUE_;

  for(n_option = 0; n_option < N_options; ++n_option){

    string_length = strlen(str);                // Length of string
    option_length = strlen(options[n_option]);  // Length of option to remove from string

    for(i=0; i <= string_length - option_length; i++){

      /* Match first character */
      if(str[i] == options[n_option][0]){
        found = _TRUE_;
      }
      else{
        found = _FALSE_;
        continue;
      }

      /* Only if first character fits, try all the others */
      for(j=0; j<option_length; j++){
        if(str[i + j] != options[n_option][j]){
          found = _FALSE_;
          break;
        }
      }

      /* If it is not seperated by anything afterwards, it is not its own word */
      if(str[i+j] != ',' && str[i+j] != ' ' && str[i+j] != '\t' && str[i+j] != '\n' && str[i+j] != '\0' && str[i+j] != '.'  && str[i+j] != '&'){
        found = _FALSE_;
      }

      /* If it is not seperated by anything before, it is not its own word */
      if(i>0 && str[i-1] != ',' && str[i-1] != ' ' && str[i-1] != '\t' && str[i-1] != '\n' && str[i-1] != '\0' && str[i-1] != '.'  && str[i-1] != '&'){
        found = _FALSE_;
      }

      /* *
       * If word is found then shift all characters to left
       * and decrement the string length
       * */
      if(found == _TRUE_){

        for(j=i; j<=string_length - option_length; j++){
            str[j] = str[j+option_length];
        }

        string_length = string_length - option_length;

        // We will match the next occurrence of the word from the current index.
        i--;

      }
    }
  }

  string_length = strlen(str);
  /* Check that the remaining characters are exclusively seperators */
  for(i=0;i<string_length;i++){
    if( str[i] != ',' && str[i] != ' ' && str[i] != '\t' && str[i] != '\n' && str[i] != '\0' && str[i] != '.'  && str[i] != '&'){
      *valid = _FALSE_;
    }
  }

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movq %rcx, %rbx
movl %edx, %r14d
movq %rsi, 0x8(%rsp)
movq %rdi, %rsi
leaq 0x10(%rsp), %rdi
callq 0x8370
movq %rbx, (%rsp)
movl $0x1, (%rbx)
xorl %r12d, %r12d
testl %r14d, %r14d
cmovlel %r12d, %r14d
pushq $0x1
popq %r15
movabsq $0x504100000601, %rbx   # imm = 0x504100000601
leaq 0x10(%rsp), %rdi
callq 0x8190
movq %rax, %rbp
cmpq %r14, %r12
je 0x1daa9
movq 0x8(%rsp), %rax
movq (%rax,%r12,8), %r13
movq %r13, %rdi
callq 0x8190
xorl %ecx, %ecx
testl %eax, %eax
movl $0x0, %edx
cmovgl %eax, %edx
movslq %eax, %rsi
addq %rsp, %rsi
addq $0x10, %rsi
movl %ebp, %edi
subl %eax, %edi
cmpl %edi, %ecx
jg 0x1daa1
movslq %ecx, %r8
movb 0x10(%rsp,%r8), %r9b
cmpb (%r13), %r9b
jne 0x1da8d
leaq (%rsp,%r8), %r9
addq $0x10, %r9
xorl %r10d, %r10d
cmpq %r10, %rdx
je 0x1da35
movb (%r9,%r10), %r11b
cmpb (%r13,%r10), %r11b
jne 0x1da3d
incq %r10
jmp 0x1da20
movl %edx, %r10d
movl %r15d, %r9d
jmp 0x1da40
xorl %r9d, %r9d
addl %ecx, %r10d
movslq %r10d, %r10
movzbl 0x10(%rsp,%r10), %r10d
cmpq $0x2e, %r10
ja 0x1da9c
btq %r10, %rbx
jae 0x1da9c
testl %ecx, %ecx
jle 0x1da72
leal -0x1(%rcx), %r10d
movzbl 0x10(%rsp,%r10), %r10d
cmpq $0x2e, %r10
ja 0x1da8d
btq %r10, %rbx
jae 0x1da8d
testl %r9d, %r9d
je 0x1da8d
movslq %edi, %r9
cmpq %r9, %r8
jg 0x1da91
movb (%rsi,%r8), %r10b
movb %r10b, 0x10(%rsp,%r8)
incq %r8
jmp 0x1da7a
movl %ebp, %edi
jmp 0x1da93
decl %ecx
incl %ecx
movl %edi, %ebp
jmp 0x1d9fb
xorl %r9d, %r9d
jmp 0x1da58
incq %r12
jmp 0x1d9be
xorl %eax, %eax
testl %ebp, %ebp
cmovlel %eax, %ebp
movq (%rsp), %rdx
cmpq %rax, %rbp
je 0x1dad4
movzbl 0x10(%rsp,%rax), %ecx
cmpq $0x2e, %rcx
ja 0x1dacf
btq %rcx, %rbx
jae 0x1dacf
incq %rax
jmp 0x1dab4
andl $0x0, (%rdx)
jmp 0x1daca
xorl %eax, %eax
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq