// File: /workspace/github_c_makefile_star2_O3/mmayer[P]pcal/src/pcal.c
// Function: check_numargs
int check_numargs (void)
{
   /* Validate non-flag (numeric) parameters */
   
   struct tm *p_tm;   /* for getting current month/year */
   time_t tmp;
   int params_ok = TRUE;   /* return value */
   
   switch (nargs) {
   case 0:   /* no arguments - print current month and/or year */
      time(&tmp);
      p_tm = localtime(&tmp);
      init_month = p_tm->tm_mon + 1;
      /* revised to conform to standard Un*x behavior 01/25/00 */
      /* init_year = century() + (p_tm->tm_year % 100); */
      init_year = TM_YEAR + p_tm->tm_year;
      nmonths = 1;
      break;
      
   case 1:   /* one argument - print entire year */
      init_month = JAN;
      init_year = numargs[0];
      nmonths = 12;
      break;
      
   default:   /* two or three arguments - print one or more months */
      init_month = numargs[0];
      init_year = numargs[1];
      nmonths = nargs > 2 ? numargs[2] : 1;
      break;
   }

   if (nmonths < 1) nmonths = 1;   /* ensure at least one month */
      
   /* check range of month and year */
   
   if (init_month < JAN || init_month > DEC) {
      fprintf(stderr, E_ILL_MONTH, progname, init_month, JAN, DEC);
      params_ok = FALSE;
   }
   
   if (init_year >= 0 && init_year < 100) {   /* treat nn as CCnn */
      init_year += century();
   }
   
   if (init_year < MIN_YR || init_year > MAX_YR) {
      fprintf(stderr, E_ILL_YEAR, progname, init_year, MIN_YR, MAX_YR);
      params_ok = FALSE;
   }
   
   return params_ok;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl 0x2621f(%rip), %esi     # 0x2d920
cmpl $0x1, %esi
je 0x7742
testl %esi, %esi
jne 0x7769
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x5230
movq %rbx, %rdi
callq 0x5070
movq %rax, %rdx
movl 0x10(%rax), %ecx
incl %ecx
movl %ecx, 0x26d67(%rip)     # 0x2e494
movl $0x76c, %eax            # imm = 0x76C
addl 0x14(%rdx), %eax
movl %eax, 0x26d5d(%rip)     # 0x2e498
movl $0x1, %edx
jmp 0x7798
movl $0x1, 0x26d48(%rip)     # 0x2e494
movl 0x261d2(%rip), %eax     # 0x2d924
movl %eax, 0x26d40(%rip)     # 0x2e498
movl $0xc, 0x26d3a(%rip)     # 0x2e49c
movl $0x1, %ebx
jmp 0x77ab
movl 0x261b5(%rip), %ecx     # 0x2d924
movl %ecx, 0x26d1f(%rip)     # 0x2e494
movl 0x261ad(%rip), %eax     # 0x2d928
movl 0x261ab(%rip), %edx     # 0x2d92c
cmpl $0x2, %edx
movl $0x1, %edi
cmovll %edi, %edx
movl %eax, 0x26d06(%rip)     # 0x2e498
cmpl $0x3, %esi
cmovll %edi, %edx
movl %edx, 0x26cfe(%rip)     # 0x2e49c
leal -0xd(%rcx), %edx
movl $0x1, %ebx
cmpl $-0xd, %edx
jbe 0x7808
cmpl $0x63, %eax
ja 0x77c1
callq 0xaee9
addl 0x26cdd(%rip), %eax     # 0x2e498
movl %eax, 0x26cd7(%rip)     # 0x2e498
leal -0x2710(%rax), %ecx
cmpl $0xffffdfc8, %ecx       # imm = 0xFFFFDFC8
jbe 0x77d7
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
retq
movq 0x21812(%rip), %rcx     # 0x28ff0
movq (%rcx), %rdi
leaq 0xf8b4(%rip), %rsi      # 0x1709c
leaq 0x26041(%rip), %rdx     # 0x2d830
xorl %ebx, %ebx
movl %eax, %ecx
movl $0x6d9, %r8d            # imm = 0x6D9
movl $0x270f, %r9d           # imm = 0x270F
xorl %eax, %eax
callq 0x5210
jmp 0x77cf
movq 0x217e1(%rip), %rax     # 0x28ff0
movq (%rax), %rdi
leaq 0xf85f(%rip), %rsi      # 0x17078
leaq 0x26010(%rip), %rdx     # 0x2d830
xorl %ebx, %ebx
movl $0x1, %r8d
movl $0xc, %r9d
xorl %eax, %eax
callq 0x5210
movl 0x26c5d(%rip), %eax     # 0x2e498
jmp 0x77ab