// File: /workspace/github_c_makefile_star2_O1/mmayer[P]pcal/src/writefil.c
// Function: print_month
void print_month (int month, int year)
{
   static int nmonths = 0;
#ifdef EPS_DSC
   static int page = 0;
#endif
   int startbox;

#ifdef EPS_DSC
   /* start of new physical page? */
   if (!do_whole_year || nmonths % 12 == 0) {
      page++;
      printf("%%%%Page: %d %d\n", page, page);
      printf("%%%%BeginPageSetup\n");
      printf("clear flush\n");
      printf("/PageNum { %d } def\n", page);
      printf("/PageState save def\n");
      printf("%%%%EndPageSetup\n\n");
   }
#endif

   if (do_whole_year) {
      /* reset foot strings at start of each page */
      if (nmonths % 12 == 0) {
         def_footstring(lfoot, "Lfootstring");
         def_footstring(cfoot, "Cfootstring");
         def_footstring(rfoot, "Rfootstring");
         def_footstring(notes_hdr, "notesheading");
         printf("\n");
      }
   }
   
   /* set up year and month */
   printf("/year %d def\n", year);
   printf("/month %d def\n", month);
   
   /* move starting box to second row if conflict with small calendars */
   startbox = START_BOX(month, year);
   if (!do_whole_year &&
       (prev_cal_box[small_cal_pos] == startbox ||
        next_cal_box[small_cal_pos] == startbox)) {
      startbox += 7;
   }

   printf("/startbox %d def\n", startbox);
   printf("/ndays %d def\n", LENGTH_OF(month, year));
   
   find_noteboxes(month, year);   /* make list of note boxes */
   print_colors(month, year);   /* make list of date colors */

   /* Are we printing 12 months per page or only one? */
   if (do_whole_year) {
      printf("/posn %d def\n", nmonths % 12);   /* location on page */

      print_julian_info(month, year);   /* Julian date info */
      print_moon_info(month, year);   /* moon info */

      printf("printmonth\n\n");
   }
   else {
      /* reset foot strings each month (may change) */
      def_footstring(lfoot, "Lfootstring");
      def_footstring(cfoot, "Cfootstring");
      def_footstring(rfoot, "Rfootstring");
      def_footstring(notes_hdr, "notesheading");
      
      /* generate information necessary for small calendars */
      
      if (small_cal_pos != SC_NONE) {
         int m, y;
         
         printf("/p_year %d def\n", y = PREV_YEAR(month, year));
         printf("/p_month %d def\n", m = PREV_MONTH(month, year));
         printf("/p_startbox %d def\n", START_BOX(m, y));
         printf("/p_ndays %d def\n", LENGTH_OF(m, y));
         
         printf("/n_year %d def\n", y = NEXT_YEAR(month, year));
         printf("/n_month %d def\n", m = NEXT_MONTH(month, year));
         printf("/n_startbox %d def\n", START_BOX(m, y));
         printf("/n_ndays %d def\n", LENGTH_OF(m, y));
      }

      print_julian_info(month, year);   /* Julian date info */
      print_moon_info(month, year);   /* moon info */
      
      printf("printmonth\n");
      find_daytext(month, year, TRUE);   /* holiday text */
      find_daytext(month, year, FALSE);   /* day and note text */
      find_images(month, year);   /* EPS images */
   }
   
   /* end of physical page? */
   if (!do_whole_year || ++nmonths % 12 == 0) {
#ifdef EPS_DSC
      printf("%%%%PageTrailer\n");
      printf("showpage\n");
      printf("clear flush\n");
      printf("PageState restore\n");
#else
      printf("showpage\n");
#endif
   }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %r14d
leaq 0x1aa8c(%rip), %r13     # 0x2c6c4
cmpl $0x0, (%r13)
je 0x11c58
imull $0xaaaaaaab, 0x1d48f(%rip), %eax # imm = 0xAAAAAAAB
addl $0x2aaaaaa8, %eax       # imm = 0x2AAAAAA8
rorl $0x2, %eax
cmpl $0x15555554, %eax       # imm = 0x15555554
ja 0x11cbe
movl 0x1d47e(%rip), %edx     # 0x2f0dc
incl %edx
movl %edx, 0x1d476(%rip)     # 0x2f0dc
leaq 0x109a9(%rip), %rdi     # 0x22616
movl %edx, %esi
xorl %eax, %eax
callq 0x5130
leaq 0x109aa(%rip), %rdi     # 0x22627
xorl %eax, %eax
callq 0x5130
leaq 0x129a1(%rip), %rdi     # 0x2462c
callq 0x50b0
movl 0x1d446(%rip), %esi     # 0x2f0dc
leaq 0x1099e(%rip), %rdi     # 0x2263b
xorl %eax, %eax
callq 0x5130
leaq 0x1294d(%rip), %rdi     # 0x245f8
callq 0x50b0
leaq 0x10999(%rip), %rdi     # 0x22650
xorl %eax, %eax
callq 0x5130
cmpl $0x0, (%r13)
je 0x11d34
imull $0xaaaaaaab, 0x1d409(%rip), %eax # imm = 0xAAAAAAAB
addl $0x2aaaaaa8, %eax       # imm = 0x2AAAAAA8
rorl $0x2, %eax
cmpl $0x15555554, %eax       # imm = 0x15555554
ja 0x11d34
leaq 0x1a69b(%rip), %rdi     # 0x2c380
leaq 0x10977(%rip), %rsi     # 0x22663
callq 0x1443a
leaq 0x1a758(%rip), %rdi     # 0x2c450
leaq 0x10970(%rip), %rsi     # 0x2266f
callq 0x1443a
leaq 0x1a815(%rip), %rdi     # 0x2c520
leaq 0x10969(%rip), %rsi     # 0x2267b
callq 0x1443a
leaq 0x1aa22(%rip), %rdi     # 0x2c740
leaq 0x10962(%rip), %rsi     # 0x22687
callq 0x1443a
movl $0xa, %edi
callq 0x5060
leaq 0x10959(%rip), %rdi     # 0x22694
xorl %ebp, %ebp
movl %ebx, %esi
xorl %eax, %eax
callq 0x5130
leaq 0x10955(%rip), %rdi     # 0x226a2
movl %r14d, %esi
xorl %eax, %eax
callq 0x5130
movl %r14d, %edi
movl $0x1, %esi
movl %ebx, %edx
callq 0xa53f
leaq 0x1a87b(%rip), %r12     # 0x2c5e8
movl (%r12), %ecx
movl %eax, %edx
subl %ecx, %edx
negl %ecx
addl %ecx, %eax
addl $0x7, %eax
cltq
imulq $-0x6db6db6d, %rax, %rax # imm = 0x92492493
shrq $0x20, %rax
addl %edx, %eax
addl $0x7, %eax
movl %eax, %ecx
shrl $0x1f, %ecx
sarl $0x2, %eax
addl %ecx, %eax
leal (,%rax,8), %ecx
subl %ecx, %eax
leal (%rax,%rdx), %esi
addl $0x7, %esi
cmpl $0x0, (%r13)
jne 0x11dd3
leaq 0x167f7(%rip), %rax     # 0x285ac
movslq (%rax), %rax
leaq 0x167f1(%rip), %rcx     # 0x285b0
cmpl %esi, (%rcx,%rax,4)
je 0x11dd0
leaq 0x167f5(%rip), %rcx     # 0x285c0
cmpl %esi, (%rcx,%rax,4)
jne 0x11dd3
addl $0x7, %esi
leaq 0x108d7(%rip), %rdi     # 0x226b1
xorl %eax, %eax
callq 0x5130
movslq %r14d, %r15
leaq 0x163d5(%rip), %rax     # 0x281c0
movsbl -0x1(%rax,%r15), %eax
movl %r14d, %ecx
xorl $0x2, %ecx
movl %ebx, %edx
andl $0x3, %edx
orl %ecx, %edx
jne 0x11e2d
imull $0xc28f5c29, %ebx, %ecx # imm = 0xC28F5C29
addl $0x51eb850, %ecx        # imm = 0x51EB850
movl %ecx, %edx
rorl $0x2, %edx
movl $0x1, %ebp
cmpl $0x28f5c28, %edx        # imm = 0x28F5C28
ja 0x11e2d
rorl $0x4, %ecx
xorl %ebp, %ebp
cmpl $0xa3d70b, %ecx         # imm = 0xA3D70B
setb %bpl
addl %eax, %ebp
leaq 0x1088d(%rip), %rdi     # 0x226c3
movl %ebp, %esi
xorl %eax, %eax
callq 0x5130
movl %r14d, %edi
movl %ebx, %esi
callq 0x14a47
movl %r14d, %edi
movl %ebx, %esi
callq 0x148a9
cmpl $0x0, (%r13)
je 0x11eb0
movslq 0x1d277(%rip), %rsi     # 0x2f0d8
imulq $0x2aaaaaab, %rsi, %rax # imm = 0x2AAAAAAB
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x21, %rax
addl %ecx, %eax
shll $0x2, %eax
leal (%rax,%rax,2), %eax
subl %eax, %esi
leaq 0x1084e(%rip), %rdi     # 0x226d2
xorl %eax, %eax
callq 0x5130
movl %r14d, %edi
movl %ebx, %esi
callq 0x14d53
movl %r14d, %edi
movl %ebx, %esi
callq 0x14ad8
leaq 0x12771(%rip), %rdi     # 0x24617
callq 0x50b0
jmp 0x12139
leaq 0x1a4c9(%rip), %rdi     # 0x2c380
leaq 0x107a5(%rip), %rsi     # 0x22663
callq 0x1443a
leaq 0x1a586(%rip), %rdi     # 0x2c450
leaq 0x1079e(%rip), %rsi     # 0x2266f
callq 0x1443a
leaq 0x1a643(%rip), %rdi     # 0x2c520
leaq 0x10797(%rip), %rsi     # 0x2267b
callq 0x1443a
leaq 0x1a850(%rip), %rdi     # 0x2c740
leaq 0x10790(%rip), %rsi     # 0x22687
callq 0x1443a
leaq 0x166a9(%rip), %rax     # 0x285ac
cmpl $0x0, (%rax)
je 0x120f4
decq %r15
xorl %eax, %eax
cmpl $0x1, %r14d
movq %r12, %r13
movl $0xc, %r12d
cmovnel %r15d, %r12d
sete %al
movl %ebx, %r15d
subl %eax, %r15d
leaq 0x107ae(%rip), %rdi     # 0x226e0
xorl %ebp, %ebp
movl %r15d, %esi
xorl %eax, %eax
callq 0x5130
leaq 0x107ab(%rip), %rdi     # 0x226f0
movl %r12d, %esi
xorl %eax, %eax
callq 0x5130
movl %r12d, %edi
movl $0x1, %esi
movl %r15d, %edx
callq 0xa53f
subl (%r13), %eax
movl %eax, %ecx
addl $0x7, %ecx
movslq %ecx, %rcx
imulq $-0x6db6db6d, %rcx, %rcx # imm = 0x92492493
shrq $0x20, %rcx
addl %eax, %ecx
addl $0x7, %ecx
movl %ecx, %edx
shrl $0x1f, %edx
sarl $0x2, %ecx
addl %edx, %ecx
leal (,%rcx,8), %edx
subl %edx, %ecx
leal (%rax,%rcx), %esi
addl $0x7, %esi
leaq 0x10766(%rip), %rdi     # 0x22701
xorl %eax, %eax
callq 0x5130
movslq %r12d, %rcx
leaq 0x16214(%rip), %r13     # 0x281c0
movsbl -0x1(%rcx,%r13), %eax
xorl $0x2, %ecx
movl %r15d, %edx
andl $0x3, %edx
orl %ecx, %edx
movl $0x0, %esi
jne 0x11ff2
imull $0xc28f5c29, %r15d, %ecx # imm = 0xC28F5C29
addl $0x51eb850, %ecx        # imm = 0x51EB850
movl %ecx, %edx
rorl $0x2, %edx
movl $0x1, %esi
cmpl $0x28f5c28, %edx        # imm = 0x28F5C28
ja 0x11ff2
rorl $0x4, %ecx
xorl %esi, %esi
cmpl $0xa3d70b, %ecx         # imm = 0xA3D70B
setb %sil
addl %eax, %esi
leaq 0x1071a(%rip), %rdi     # 0x22715
xorl %eax, %eax
callq 0x5130
leal 0x1(%r14), %r12d
xorl %r15d, %r15d
cmpl $0xc, %r14d
sete %r15b
movl $0x1, %eax
cmovel %eax, %r12d
addl %ebx, %r15d
leaq 0x10702(%rip), %rdi     # 0x22726
movl %r15d, %esi
xorl %eax, %eax
callq 0x5130
leaq 0x10701(%rip), %rdi     # 0x22736
movl %r12d, %esi
xorl %eax, %eax
callq 0x5130
movl %r12d, %edi
movl $0x1, %esi
movl %r15d, %edx
callq 0xa53f
leaq 0x1a592(%rip), %rcx     # 0x2c5e8
subl (%rcx), %eax
movl %eax, %ecx
addl $0x7, %ecx
movslq %ecx, %rcx
imulq $-0x6db6db6d, %rcx, %rcx # imm = 0x92492493
shrq $0x20, %rcx
addl %eax, %ecx
addl $0x7, %ecx
movl %ecx, %edx
shrl $0x1f, %edx
sarl $0x2, %ecx
addl %edx, %ecx
leal (,%rcx,8), %edx
subl %edx, %ecx
leal (%rax,%rcx), %esi
addl $0x7, %esi
leaq 0x106b7(%rip), %rdi     # 0x22747
xorl %eax, %eax
callq 0x5130
movslq %r12d, %rcx
movsbl -0x1(%rcx,%r13), %eax
xorl $0x2, %ecx
movl %r15d, %edx
andl $0x3, %edx
orl %ecx, %edx
jne 0x120db
imull $0xc28f5c29, %r15d, %ecx # imm = 0xC28F5C29
addl $0x51eb850, %ecx        # imm = 0x51EB850
movl %ecx, %edx
rorl $0x2, %edx
movl $0x1, %ebp
cmpl $0x28f5c28, %edx        # imm = 0x28F5C28
ja 0x120db
rorl $0x4, %ecx
xorl %ebp, %ebp
cmpl $0xa3d70b, %ecx         # imm = 0xA3D70B
setb %bpl
addl %eax, %ebp
leaq 0x10677(%rip), %rdi     # 0x2275b
movl %ebp, %esi
xorl %eax, %eax
callq 0x5130
leaq 0x1a5d0(%rip), %r13     # 0x2c6c4
movl %r14d, %edi
movl %ebx, %esi
callq 0x14d53
movl %r14d, %edi
movl %ebx, %esi
callq 0x14ad8
leaq 0x124fd(%rip), %rdi     # 0x2460c
callq 0x50b0
movl %r14d, %edi
movl %ebx, %esi
movl $0x1, %edx
callq 0x14562
movl %r14d, %edi
movl %ebx, %esi
xorl %edx, %edx
callq 0x14562
movl %r14d, %edi
movl %ebx, %esi
callq 0x14773
cmpl $0x0, (%r13)
je 0x12173
movl 0x1cf92(%rip), %eax     # 0x2f0d8
leal 0x1(%rax), %ecx
movl %ecx, 0x1cf89(%rip)     # 0x2f0d8
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
addl $0xd5555553, %eax       # imm = 0xD5555553
rorl $0x2, %eax
cmpl $0x15555554, %eax       # imm = 0x15555554
jbe 0x12173
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x105f2(%rip), %rdi     # 0x2276c
xorl %eax, %eax
callq 0x5130
leaq 0x1249b(%rip), %rdi     # 0x24623
callq 0x50b0
leaq 0x12498(%rip), %rdi     # 0x2462c
callq 0x50b0
leaq 0x12498(%rip), %rdi     # 0x24638
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x50b0