// File: /workspace/github_c_makefile_star2_O3/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 0xd2ce
incl %eax
cmpl $0xc, %eax
ja 0xc36d
movl $0x2, %ebp
leaq 0x1398f(%rip), %rcx     # 0x1fc88
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r15, %rdi
movl $0x2f, %esi
callq 0x5150
testq %rax, %rax
je 0xc4c6
incq %rax
movq %rax, %rdi
callq 0x52d0
movl %eax, %r14d
jmp 0xc4c9
xorl %ebp, %ebp
movq %rbx, %rdi
movl $0x10, %esi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x67d0
testl %eax, %eax
jne 0xc51e
movq 0x1cca2(%rip), %rax     # 0x28ff0
movq (%rax), %rdi
xorl %esi, %esi
callq 0x6156
movl $0x1, %edi
callq 0x5300
addq $0x8, %rbx
movb $0x1, 0x23c47(%rip)     # 0x2ffb4
leaq 0x2226c(%rip), %r12     # 0x2e5e0
cmpl $-0x1, (%r12)
je 0xc419
leaq 0x4(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0xd8ff
movl %eax, %ebp
jmp 0xc48d
cmpq $0x0, 0x8(%rbx)
je 0xc51e
leaq 0x20bd6(%rip), %r14     # 0x2cf80
xorl %r15d, %r15d
movq 0x8(%rbx), %rsi
movq %r14, %rdi
movl $0x2, %edx
callq 0xa340
testl %eax, %eax
je 0xc512
incq %r15
addq $0x14, %r14
cmpq $0x18, %r15
jne 0xc3ad
movl $0x2, %ebp
jmp 0xc51e
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
je 0xc499
movq %rbx, %rdi
callq 0x52d0
testl %eax, %eax
jle 0xc499
movl %eax, %r14d
cmpl $0x63, %eax
ja 0xc40a
callq 0xaee9
addl %eax, %r14d
leaq 0x221cf(%rip), %rax     # 0x2e5e0
movl %r14d, (%rax)
jmp 0xc51c
leaq 0x22078(%rip), %rax     # 0x2e498
movl (%rax), %eax
movl %eax, (%r12)
leaq 0x221af(%rip), %r13     # 0x2e5dc
movl $0x3, %ebp
cmpl (%r13), %eax
jg 0xc485
xorl %ecx, %ecx
leaq 0x4(%rsp), %r14
leaq 0x8(%rsp), %r15
movl %ecx, %ebp
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0xd8ff
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
orl %ebp, %ecx
cmpb $0x1, 0x23b54(%rip)     # 0x2ffb8
je 0xc58c
movl (%r12), %eax
leal 0x1(%rax), %edx
movl %edx, (%r12)
cmpl (%r13), %eax
jl 0xc444
xorl %eax, %eax
testl %ecx, %ecx
sete %al
leal (%rax,%rax,2), %ebp
movl $0xffffffff, (%r12)     # imm = 0xFFFFFFFF
movb $0x0, 0x23b20(%rip)     # 0x2ffb4
jmp 0xc51e
leaq 0x13d71(%rip), %rsi     # 0x20211
movq %rbx, %rdi
callq 0x5200
testl %eax, %eax
je 0xc4b7
cmpb $0x2a, (%rbx)
jne 0xc51e
cmpb $0x0, 0x1(%rbx)
jne 0xc51e
leaq 0x22122(%rip), %rax     # 0x2e5e0
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
jmp 0xc51c
xorl %r14d, %r14d
movq 0x8(%rbx), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0xcebe
cmpl $-0x1, %eax
je 0xc51e
movl %eax, %r15d
addq $0x8, %rbx
leaq 0x220f1(%rip), %r12     # 0x2e5e0
cmpl $-0x1, (%r12)
je 0xc52f
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 0xd856
leaq 0x222f7(%rip), %rax     # 0x2e810
movl %r15d, (%rax)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x21f62(%rip), %rax     # 0x2e498
movl (%rax), %eax
movl %eax, (%r12)
leaq 0x22099(%rip), %r13     # 0x2e5dc
movl $0x3, %ebp
cmpl (%r13), %eax
jg 0xc582
xorl %ebp, %ebp
movl %r15d, %edi
movq %rbx, %rsi
movl %r14d, %edx
callq 0xd856
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
orl %ecx, %ebp
movl (%r12), %eax
leal 0x1(%rax), %ecx
movl %ecx, (%r12)
cmpl (%r13), %eax
jl 0xc550
xorl %eax, %eax
testl %ebp, %ebp
sete %al
leal (%rax,%rax,2), %ebp
movl $0xffffffff, (%r12)     # imm = 0xFFFFFFFF
jmp 0xc51e
xorl %eax, %eax
testl %ecx, %ecx
sete %al
leal (%rax,%rax,2), %ebp
jmp 0xc51e