// File: /workspace/github_c_makefile_star2_O0/mmayer[P]pcal/src/readfile.c
// Function: parse_date
int parse_date (char **pword, int *ptype, char ***pptext)
{
   int mm, dd, yy;
   int token, n, v, ord, val, wkd, rtn;
   date_str *pdate;
   char *cp;
   
   pdate = candidate_dates;
   curr_year_reset = FALSE;   /* set below if date is dd/mm/yy */
   
   switch (token = date_type(*pword, &n, &v)) {
      
   case DT_MONTH:   /* <month> dd */
      if (date_style != USA_DATES) return PARSE_INVLINE;

      if ((cp = *++pword) == NULL) return PARSE_INVLINE;
      
      ADD_DATE(n, atoi(cp), curr_year);
      TERM_DATES;
      
      break;

   case DT_DATE:   /* mm/dd{/yy} | dd/mm{/yy} */
      n = split_date(*pword,
                     date_style == USA_DATES ? &mm : &dd,
                     date_style == USA_DATES ? &dd : &mm,
                     &yy);
      
      if (n > 2) {   /* year present? */
         if (yy < 100) yy += century();
         curr_year = yy;   /* reset current year */
         curr_year_reset = TRUE;
      }
      
      ADD_DATE(mm, dd, curr_year);
      TERM_DATES;
      
      break;

   case DT_EURDATE:   /* dd [ <month> | "all" ] */
      if (date_style != EUR_DATES) return PARSE_INVLINE;
      
      dd = atoi(*pword);
      
      if (get_keywd(*++pword) == DT_ALL) {
         for (mm = JAN; mm <= DEC; mm++) {   /* wildcard */
            ADD_DATE(mm, dd, curr_year);
         }
      }
      else {   /* one month */
         if ((mm = get_month(*pword, TRUE, FALSE)) == NOT_MONTH) return PARSE_INVLINE;

         ADD_DATE(mm, dd, curr_year);
      }
      
      TERM_DATES;
      break;
      
   case DT_ALL:   
      /* "all" <weekday> "in" [ <month> | "all" ] or "all" <day>" */
      if ((cp = *(pword+1)) && (*(cp += strspn(cp, DIGITS)) == '\0' || *cp == '*')) {
         dd = atoi(*++pword);   /* "all" <day> */
         for (mm = JAN; mm <= DEC; mm++) ADD_DATE(mm, dd, curr_year);
         TERM_DATES;
         break;   /* leave switch */
      }
      
      n = ORD_ALL;   /* "all" <weekday> ... */
      v = 0;
      /* fall through */
      
   case DT_ORDINAL:   
      /* 
         <ordinal> <weekday> in [ <month> | "all" ] 
            or 
         <ordinal> <weekday> <prep> <date> 
      */
      ord = n;
      val = v;

      /* disambiguate above cases based on preposition */
      if (ord == ORD_POSNUM && pword[1] && (get_prep(pword[2]) != PR_OTHER)) {
         if ((wkd = get_weekday(pword[1], TRUE)) == NOT_WEEKDAY) return PARSE_INVLINE;
         return parse_rel(val, wkd, pword += 2, ptype, pptext);
      }
      if ((rtn = parse_ord(ord, val, pword + 1)) != PARSE_OK) return rtn;
      
      pword += 3;   /* last word of date */
      break;
      
   case DT_WEEKDAY:   /* <weekday> <prep> <date> */
      wkd = n;
      /* parse_rel() calls parse_date() recursively */
      return parse_rel(1, wkd, ++pword, ptype, pptext);
      break;
      
   case DT_PREDEF_EVENT:   /* predefined event */
      /*
         predefined events will either have a redefinition string or a
         dispatch function - never both (cf. pcallang.h)
      */
      if (predef_events[n].pfcn == NULL) {
         char redef[STRSIZ], *rwords[20], **pdum;
         int rtn, idum;

         /* tokenize local copy of redefinition string */
         strcpy(redef, predef_events[n].def);
         (void) loadwords(rwords, redef);

         /* call parse_date() recursively to parse the redefinition - if OK,
            drop through to fill in real ptype and pptext from original string
            (this works basically because the holiday is always the last token
            before the text)
         */
         if ((rtn = parse_date(rwords, &idum, &pdum)) != PARSE_OK) return rtn;
      } 
      else {
         /* predefined event has a dispatch function - use it */
         pdate += (*predef_events[n].pfcn)(pdate);
         TERM_DATES;
      }
      break;
      
   default:
      return PARSE_INVLINE;
      break;
   }

   /* at this point, pword points to the last component of the date; fill in
      type code and pointer to following word (start of text)
   */
   *ptype = LASTCHAR(*pword) == '*' ? HOLIDAY_TEXT : DAY_TEXT;
   *pptext = ++pword;
   
   return PARSE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x210, %rsp            # imm = 0x210
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
leaq 0x231b2(%rip), %rax     # 0x33f00
movq %rax, -0x50(%rbp)
movl $0x0, 0x242dc(%rip)     # 0x35038
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq -0x34(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x10050
movl %eax, -0x30(%rbp)
movl %eax, %ecx
movq %rcx, -0x1d8(%rbp)
subl $0xa, %eax
ja 0x11444
movq -0x1d8(%rbp), %rax
leaq 0x14005(%rip), %rcx     # 0x24d98
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x218c9(%rip), %rax     # 0x3266c
cmpl $0x0, (%rax)
je 0x10db4
movl $0x2, -0x4(%rbp)
jmp 0x114a6
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x10(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
jne 0x10ddd
movl $0x2, -0x4(%rbp)
jmp 0x114a6
jmp 0x10ddf
leaq 0x21976(%rip), %rax     # 0x3275c
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x10e46
movq 0x1d201(%rip), %rax     # 0x2dff8
movq (%rax), %rax
movq %rax, -0x1e8(%rbp)
leaq 0x22858(%rip), %rax     # 0x33660
movl (%rax), %eax
movl %eax, -0x1e0(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x1dc(%rbp)
movq -0x58(%rbp), %rdi
callq 0x5280
movq -0x1e8(%rbp), %rdi
movl -0x1e0(%rbp), %edx
movl -0x1dc(%rbp), %ecx
movl %eax, %r8d
leaq 0x14148(%rip), %rsi     # 0x24f87
movb $0x0, %al
callq 0x51b0
movl -0x34(%rbp), %ecx
movq -0x50(%rbp), %rax
movl %ecx, (%rax)
movq -0x58(%rbp), %rdi
callq 0x5280
movl %eax, %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x4(%rax)
leaq 0x227f8(%rip), %rax     # 0x33660
movl (%rax), %ecx
movq -0x50(%rbp), %rax
movq %rax, %rdx
addq $0xc, %rdx
movq %rdx, -0x50(%rbp)
movl %ecx, 0x8(%rax)
movq -0x50(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x50(%rbp), %rax
movl $0x0, 0x4(%rax)
movq -0x50(%rbp), %rax
movl $0x0, (%rax)
jmp 0x1144d
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x1f0(%rbp)
leaq 0x217b6(%rip), %rax     # 0x3266c
cmpl $0x0, (%rax)
jne 0x10ec8
leaq -0x24(%rbp), %rax
movq %rax, -0x1f8(%rbp)
jmp 0x10ed5
leaq -0x28(%rbp), %rax
movq %rax, -0x1f8(%rbp)
jmp 0x10ed5
movq -0x1f8(%rbp), %rax
movq %rax, -0x200(%rbp)
leaq 0x21782(%rip), %rax     # 0x3266c
cmpl $0x0, (%rax)
jne 0x10efc
leaq -0x28(%rbp), %rax
movq %rax, -0x208(%rbp)
jmp 0x10f09
leaq -0x24(%rbp), %rax
movq %rax, -0x208(%rbp)
jmp 0x10f09
movq -0x200(%rbp), %rsi
movq -0x1f0(%rbp), %rdi
movq -0x208(%rbp), %rdx
leaq -0x2c(%rbp), %rcx
callq 0xc9d0
movl %eax, -0x34(%rbp)
cmpl $0x2, -0x34(%rbp)
jle 0x10f57
cmpl $0x64, -0x2c(%rbp)
jge 0x10f41
callq 0xc610
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %ecx
leaq 0x22715(%rip), %rax     # 0x33660
movl %ecx, (%rax)
movl $0x1, 0x240e1(%rip)     # 0x35038
jmp 0x10f59
leaq 0x217fc(%rip), %rax     # 0x3275c
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x10f92
movq 0x1d087(%rip), %rax     # 0x2dff8
movq (%rax), %rdi
leaq 0x226e5(%rip), %rax     # 0x33660
movl (%rax), %edx
movl -0x24(%rbp), %ecx
movl -0x28(%rbp), %r8d
leaq 0x13ffc(%rip), %rsi     # 0x24f87
movb $0x0, %al
callq 0x51b0
movl -0x24(%rbp), %ecx
movq -0x50(%rbp), %rax
movl %ecx, (%rax)
movl -0x28(%rbp), %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x4(%rax)
leaq 0x226b4(%rip), %rax     # 0x33660
movl (%rax), %ecx
movq -0x50(%rbp), %rax
movq %rax, %rdx
addq $0xc, %rdx
movq %rdx, -0x50(%rbp)
movl %ecx, 0x8(%rax)
movq -0x50(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x50(%rbp), %rax
movl $0x0, 0x4(%rax)
movq -0x50(%rbp), %rax
movl $0x0, (%rax)
jmp 0x1144d
leaq 0x21680(%rip), %rax     # 0x3266c
cmpl $0x1, (%rax)
je 0x10ffd
movl $0x2, -0x4(%rbp)
jmp 0x114a6
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x5280
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x10(%rbp)
movq 0x8(%rax), %rdi
callq 0xfae0
cmpl $0x0, %eax
jne 0x110b5
movl $0x1, -0x24(%rbp)
cmpl $0xc, -0x24(%rbp)
jg 0x110b0
jmp 0x1103c
leaq 0x21719(%rip), %rax     # 0x3275c
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x11075
movq 0x1cfa4(%rip), %rax     # 0x2dff8
movq (%rax), %rdi
leaq 0x22602(%rip), %rax     # 0x33660
movl (%rax), %edx
movl -0x24(%rbp), %ecx
movl -0x28(%rbp), %r8d
leaq 0x13f19(%rip), %rsi     # 0x24f87
movb $0x0, %al
callq 0x51b0
movl -0x24(%rbp), %ecx
movq -0x50(%rbp), %rax
movl %ecx, (%rax)
movl -0x28(%rbp), %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x4(%rax)
leaq 0x225d1(%rip), %rax     # 0x33660
movl (%rax), %ecx
movq -0x50(%rbp), %rax
movq %rax, %rdx
addq $0xc, %rdx
movq %rdx, -0x50(%rbp)
movl %ecx, 0x8(%rax)
jmp 0x110a5
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x11034
jmp 0x11147
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0xf970
movl %eax, -0x24(%rbp)
cmpl $-0x1, %eax
jne 0x110dc
movl $0x2, -0x4(%rbp)
jmp 0x114a6
jmp 0x110de
leaq 0x21677(%rip), %rax     # 0x3275c
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x11117
movq 0x1cf02(%rip), %rax     # 0x2dff8
movq (%rax), %rdi
leaq 0x22560(%rip), %rax     # 0x33660
movl (%rax), %edx
movl -0x24(%rbp), %ecx
movl -0x28(%rbp), %r8d
leaq 0x13e77(%rip), %rsi     # 0x24f87
movb $0x0, %al
callq 0x51b0
movl -0x24(%rbp), %ecx
movq -0x50(%rbp), %rax
movl %ecx, (%rax)
movl -0x28(%rbp), %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x4(%rax)
leaq 0x2252f(%rip), %rax     # 0x33660
movl (%rax), %ecx
movq -0x50(%rbp), %rax
movq %rax, %rdx
addq $0xc, %rdx
movq %rdx, -0x50(%rbp)
movl %ecx, 0x8(%rax)
jmp 0x11147
movq -0x50(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x50(%rbp), %rax
movl $0x0, 0x4(%rax)
movq -0x50(%rbp), %rax
movl $0x0, (%rax)
jmp 0x1144d
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
je 0x1127f
movq -0x58(%rbp), %rdi
leaq 0xad27(%rip), %rsi      # 0x1beb4
callq 0x5160
movq %rax, %rcx
movq -0x58(%rbp), %rax
movq %rax, %rdx
addq %rcx, %rdx
movq %rdx, -0x58(%rbp)
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x111bc
movq -0x58(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2a, %eax
jne 0x1127f
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x10(%rbp)
movq 0x8(%rax), %rdi
callq 0x5280
movl %eax, -0x28(%rbp)
movl $0x1, -0x24(%rbp)
cmpl $0xc, -0x24(%rbp)
jg 0x1125a
jmp 0x111e6
leaq 0x2156f(%rip), %rax     # 0x3275c
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1121f
movq 0x1cdfa(%rip), %rax     # 0x2dff8
movq (%rax), %rdi
leaq 0x22458(%rip), %rax     # 0x33660
movl (%rax), %edx
movl -0x24(%rbp), %ecx
movl -0x28(%rbp), %r8d
leaq 0x13d6f(%rip), %rsi     # 0x24f87
movb $0x0, %al
callq 0x51b0
movl -0x24(%rbp), %ecx
movq -0x50(%rbp), %rax
movl %ecx, (%rax)
movl -0x28(%rbp), %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x4(%rax)
leaq 0x22427(%rip), %rax     # 0x33660
movl (%rax), %ecx
movq -0x50(%rbp), %rax
movq %rax, %rdx
addq $0xc, %rdx
movq %rdx, -0x50(%rbp)
movl %ecx, 0x8(%rax)
jmp 0x1124f
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x111de
movq -0x50(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x50(%rbp), %rax
movl $0x0, 0x4(%rax)
movq -0x50(%rbp), %rax
movl $0x0, (%rax)
jmp 0x1144d
movl $0x4, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x40(%rbp)
cmpl $0x1, -0x3c(%rbp)
jne 0x11309
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x11309
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xff30
cmpl $-0x1, %eax
je 0x11309
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x1, %esi
callq 0xfb80
movl %eax, -0x44(%rbp)
cmpl $-0x1, %eax
jne 0x112e2
movl $0x2, -0x4(%rbp)
jmp 0x114a6
movl -0x40(%rbp), %edi
movl -0x44(%rbp), %esi
movq -0x10(%rbp), %rdx
addq $0x10, %rdx
movq %rdx, -0x10(%rbp)
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
callq 0x11a80
movl %eax, -0x4(%rbp)
jmp 0x114a6
movl -0x3c(%rbp), %edi
movl -0x40(%rbp), %esi
movq -0x10(%rbp), %rdx
addq $0x8, %rdx
callq 0x114c0
movl %eax, -0x48(%rbp)
cmpl $0x0, %eax
je 0x1132f
movl -0x48(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x114a6
movq -0x10(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x10(%rbp)
jmp 0x1144d
movl -0x34(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %esi
movq -0x10(%rbp), %rdx
addq $0x8, %rdx
movq %rdx, -0x10(%rbp)
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
movl $0x1, %edi
callq 0x11a80
movl %eax, -0x4(%rbp)
jmp 0x114a6
movslq -0x34(%rbp), %rcx
leaq 0x1d5d6(%rip), %rax     # 0x2e950
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x10(%rax)
jne 0x113f2
leaq -0x120(%rbp), %rdi
movslq -0x34(%rbp), %rcx
leaq 0x1d5b6(%rip), %rax     # 0x2e950
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
callq 0x5080
leaq -0x1c0(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0xc660
leaq -0x1c0(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
leaq -0x1c8(%rbp), %rdx
callq 0x10d30
movl %eax, -0x1cc(%rbp)
cmpl $0x0, %eax
je 0x113f0
movl -0x1cc(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x114a6
jmp 0x11442
movslq -0x34(%rbp), %rcx
leaq 0x1d553(%rip), %rax     # 0x2e950
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rdi
callq *%rax
movl %eax, %ecx
movq -0x50(%rbp), %rax
movslq %ecx, %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x50(%rbp), %rax
movl $0x0, 0x4(%rax)
movq -0x50(%rbp), %rax
movl $0x0, (%rax)
jmp 0x1144d
movl $0x2, -0x4(%rbp)
jmp 0x114a6
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x210(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x50e0
movq %rax, %rcx
movq -0x210(%rbp), %rax
subq $0x1, %rcx
movsbl (%rax,%rcx), %edx
xorl %ecx, %ecx
movl $0x1, %eax
cmpl $0x2a, %edx
cmovel %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rcx
addq $0x8, %rcx
movq %rcx, -0x10(%rbp)
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x210, %rsp            # imm = 0x210
popq %rbp
retq
nopw %cs:(%rax,%rax)