// File: /workspace/github_c_makefile_star2_O1/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 0x257a7(%rip), %ecx     # 0x2c920
cmpl $0x1, %ecx
je 0x71b7
testl %ecx, %ecx
jne 0x71d4
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x5230
movq %rbx, %rdi
callq 0x5070
movl 0x10(%rax), %ecx
incl %ecx
movl %ecx, 0x262f2(%rip)     # 0x2d494
movl $0x76c, %ecx            # imm = 0x76C
addl 0x14(%rax), %ecx
movl %ecx, 0x262e8(%rip)     # 0x2d498
movl $0x1, %eax
jmp 0x71fc
movl $0x1, 0x262d3(%rip)     # 0x2d494
movl 0x2575d(%rip), %eax     # 0x2c924
movl %eax, 0x262cb(%rip)     # 0x2d498
movl $0xc, %eax
jmp 0x71fc
movl 0x2574a(%rip), %eax     # 0x2c924
movl %eax, 0x262b4(%rip)     # 0x2d494
movl 0x25742(%rip), %eax     # 0x2c928
movl %eax, 0x262ac(%rip)     # 0x2d498
movl $0x1, %eax
cmpl $0x3, %ecx
jl 0x71fc
movl 0x25730(%rip), %eax     # 0x2c92c
cmpl $0x2, %eax
movl $0x1, %ebx
cmovll %ebx, %eax
movl %eax, 0x2628f(%rip)     # 0x2d49c
movl 0x26281(%rip), %ecx     # 0x2d494
leal -0xd(%rcx), %eax
cmpl $-0xd, %eax
jbe 0x724a
cmpl $0x63, 0x26276(%rip)    # 0x2d498
ja 0x722f
callq 0xa92f
addl %eax, 0x26269(%rip)     # 0x2d498
movl 0x26263(%rip), %ecx     # 0x2d498
leal -0x2710(%rcx), %eax
cmpl $0xffffdfc8, %eax       # imm = 0xFFFFDFC8
jbe 0x7279
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
retq
movq 0x20d9f(%rip), %rax     # 0x27ff0
movq (%rax), %rdi
leaq 0xedc5(%rip), %rsi      # 0x16020
leaq 0x255ce(%rip), %rdx     # 0x2c830
xorl %ebx, %ebx
movl $0x1, %r8d
movl $0xc, %r9d
xorl %eax, %eax
callq 0x5210
jmp 0x721b
movq 0x20d70(%rip), %rax     # 0x27ff0
movq (%rax), %rdi
leaq 0xedba(%rip), %rsi      # 0x16044
leaq 0x2559f(%rip), %rdx     # 0x2c830
xorl %ebx, %ebx
movl $0x6d9, %r8d            # imm = 0x6D9
movl $0x270f, %r9d           # imm = 0x270F
xorl %eax, %eax
callq 0x5210
jmp 0x7242