// File: /workspace/github_c_makefile_star2_O0/mmayer[P]pcal/src/readfile.c
// Function: get_weekday
int get_weekday (char *cp, int wild_ok)
{
   int w;
   
   if (!cp) return NOT_WEEKDAY;

   if (wild_ok) {   /* try wildcards first */
      for (w = WILD_FIRST_WKD; w <= WILD_LAST_WKD; w++) {
         if (ci_strncmp(cp, days[w], strlen(days[w])) == 0) return w;
      }
      if ((w = get_phase(cp)) != MOON_OTHER) return w + WILD_FIRST_MOON;
   }
   
   /* accept day names in the active 'input' language only */
   for (w = SUN; w <= SAT; w++) {
      int compare_count;
      /* To allow for proper detection of the day-of-week name in constructs
         from the configuration file like 'all Fridays in Oct' (i.e. with the
         plural form of the day-of-week name), we need to compare the fewest
         number of characters of the 2 strings.
      */
      compare_count = 
         (strlen(cp) < strlen(days_ml[input_language][w])) ? 
         strlen(cp) : strlen(days_ml[input_language][w]);
      
      if (ci_strncmp(cp, days_ml[input_language][w], compare_count) == 0) return w;
   }
   
   return NOT_WEEKDAY;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0xfba2
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xfd25
cmpl $0x0, -0x14(%rbp)
je 0xfc35
movl $0x7, -0x18(%rbp)
cmpl $0xd, -0x18(%rbp)
jg 0xfc14
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movslq -0x18(%rbp), %rcx
leaq 0x1eb94(%rip), %rax     # 0x2e760
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movslq -0x18(%rbp), %rcx
leaq 0x1eb81(%rip), %rax     # 0x2e760
movq (%rax,%rcx,8), %rdi
callq 0x50e0
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl %eax, %edx
callq 0xb3b0
cmpl $0x0, %eax
jne 0xfc07
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xfd25
jmp 0xfc09
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xfbb3
movq -0x10(%rbp), %rdi
callq 0xfd30
movl %eax, -0x18(%rbp)
cmpl $-0x1, %eax
je 0xfc33
movl -0x18(%rbp), %eax
addl $0xe, %eax
movl %eax, -0x4(%rbp)
jmp 0xfd25
jmp 0xfc35
movl $0x0, -0x18(%rbp)
cmpl $0x6, -0x18(%rbp)
jg 0xfd1e
movq -0x10(%rbp), %rdi
callq 0x50e0
movq %rax, -0x38(%rbp)
leaq 0x23c26(%rip), %rax     # 0x33880
movslq (%rax), %rax
leaq 0x208bc(%rip), %rdi     # 0x30520
imulq $0x8c, %rax, %rax
addq %rax, %rdi
movslq -0x18(%rbp), %rax
imulq $0x14, %rax, %rax
addq %rax, %rdi
callq 0x50e0
movq %rax, %rcx
movq -0x38(%rbp), %rax
cmpq %rcx, %rax
jae 0xfc99
movq -0x10(%rbp), %rdi
callq 0x50e0
movq %rax, -0x40(%rbp)
jmp 0xfcc8
leaq 0x23be0(%rip), %rax     # 0x33880
movslq (%rax), %rax
leaq 0x20876(%rip), %rdi     # 0x30520
imulq $0x8c, %rax, %rax
addq %rax, %rdi
movslq -0x18(%rbp), %rax
imulq $0x14, %rax, %rax
addq %rax, %rdi
callq 0x50e0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x23ba6(%rip), %rax     # 0x33880
movslq (%rax), %rax
leaq 0x2083c(%rip), %rsi     # 0x30520
imulq $0x8c, %rax, %rax
addq %rax, %rsi
movslq -0x18(%rbp), %rax
imulq $0x14, %rax, %rax
addq %rax, %rsi
movl -0x1c(%rbp), %edx
callq 0xb3b0
cmpl $0x0, %eax
jne 0xfd0e
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xfd25
jmp 0xfd10
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xfc3c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop