// File: /workspace/github_c_makefile_star2_O3/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 0x1b5f2(%rip), %r13     # 0x2d6c4
cmpl $0x0, (%r13)
je 0x120f2
imull $0xaaaaaaab, 0x1dff5(%rip), %eax # imm = 0xAAAAAAAB
addl $0x2aaaaaa8, %eax       # imm = 0x2AAAAAA8
rorl $0x2, %eax
cmpl $0x15555554, %eax       # imm = 0x15555554
ja 0x1215f
movl 0x1dfe4(%rip), %edx     # 0x300dc
incl %edx
movl %edx, 0x1dfdc(%rip)     # 0x300dc
leaq 0x1157f(%rip), %rdi     # 0x23686
movl %edx, %esi
xorl %eax, %eax
callq 0x5130
leaq 0x11580(%rip), %rdi     # 0x23697
xorl %eax, %eax
callq 0x5130
leaq 0x13577(%rip), %rdi     # 0x2569c
callq 0x50b0
movl 0x1dfac(%rip), %esi     # 0x300dc
leaq 0x11574(%rip), %rdi     # 0x236ab
xorl %eax, %eax
callq 0x5130
leaq 0x13523(%rip), %rdi     # 0x25668
callq 0x50b0
leaq 0x1156f(%rip), %rdi     # 0x236c0
xorl %eax, %eax
callq 0x5130
cmpl $0x0, (%r13)
je 0x121ce
imull $0xaaaaaaab, 0x1df6f(%rip), %eax # imm = 0xAAAAAAAB
addl $0x2aaaaaa8, %eax       # imm = 0x2AAAAAA8
rorl $0x2, %eax
cmpl $0x15555554, %eax       # imm = 0x15555554
ja 0x121ce
leaq 0x1b201(%rip), %rdi     # 0x2d380
leaq 0x1154d(%rip), %rsi     # 0x236d3
callq 0x148f9
leaq 0x1b2be(%rip), %rdi     # 0x2d450
leaq 0x11546(%rip), %rsi     # 0x236df
callq 0x148f9
leaq 0x1b37b(%rip), %rdi     # 0x2d520
leaq 0x1153f(%rip), %rsi     # 0x236eb
callq 0x148f9
leaq 0x1b588(%rip), %rdi     # 0x2d740
leaq 0x11538(%rip), %rsi     # 0x236f7
callq 0x148f9
movl $0xa, %edi
callq 0x5060
leaq 0x1152f(%rip), %rdi     # 0x23704
xorl %ebp, %ebp
movl %ebx, %esi
xorl %eax, %eax
callq 0x5130
leaq 0x1152b(%rip), %rdi     # 0x23712
movl %r14d, %esi
xorl %eax, %eax
callq 0x5130
movl %r14d, %edi
movl $0x1, %esi
movl %ebx, %edx
callq 0xab15
leaq 0x1b3e1(%rip), %r12     # 0x2d5e8
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 0x1226d
leaq 0x1735d(%rip), %rax     # 0x295ac
movslq (%rax), %rax
leaq 0x17357(%rip), %rcx     # 0x295b0
cmpl %esi, (%rcx,%rax,4)
je 0x1226a
leaq 0x1735b(%rip), %rcx     # 0x295c0
cmpl %esi, (%rcx,%rax,4)
jne 0x1226d
addl $0x7, %esi
leaq 0x114ad(%rip), %rdi     # 0x23721
xorl %eax, %eax
callq 0x5130
movslq %r14d, %r15
leaq 0x16f3b(%rip), %rax     # 0x291c0
movsbl -0x1(%rax,%r15), %eax
movl %r14d, %ecx
xorl $0x2, %ecx
movl %ebx, %edx
andl $0x3, %edx
orl %ecx, %edx
jne 0x122c7
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 0x122c7
rorl $0x4, %ecx
xorl %ebp, %ebp
cmpl $0xa3d70b, %ecx         # imm = 0xA3D70B
setb %bpl
addl %eax, %ebp
leaq 0x11463(%rip), %rdi     # 0x23733
movl %ebp, %esi
xorl %eax, %eax
callq 0x5130
movl %r14d, %edi
movl %ebx, %esi
callq 0x14f07
movl %r14d, %edi
movl %ebx, %esi
callq 0x14d73
cmpl $0x0, (%r13)
je 0x1234a
movslq 0x1dddd(%rip), %rsi     # 0x300d8
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 0x11424(%rip), %rdi     # 0x23742
xorl %eax, %eax
callq 0x5130
movl %r14d, %edi
movl %ebx, %esi
callq 0x15215
movl %r14d, %edi
movl %ebx, %esi
callq 0x14f98
leaq 0x13347(%rip), %rdi     # 0x25687
callq 0x50b0
jmp 0x125d3
leaq 0x1b02f(%rip), %rdi     # 0x2d380
leaq 0x1137b(%rip), %rsi     # 0x236d3
callq 0x148f9
leaq 0x1b0ec(%rip), %rdi     # 0x2d450
leaq 0x11374(%rip), %rsi     # 0x236df
callq 0x148f9
leaq 0x1b1a9(%rip), %rdi     # 0x2d520
leaq 0x1136d(%rip), %rsi     # 0x236eb
callq 0x148f9
leaq 0x1b3b6(%rip), %rdi     # 0x2d740
leaq 0x11366(%rip), %rsi     # 0x236f7
callq 0x148f9
leaq 0x1720f(%rip), %rax     # 0x295ac
cmpl $0x0, (%rax)
je 0x1258e
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 0x11384(%rip), %rdi     # 0x23750
xorl %ebp, %ebp
movl %r15d, %esi
xorl %eax, %eax
callq 0x5130
leaq 0x11381(%rip), %rdi     # 0x23760
movl %r12d, %esi
xorl %eax, %eax
callq 0x5130
movl %r12d, %edi
movl $0x1, %esi
movl %r15d, %edx
callq 0xab15
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 0x1133c(%rip), %rdi     # 0x23771
xorl %eax, %eax
callq 0x5130
movslq %r12d, %rcx
leaq 0x16d7a(%rip), %r13     # 0x291c0
movsbl -0x1(%rcx,%r13), %eax
xorl $0x2, %ecx
movl %r15d, %edx
andl $0x3, %edx
orl %ecx, %edx
movl $0x0, %esi
jne 0x1248c
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 0x1248c
rorl $0x4, %ecx
xorl %esi, %esi
cmpl $0xa3d70b, %ecx         # imm = 0xA3D70B
setb %sil
addl %eax, %esi
leaq 0x112f0(%rip), %rdi     # 0x23785
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 0x112d8(%rip), %rdi     # 0x23796
movl %r15d, %esi
xorl %eax, %eax
callq 0x5130
leaq 0x112d7(%rip), %rdi     # 0x237a6
movl %r12d, %esi
xorl %eax, %eax
callq 0x5130
movl %r12d, %edi
movl $0x1, %esi
movl %r15d, %edx
callq 0xab15
leaq 0x1b0f8(%rip), %rcx     # 0x2d5e8
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 0x1128d(%rip), %rdi     # 0x237b7
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 0x12575
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 0x12575
rorl $0x4, %ecx
xorl %ebp, %ebp
cmpl $0xa3d70b, %ecx         # imm = 0xA3D70B
setb %bpl
addl %eax, %ebp
leaq 0x1124d(%rip), %rdi     # 0x237cb
movl %ebp, %esi
xorl %eax, %eax
callq 0x5130
leaq 0x1b136(%rip), %r13     # 0x2d6c4
movl %r14d, %edi
movl %ebx, %esi
callq 0x15215
movl %r14d, %edi
movl %ebx, %esi
callq 0x14f98
leaq 0x130d3(%rip), %rdi     # 0x2567c
callq 0x50b0
movl %r14d, %edi
movl %ebx, %esi
movl $0x1, %edx
callq 0x14a2c
movl %r14d, %edi
movl %ebx, %esi
xorl %edx, %edx
callq 0x14a2c
movl %r14d, %edi
movl %ebx, %esi
callq 0x14c3d
cmpl $0x0, (%r13)
je 0x1260d
movl 0x1daf8(%rip), %eax     # 0x300d8
leal 0x1(%rax), %ecx
movl %ecx, 0x1daef(%rip)     # 0x300d8
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
addl $0xd5555553, %eax       # imm = 0xD5555553
rorl $0x2, %eax
cmpl $0x15555554, %eax       # imm = 0x15555554
jbe 0x1260d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x111c8(%rip), %rdi     # 0x237dc
xorl %eax, %eax
callq 0x5130
leaq 0x13071(%rip), %rdi     # 0x25693
callq 0x50b0
leaq 0x1306e(%rip), %rdi     # 0x2569c
callq 0x50b0
leaq 0x1306e(%rip), %rdi     # 0x256a8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x50b0