// File: /workspace/github_c_makefile_star2_O2/mmayer[P]pcal/src/readfile.c
// Function: parse_as_non_preproc
int parse_as_non_preproc (char **pword, char *filename)
{
   register char *cp;
   char **ptext;
   int mm, yy;
   int text_type, n, v, match;
   int token;
   
   /*
      Get first field and call date_type() to decode it
   */
   cp = *pword;

   switch (token = date_type(cp, &n, &v)) {

   case DT_YEAR:
      if ((cp = *++pword) != NULL && (yy = atoi(cp)) > 0) {
         if (yy < 100) yy += century();
         curr_year = yy;
         return PARSE_OK;
      }
      if (strcmp(cp, ALL) == 0 || strcmp(cp, "*") == 0) {
         curr_year = ALL_YEARS;
         return PARSE_OK;
      }
      return PARSE_INVLINE;   /* year missing or non-numeric */
      break;

   case DT_OPT:
      if (!get_args(pword, P_OPT, filename, FALSE)) {
         display_usage(stderr, FALSE);
         exit(EXIT_FAILURE);
      }
      return PARSE_OK;
      break;
      
   case DT_INPUT_LANGUAGE:
      pword++;  /* point to 2-letter 'language code' string */
      if (*pword) {
         int i;
         for (i = 0; i < NUM_LANGUAGES; i++) {
            if (ci_strncmp(lang_id[i], *pword, MIN_LANG_LEN) == 0) {
               input_language = i;
               return PARSE_OK;
            }
         }
      }
      return PARSE_INVLINE;
      break;

   case DT_NOTE:
      /* look for optional "/<n>" following keyword */
      n = (cp = strrchr(cp, '/')) ? atoi(++cp) : 0;
      
      if ((mm = get_month(*++pword, TRUE, TRUE)) == NOT_MONTH) return PARSE_INVLINE;
      
      /* if "year all" in effect, wildcard all applicable years */
      if (curr_year == ALL_YEARS) {
         match = FALSE;
         for (curr_year = init_year; curr_year <= final_year; curr_year++) {
            match |= enter_note(mm, pword, n) == PARSE_OK;
         }
         curr_year = ALL_YEARS;   /* reset to wildcard */
         return match ? PARSE_OK : PARSE_NOMATCH;
      } 
      else return enter_note(mm, pword, n);
      break;

   case DT_OTHER:   /* unrecognized token */
      return PARSE_INVLINE;
      break;
      
   case DT_DELETE:   /* fall through to actually delete event entry */
      pword++;
      delete_entry = TRUE;
      
   default:
      /* At this point, we assume that the configuration file line is an event
         specification... */

      /* If the current year is a wildcard ("all" or "*" - see above), enter
         the date for each year covered at least partially by the calendar.
         Note that a "mm/dd/yy" date spec explicitly resets curr_year;
         parse_date() sets the 'curr_year_reset' flag when this happens so
         that we can quit immediately.
      */
      if (curr_year == ALL_YEARS) {
         match = FALSE;
         /* loop over each applicable year */
         for (curr_year = init_year; curr_year <= final_year; curr_year++) {
            match |= process_event_specification(pword, &text_type, &ptext) == PARSE_OK;
            if (curr_year_reset) {   /* quit if year reset */
               return match ? PARSE_OK : PARSE_NOMATCH;
            }
         }
         
         /* restore year to wildcard for next time */
         curr_year = ALL_YEARS;
         delete_entry = FALSE;
         return match ? PARSE_OK : PARSE_NOMATCH;
      }

      match = process_event_specification(pword, &text_type, &ptext);
      delete_entry = FALSE;
      return match;
      
      break;
   }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %r15
leaq 0x14(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %r15, %rdi
callq 0xc226
incl %eax
cmpl $0xc, %eax
ja 0xb4d4
pushq $0x2
popq %rbp
leaq 0x127d2(%rip), %rcx     # 0x1dc38
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
pushq $0x2f
popq %rsi
movq %r15, %rdi
callq 0x5150
testq %rax, %rax
je 0xb60d
incq %rax
movq %rax, %rdi
callq 0x52c0
movl %eax, %r14d
jmp 0xb610
pushq $0x10
popq %rsi
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x5d9e
testl %eax, %eax
jne 0xb6b0
movq 0x1cb41(%rip), %rax     # 0x27ff8
movq (%rax), %rdi
xorl %esi, %esi
callq 0x574c
pushq $0x1
popq %rdi
callq 0x52f0
addq $0x8, %rbx
movb $0x1, 0x23ad0(%rip)     # 0x2efa4
leaq 0x220f5(%rip), %r12     # 0x2d5d0
cmpl $-0x1, (%r12)
je 0xb578
leaq 0x4(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0xc8e2
movl %eax, %ebp
movb $0x0, 0x23aa3(%rip)     # 0x2efa4
jmp 0xb6b0
cmpq $0x0, 0x8(%rbx)
je 0xb6b0
leaq 0x20a58(%rip), %r14     # 0x2bf70
xorl %r15d, %r15d
cmpq $0x18, %r15
je 0xb6b0
movq 0x8(%rbx), %rsi
movq %r14, %rdi
movl %ebp, %edx
callq 0x9665
testl %eax, %eax
je 0xb658
incq %r15
addq $0x14, %r14
jmp 0xb51b
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
je 0xb5ca
movq %rbx, %rdi
callq 0x52c0
testl %eax, %eax
jle 0xb5ca
movl %eax, %r14d
cmpl $0x63, %eax
ja 0xb569
callq 0xa0c8
addl %eax, %r14d
leaq 0x22060(%rip), %rax     # 0x2d5d0
movl %r14d, (%rax)
jmp 0xb662
leaq 0x21f09(%rip), %rax     # 0x2d488
movl (%rax), %eax
xorl %ebp, %ebp
leaq 0x22042(%rip), %r13     # 0x2d5cc
leaq 0x4(%rsp), %r14
leaq 0x8(%rsp), %r15
movl %eax, (%r12)
cmpl (%r13), %eax
jg 0xb5fc
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0xc8e2
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
orl %ecx, %ebp
cmpb $0x1, 0x239ec(%rip)     # 0x2efa8
je 0xb6a6
movl (%r12), %eax
incl %eax
jmp 0xb594
leaq 0x12bf0(%rip), %rsi     # 0x1e1c1
movq %rbx, %rdi
callq 0x51f0
testl %eax, %eax
je 0xb5f0
cmpb $0x2a, (%rbx)
jne 0xb6b0
cmpb $0x0, 0x1(%rbx)
jne 0xb6b0
leaq 0x21fd9(%rip), %rax     # 0x2d5d0
orl $-0x1, (%rax)
jmp 0xb662
orl $-0x1, (%r12)
movb $0x0, 0x2399c(%rip)     # 0x2efa4
jmp 0xb6a6
xorl %r14d, %r14d
movq 0x8(%rbx), %rdi
pushq $0x1
popq %rdx
movl %edx, %esi
callq 0xbe6c
cmpl $-0x1, %eax
je 0xb6b0
movl %eax, %r15d
addq $0x8, %rbx
leaq 0x21f9b(%rip), %r12     # 0x2d5d0
cmpl $-0x1, (%r12)
je 0xb666
movl %r15d, %edi
movq %rbx, %rsi
movl %r14d, %edx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xc82a
leaq 0x221a1(%rip), %rax     # 0x2d800
movl %r15d, (%rax)
xorl %ebp, %ebp
jmp 0xb6b0
leaq 0x21e1b(%rip), %rax     # 0x2d488
movl (%rax), %eax
xorl %ebp, %ebp
leaq 0x21f54(%rip), %r13     # 0x2d5cc
movl %eax, (%r12)
cmpl (%r13), %eax
jg 0xb6a1
movl %r15d, %edi
movq %rbx, %rsi
movl %r14d, %edx
callq 0xc82a
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
orl %ecx, %ebp
movl (%r12), %eax
incl %eax
jmp 0xb678
orl $-0x1, (%r12)
xorl %eax, %eax
testl %ebp, %ebp
sete %al
leal (%rax,%rax,2), %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq