// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x1, -0x14(%rbp)
movl 0x2b1fb(%rip), %eax     # 0x329a0
movl %eax, -0x18(%rbp)
testl %eax, %eax
je 0x77b8
jmp 0x77ae
movl -0x18(%rbp), %eax
subl $0x1, %eax
je 0x77fc
jmp 0x781e
leaq -0x10(%rbp), %rdi
callq 0x51d0
leaq -0x10(%rbp), %rdi
callq 0x5050
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
addl $0x1, %eax
movl %eax, 0x2bd36(%rip)     # 0x33514
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
addl $0x76c, %eax            # imm = 0x76C
movl %eax, 0x2bd28(%rip)     # 0x33518
movl $0x1, 0x2bd22(%rip)     # 0x3351c
jmp 0x785d
movl $0x1, 0x2bd0e(%rip)     # 0x33514
movl 0x2b198(%rip), %eax     # 0x329a4
movl %eax, 0x2bd06(%rip)     # 0x33518
movl $0xc, 0x2bd00(%rip)     # 0x3351c
jmp 0x785d
movl 0x2b180(%rip), %eax     # 0x329a4
movl %eax, 0x2bcea(%rip)     # 0x33514
movl 0x2b178(%rip), %eax     # 0x329a8
movl %eax, 0x2bce2(%rip)     # 0x33518
cmpl $0x2, 0x2b163(%rip)     # 0x329a0
jle 0x784a
movl 0x2b167(%rip), %eax     # 0x329ac
movl %eax, -0x1c(%rbp)
jmp 0x7854
movl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x7854
movl -0x1c(%rbp), %eax
movl %eax, 0x2bcbf(%rip)     # 0x3351c
cmpl $0x1, 0x2bcb8(%rip)     # 0x3351c
jge 0x7870
movl $0x1, 0x2bcac(%rip)     # 0x3351c
cmpl $0x1, 0x2bc9d(%rip)     # 0x33514
jl 0x7882
cmpl $0xc, 0x2bc94(%rip)     # 0x33514
jle 0x78ba
movq 0x2676f(%rip), %rax     # 0x2dff8
movq (%rax), %rdi
movl 0x2bc82(%rip), %ecx     # 0x33514
leaq 0x1479a(%rip), %rsi     # 0x1c033
leaq 0x2b010(%rip), %rdx     # 0x328b0
movl $0x1, %r8d
movl $0xc, %r9d
movb $0x0, %al
callq 0x51b0
movl $0x0, -0x14(%rbp)
cmpl $0x0, 0x2bc57(%rip)     # 0x33518
jl 0x78dd
cmpl $0x64, 0x2bc4e(%rip)    # 0x33518
jge 0x78dd
callq 0xc610
addl 0x2bc41(%rip), %eax     # 0x33518
movl %eax, 0x2bc3b(%rip)     # 0x33518
cmpl $0x6d9, 0x2bc31(%rip)   # imm = 0x6D9
jl 0x78f5
cmpl $0x270f, 0x2bc25(%rip)  # imm = 0x270F
jle 0x792d
movq 0x266fc(%rip), %rax     # 0x2dff8
movq (%rax), %rdi
movl 0x2bc13(%rip), %ecx     # 0x33518
leaq 0x1474b(%rip), %rsi     # 0x1c057
leaq 0x2af9d(%rip), %rdx     # 0x328b0
movl $0x6d9, %r8d            # imm = 0x6D9
movl $0x270f, %r9d           # imm = 0x270F
movb $0x0, %al
callq 0x51b0
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)