// File: /workspace/github_c_makefile_star2_O0/mmayer[P]pcal/src/writefil.c
// Function: multiple_months_html
void multiple_months_html (int first_month, int first_year, int ncols)
{
   long holidays;
   int day, box, len;
   year_info *py;
   month_info *pm;
   int i, m, d, y, w, wd1, wd2, nw;
   
   /* width of dates and spaces between months */
   wd1 = 12 / ncols;
   wd2 = (100 - (ncols * (7 * wd1))) / (ncols - 1);
   
   /* table heading with months and year */
   printf("<table width=100%% border=%d>\n", 0);
   
   printf("<tr>");
   for (i = 0, m = first_month, y = first_year;
        i < ncols;
        i++, BUMP_MONTH_AND_YEAR(m, y)) {
      if (i > 0) printf("<th><br></th>");
      printf("<th colspan=7>%s", MONTHYEAR_W_PRE);
      print_html(months_ml[output_language][m-1]);
      printf(" %d%s</th>\n", y, MONTHYEAR_W_POST);
   }
   printf("</tr>\n");
   
   /* headings for weekday names */
   printf("<tr>");
   for (i = 0; i < ncols; i++) {
      if (i > 0) printf("\n<th width=%d%%><br></th>", wd2);
      for (day = 0; day < 7; day++) {
         char buf[40];
         strcpy(buf, days_ml[output_language][(day + first_day_of_week) % 7]);
#if 0
         buf[ncols == 3 ? 3 : 2] = '\0';
#else
         buf[2] = '\0';   /* truncate to two characters */
#endif
         printf("<th width=%d%%>", wd1);
         print_html(buf);
         printf("</th>");
      }
   }
   printf("</tr>\n");
   
#ifdef CONSISTENT_SPACING
   /* always print 6 weeks (to maintain consistent vertical spacing) */
   nw = 6;
#else
   /* print 5 weeks unless at least one month requires a sixth week */
   nw = 5;
   for (i = 0, m = first_month, y = first_year;
        i < ncols;
        i++, BUMP_MONTH_AND_YEAR(m, y)) {
      if (START_BOX(m, y) + LENGTH_OF(m, y) > 35) nw = 6;
   }
#endif

   /* main loop to print dates (one week at a time) */
   
   for (w = 0; w < nw; w++) {
      printf("<tr>");

      /* print one week of dates for each month */
      
      for (i = 0, m = first_month, y = first_year;
           i < ncols;
           i++, BUMP_MONTH_AND_YEAR(m, y)) {
         if (i > 0) printf("<td><br></td>");

         /* get starting box, month length, holiday info */
         box = START_BOX(m, y);
         len = LENGTH_OF(m, y);
         pm = (py = find_year(y, FALSE)) != NULL ? py->month[m-1] : NULL;
         holidays = pm ? pm->holidays : 0;
         
         /* loop over days in current week and month */
         
         for (d = 1; d <= 7; d++) {
            day = (7 * w) + d - box;
            if (day < 1 || day > len) printf("<td><br></td>");
            else {
               printf("<td align=center>");
               if (holidays & (1L << (day - 1))) {
                  printf("%s%d%s", HOLIDAY_PRE, day, HOLIDAY_POST);
               }
               else printf("%d", day);

               printf("</td>");
            }
         }
      }
      printf("</tr>\n");
   }
   
   /* end of table */
   printf("</table>\n");

   return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl $0xc, %eax
cltd
idivl -0xc(%rbp)
movl %eax, -0x50(%rbp)
movl -0xc(%rbp), %ecx
imull $0x7, -0x50(%rbp), %eax
imull %eax, %ecx
movl $0x64, %eax
subl %ecx, %eax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
cltd
idivl %ecx
movl %eax, -0x54(%rbp)
leaq 0x12797(%rip), %rdi     # 0x2a48b
xorl %esi, %esi
movb $0x0, %al
callq 0x5110
leaq 0x127f1(%rip), %rdi     # 0x2a4f5
movb $0x0, %al
callq 0x5110
movl $0x0, -0x3c(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x17dc4
cmpl $0x0, -0x3c(%rbp)
jle 0x17d3e
leaq 0x128f9(%rip), %rdi     # 0x2a630
movb $0x0, %al
callq 0x5110
leaq 0x12769(%rip), %rdi     # 0x2a4ae
leaq 0x12777(%rip), %rsi     # 0x2a4c3
movb $0x0, %al
callq 0x5110
leaq 0x1bb2a(%rip), %rax     # 0x33884
movslq (%rax), %rcx
leaq 0x17ebc(%rip), %rax     # 0x2fc20
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movl -0x40(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x17500
movl -0x48(%rbp), %esi
leaq 0x128b7(%rip), %rdi     # 0x2a63e
leaq 0x127cc(%rip), %rdx     # 0x2a55a
movb $0x0, %al
callq 0x5110
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
cmpl $0xc, -0x40(%rbp)
jne 0x17db6
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
movl $0x1, -0x40(%rbp)
jmp 0x17dbf
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x17d1e
leaq 0x12801(%rip), %rdi     # 0x2a5cc
movb $0x0, %al
callq 0x5110
leaq 0x1271c(%rip), %rdi     # 0x2a4f5
movb $0x0, %al
callq 0x5110
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x17ea0
cmpl $0x0, -0x3c(%rbp)
jle 0x17e0a
movl -0x54(%rbp), %esi
leaq 0x12847(%rip), %rdi     # 0x2a64a
movb $0x0, %al
callq 0x5110
movl $0x0, -0x1c(%rbp)
cmpl $0x7, -0x1c(%rbp)
jge 0x17e90
leaq -0x80(%rbp), %rdi
leaq 0x1ba62(%rip), %rax     # 0x33884
movslq (%rax), %rax
leaq 0x186f4(%rip), %rsi     # 0x30520
imulq $0x8c, %rax, %rax
addq %rax, %rsi
movl -0x1c(%rbp), %eax
leaq 0x1a828(%rip), %rcx     # 0x32668
addl (%rcx), %eax
movl $0x7, %ecx
cltd
idivl %ecx
movslq %edx, %rax
imulq $0x14, %rax, %rax
addq %rax, %rsi
callq 0x5080
movb $0x0, -0x7e(%rbp)
movl -0x50(%rbp), %esi
leaq 0x127fd(%rip), %rdi     # 0x2a664
movb $0x0, %al
callq 0x5110
leaq -0x80(%rbp), %rdi
callq 0x17500
leaq 0x127e0(%rip), %rdi     # 0x2a65e
movb $0x0, %al
callq 0x5110
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x17e11
jmp 0x17e92
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x17de7
leaq 0x12725(%rip), %rdi     # 0x2a5cc
movb $0x0, %al
callq 0x5110
movl $0x5, -0x58(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x17fde
movl -0x40(%rbp), %edi
movl -0x48(%rbp), %edx
movl $0x1, %esi
callq 0xc110
leaq 0x1a77d(%rip), %rcx     # 0x32668
subl (%rcx), %eax
addl $0x7, %eax
movl $0x7, %ecx
cltd
idivl %ecx
movl %edx, -0x8c(%rbp)
movl -0x40(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0x16282(%rip), %rax     # 0x2e190
movsbl (%rax,%rcx), %eax
movl %eax, -0x88(%rbp)
xorl %eax, %eax
cmpl $0x2, -0x40(%rbp)
movb %al, -0x81(%rbp)
jne 0x17f85
movl -0x48(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
xorl %eax, %eax
cmpl $0x0, %edx
movb %al, -0x8d(%rbp)
jne 0x17f79
movl -0x48(%rbp), %eax
movl $0x64, %ecx
cltd
idivl %ecx
movb $0x1, %al
cmpl $0x0, %edx
movb %al, -0x8e(%rbp)
jne 0x17f6d
movl -0x48(%rbp), %eax
movl $0x190, %ecx            # imm = 0x190
cltd
idivl %ecx
cmpl $0x0, %edx
sete %al
movb %al, -0x8e(%rbp)
movb -0x8e(%rbp), %al
movb %al, -0x8d(%rbp)
movb -0x8d(%rbp), %al
movb %al, -0x81(%rbp)
movl -0x8c(%rbp), %eax
movl -0x88(%rbp), %ecx
movb -0x81(%rbp), %dl
andb $0x1, %dl
movzbl %dl, %edx
addl %edx, %ecx
addl %ecx, %eax
cmpl $0x23, %eax
jle 0x17fad
movl $0x6, -0x58(%rbp)
jmp 0x17faf
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
cmpl $0xc, -0x40(%rbp)
jne 0x17fd0
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
movl $0x1, -0x40(%rbp)
jmp 0x17fd9
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x17ec8
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x58(%rbp), %eax
jge 0x18270
leaq 0x124fd(%rip), %rdi     # 0x2a4f5
movb $0x0, %al
callq 0x5110
movl $0x0, -0x3c(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x18254
cmpl $0x0, -0x3c(%rbp)
jle 0x18032
leaq 0x12649(%rip), %rdi     # 0x2a674
movb $0x0, %al
callq 0x5110
movl -0x40(%rbp), %edi
movl -0x48(%rbp), %edx
movl $0x1, %esi
callq 0xc110
leaq 0x1a61f(%rip), %rcx     # 0x32668
subl (%rcx), %eax
addl $0x7, %eax
movl $0x7, %ecx
cltd
idivl %ecx
movl %edx, -0x20(%rbp)
movl -0x40(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0x16127(%rip), %rax     # 0x2e190
movsbl (%rax,%rcx), %eax
movl %eax, -0x94(%rbp)
xorl %eax, %eax
cmpl $0x2, -0x40(%rbp)
movb %al, -0x8f(%rbp)
jne 0x180e0
movl -0x48(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
xorl %eax, %eax
cmpl $0x0, %edx
movb %al, -0x95(%rbp)
jne 0x180d4
movl -0x48(%rbp), %eax
movl $0x64, %ecx
cltd
idivl %ecx
movb $0x1, %al
cmpl $0x0, %edx
movb %al, -0x96(%rbp)
jne 0x180c8
movl -0x48(%rbp), %eax
movl $0x190, %ecx            # imm = 0x190
cltd
idivl %ecx
cmpl $0x0, %edx
sete %al
movb %al, -0x96(%rbp)
movb -0x96(%rbp), %al
movb %al, -0x95(%rbp)
movb -0x95(%rbp), %al
movb %al, -0x8f(%rbp)
movl -0x94(%rbp), %eax
movb -0x8f(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
addl %ecx, %eax
movl %eax, -0x24(%rbp)
movl -0x48(%rbp), %edi
xorl %esi, %esi
callq 0xefe0
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x18126
movq -0x30(%rbp), %rax
movl -0x40(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq 0x8(%rax,%rcx,8), %rax
movq %rax, -0xa0(%rbp)
jmp 0x18131
xorl %eax, %eax
movq %rax, -0xa0(%rbp)
jmp 0x18131
movq -0xa0(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x18153
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xa8(%rbp)
jmp 0x1815e
xorl %eax, %eax
movq %rax, -0xa8(%rbp)
jmp 0x1815e
movq -0xa8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x1, -0x44(%rbp)
cmpl $0x7, -0x44(%rbp)
jg 0x18223
imull $0x7, -0x4c(%rbp), %eax
addl -0x44(%rbp), %eax
subl -0x20(%rbp), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x1, -0x1c(%rbp)
jl 0x18195
movl -0x1c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jle 0x181a5
leaq 0x124d8(%rip), %rdi     # 0x2a674
movb $0x0, %al
callq 0x5110
jmp 0x18213
leaq 0x124d6(%rip), %rdi     # 0x2a682
movb $0x0, %al
callq 0x5110
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0x181f4
movl -0x1c(%rbp), %edx
leaq 0x1235a(%rip), %rdi     # 0x2a537
leaq 0x1235a(%rip), %rsi     # 0x2a53e
leaq 0x1236b(%rip), %rcx     # 0x2a556
movb $0x0, %al
callq 0x5110
jmp 0x18205
movl -0x1c(%rbp), %esi
leaq 0xd362(%rip), %rdi      # 0x25560
movb $0x0, %al
callq 0x5110
leaq 0x12470(%rip), %rdi     # 0x2a67c
movb $0x0, %al
callq 0x5110
jmp 0x18215
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x18170
jmp 0x18225
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
cmpl $0xc, -0x40(%rbp)
jne 0x18246
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
movl $0x1, -0x40(%rbp)
jmp 0x1824f
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x18012
leaq 0x12371(%rip), %rdi     # 0x2a5cc
movb $0x0, %al
callq 0x5110
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x17fe5
leaq 0x122f8(%rip), %rdi     # 0x2a56f
movb $0x0, %al
callq 0x5110
addq $0xb0, %rsp
popq %rbp
retq
nopw (%rax,%rax)