// File: /workspace/github_c_makefile_star2_O0/mmayer[P]pcal/src/readfile.c
// Function: date_type
int date_type (char *cp, int *pn, int *pv)
{
   int n, v;
   
   /* look for weekdays first, to catch wildcards "1q", "3q", etc. */
   if ((n = get_weekday(cp, TRUE)) != NOT_WEEKDAY) {   /* weekday name? */
      return (*pn = n, DT_WEEKDAY);
   }
   
   if ((n = get_predef_event(cp)) != NOT_PREDEF_EVENT) {   /* pre-defined event? */
      return (*pn = n, DT_PREDEF_EVENT);
   }
   
   if ((n = get_ordinal(cp, &v)) != ORD_OTHER) {   /* ordinal? */
      return (*pn = n, *pv = v, DT_ORDINAL);
   }
   
   if (isdigit((int)*cp)) {   /* other digit? */
      return (IS_NUMERIC(cp) ||
              (date_style == EUR_DATES && IS_EURDATE(cp))) ?
         DT_EURDATE : DT_DATE;
   }
   
   /* "all" can be either a keyword or a month wildcard - look for the former
      usage first */
   
   if ((n = get_keywd(cp)) != DT_OTHER) return n;
   
   if ((n = get_month(cp, FALSE, FALSE)) != NOT_MONTH) {   /* month name? */
      return (*pn = n, DT_MONTH);
   }
   
   return DT_OTHER;   /* unrecognized keyword - give up */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0xfb80
movl %eax, -0x24(%rbp)
cmpl $-0x1, %eax
je 0x1008f
movl -0x24(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl $0x9, -0x4(%rbp)
jmp 0x1022d
movq -0x10(%rbp), %rdi
callq 0xffb0
movl %eax, -0x24(%rbp)
cmpl $-0x1, %eax
je 0x100b5
movl -0x24(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl $0xa, -0x4(%rbp)
jmp 0x1022d
movq -0x10(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0xfdb0
movl %eax, -0x24(%rbp)
cmpl $0x0, %eax
je 0x100e8
movl -0x24(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl -0x28(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl $0x8, -0x4(%rbp)
jmp 0x1022d
callq 0x52e0
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x101e6
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xbd95(%rip), %rsi      # 0x1beb4
callq 0x5160
movq %rax, %rcx
movq -0x38(%rbp), %rax
movsbl (%rax,%rcx), %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x29(%rbp)
je 0x101ce
xorl %eax, %eax
leaq 0x22526(%rip), %rcx     # 0x3266c
cmpl $0x1, (%rcx)
movb %al, -0x39(%rbp)
jne 0x101c8
callq 0x52e0
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xbd47(%rip), %rsi      # 0x1beb4
callq 0x5160
movq -0x50(%rbp), %rcx
movq %rax, %rdx
movq -0x48(%rbp), %rax
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %ecx
andl $0x4, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x3a(%rbp)
je 0x101c2
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xbd0c(%rip), %rsi      # 0x1beb4
callq 0x5160
movq %rax, %rcx
movq -0x58(%rbp), %rax
movsbl 0x1(%rax,%rcx), %eax
cmpl $0x0, %eax
sete %al
movb %al, -0x3a(%rbp)
movb -0x3a(%rbp), %al
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %dl
movl $0x6, %eax
movl $0x7, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x1022d
movq -0x10(%rbp), %rdi
callq 0xfae0
movl %eax, -0x24(%rbp)
cmpl $-0x1, %eax
je 0x101ff
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1022d
movq -0x10(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0xf970
movl %eax, -0x24(%rbp)
cmpl $-0x1, %eax
je 0x10226
movl -0x24(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x1022d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)