// File: /workspace/github_c_makefile_star2_O2/mmayer[P]pcal/src/writefil.c
// Function: single_month_html
void single_month_html (int this_month, int this_year)
{
   long holidays;
   int day, box, len;
   year_info *py;
   month_info *pm;
   register day_info *pd;
   
   /* table heading with month and year */
   printf("<a name=_%02d%02d>\n", this_month, this_year % 100);
   printf("<table width=100%% border=%d>\n", BORDER);
   printf("<tr><th colspan=7>%s", MONTHYEAR_PRE);
   print_html(months_ml[output_language][this_month-1]);
   printf(" %d%s</th></tr>\n", this_year, MONTHYEAR_POST);
   
   /* headings for weekday names */
   printf("<tr>");
   for (day = 0; day < 7; day++) {
      char buf[40];
      strcpy(buf, days_ml[output_language][(day + first_day_of_week) % 7]);

      /* buf[ABBR_MONTH_LEN] = '\0'; */

      printf("<th width=14%%>");
      print_html(buf);
      printf("</th>");
   }
   printf("</tr>\n");
   
   /* blank space at beginning (if necessary) - divide into N one-column
    * boxes (#if DIVIDE_BLANK_SPACE) or print as single N-column box
    */
   printf("<tr>\n");
   if ((box = START_BOX(this_month, this_year)) > 0) {

#if DIVIDE_BLANK_SPACE
      int i;
      for (i = 0; i < box; i++) {
         printf("<td>");
         BLANKLINES(TEXTLINES);
         printf("</td>\n");
      }
#else
      printf("<td colspan=%d>", box);
      BLANKLINES(TEXTLINES);
      printf("</td>\n");
#endif
   }

   /* get pointer to text information for current month */
   pm = (py = find_year(this_year, FALSE)) != NULL ? py->month[this_month-1] : NULL;

   /* main loop for dates */
   len = LENGTH_OF(this_month, this_year);
   for (day = 1, holidays = pm ? pm->holidays : 0;
        day <= len;
        day++, box++, holidays >>= 1) {
      int nrows;
      
      if (box > 0 && box % 7 == 0) printf("<tr>\n");   /* start of row */
         
      printf("<td valign=top>");

      /* special HTML code for holidays (cf. pcaldefs.h) */
      if (holidays & 01) printf("%s%d%s", HOLIDAY_PRE, day, HOLIDAY_POST);
      else printf("%d", day);

      /* print associated text (count lines) */
      for (nrows = 0, pd = pm ? pm->day[day-1] : NULL;
           pd;
           pd = pd->next, nrows++) {
         /* Skip lines specifying an EPS image... */
         if (ci_strncmp(pd->text, "image:", 6) == 0) continue;
         printf("\n<br>");
         this_day = day;
         RESET_DATE();   /* reset working date */
         print_html(pd->text);
      }
      
      /* pad first box in each row with blank lines */
      if (box % 7 == 0 && nrows < TEXTLINES) BLANKLINES(TEXTLINES - nrows);
      
      printf("</td>\n");
      if (box % 7 == 6) printf("</tr>\n");   /* end of row */
   }

   /* blank space at end (if necessary) - divide into N one-column
    * boxes (#if DIVIDE_BLANK_SPACE) or print as single N-column box
    */
   if ((box %= 7) != 0) {
#if DIVIDE_BLANK_SPACE
      int i;
      for (i = box; i < 7; i++) {
         printf("<td>");
         BLANKLINES(TEXTLINES);
         printf("</td>\n");
      }
#else
      printf("<td colspan=%d>", 7 - box);
      BLANKLINES(TEXTLINES);
      printf("</td>\n");
#endif
   }
   printf("</tr>\n");
   printf("</table>\n");

   /* links to other months on page */
   if (nmonths > 2) {
      int j, m, y;
      char c = date_style == EUR_DATES ? '.' : '/';
      
      printf("<p>");
      for (j = 0, m = init_month, y = init_year;
           j < nmonths;
           j++, BUMP_MONTH_AND_YEAR(m, y)) {
         printf("<a href=#_%02d%02d>%02d%c%02d</a>%s\n",
                m, y % 100, m, c, y % 100,
                j % 12 == 11 ? "<br>" : "&nbsp;");
      }
   }

   return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %esi, %ebx
movl %edi, %ebp
pushq $0x64
popq %rcx
movl %esi, %eax
cltd
idivl %ecx
leaq 0xfc40(%rip), %rdi      # 0x21244
movl %ebp, %esi
movl %edx, 0x10(%rsp)
xorl %eax, %eax
callq 0x5130
leaq 0xfc40(%rip), %rdi      # 0x21258
pushq $0x1
popq %rsi
xorl %eax, %eax
callq 0x5130
leaq 0xfc4e(%rip), %rdi      # 0x21277
leaq 0xfc5c(%rip), %rsi      # 0x2128c
xorl %eax, %eax
callq 0x5130
leaq 0x1c1c6(%rip), %rax     # 0x2d804
movslq (%rax), %rax
movl %ebp, 0xc(%rsp)
movslq %ebp, %rdx
leaq -0x1(%rdx), %rcx
movq %rcx, 0x20(%rsp)
imulq $0x60, %rax, %rax
addq 0x1694c(%rip), %rax     # 0x27fa8
movq %rdx, 0x18(%rsp)
movq -0x8(%rax,%rdx,8), %rdi
callq 0x11aa6
leaq 0xfc2d(%rip), %rdi      # 0x2129f
leaq 0xfc37(%rip), %rdx      # 0x212b0
movl %ebx, 0x8(%rsp)
movl %ebx, %esi
xorl %eax, %eax
callq 0x5130
leaq 0x11fdd(%rip), %rdi     # 0x2366a
xorl %eax, %eax
callq 0x5130
leaq 0x1af3d(%rip), %r13     # 0x2c5d8
leaq 0x18e8e(%rip), %rbp     # 0x2a530
leaq 0x30(%rsp), %rbx
leaq 0xfc14(%rip), %r15      # 0x212c2
leaq 0xfd48(%rip), %r12      # 0x213fd
xorl %r14d, %r14d
cmpl $0x7, %r14d
je 0x11712
leaq 0x1c13f(%rip), %rax     # 0x2d804
movslq (%rax), %rcx
movl (%r13), %eax
addl %r14d, %eax
cltd
pushq $0x7
popq %rsi
idivl %esi
movslq %edx, %rax
imulq $0x14, %rax, %rax
imulq $0x8c, %rcx, %rsi
addq %rbp, %rsi
addq %rax, %rsi
movq %rbx, %rdi
callq 0x50a0
movq %r15, %rdi
xorl %eax, %eax
callq 0x5130
movq %rbx, %rdi
callq 0x11aa6
movq %r12, %rdi
xorl %eax, %eax
callq 0x5130
incl %r14d
jmp 0x116b8
leaq 0x11f6f(%rip), %rdi     # 0x23688
callq 0x50b0
leaq 0x11f45(%rip), %rdi     # 0x2366a
callq 0x50b0
pushq $0x1
popq %rsi
movl 0xc(%rsp), %edi
movl 0x8(%rsp), %edx
callq 0x9d79
movl (%r13), %ecx
negl %ecx
addl %ecx, %eax
addl $0x7, %eax
cltd
pushq $0x7
popq %r14
idivl %r14d
movl %edx, %ebx
testl %edx, %edx
jle 0x11790
leaq 0xfb78(%rip), %rdi      # 0x212d2
movl %ebx, %r15d
movl %ebx, %esi
xorl %eax, %eax
callq 0x5130
pushq $0x2
popq %rbp
leaq 0xfb47(%rip), %rbx      # 0x212b7
subl $0x1, %ebp
jb 0x11781
movq %rbx, %rdi
xorl %eax, %eax
callq 0x5130
jmp 0x11770
leaq 0xfc93(%rip), %rdi      # 0x2141b
callq 0x50b0
movl %r15d, %ebx
xorl %ebp, %ebp
movl 0x8(%rsp), %edi
xorl %esi, %esi
callq 0xb9d3
testq %rax, %rax
je 0x117ab
movq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rbp
leaq 0x169fe(%rip), %rax     # 0x281b0
movq 0x20(%rsp), %rcx
movsbq (%rax,%rcx), %rcx
movl 0xc(%rsp), %eax
xorl $0x2, %eax
movl 0x8(%rsp), %edx
andl $0x3, %edx
orl %eax, %edx
jne 0x117da
cmpl $0x0, 0x10(%rsp)
je 0x117e5
pushq $0x1
popq %rax
jmp 0x117f8
movq $0x0, 0x10(%rsp)
jmp 0x117fd
movl $0x190, %esi            # imm = 0x190
movl 0x8(%rsp), %eax
cltd
idivl %esi
xorl %eax, %eax
testl %edx, %edx
sete %al
movq %rax, 0x10(%rsp)
testq %rbp, %rbp
je 0x1180d
movq (%rbp), %rax
movq %rax, 0x18(%rsp)
jmp 0x11816
movq $0x0, 0x18(%rsp)
pushq $0x1
popq %r13
addq %rcx, 0x10(%rsp)
leaq 0xfaf7(%rip), %r15      # 0x2131d
pushq $0x6
popq %r12
movq %rbp, 0x28(%rsp)
cmpq 0x10(%rsp), %r13
jg 0x11976
movl %ebx, %eax
xorl %edx, %edx
divl %r14d
testl %ebx, %ebx
jle 0x11855
testl %edx, %edx
jne 0x11855
leaq 0x11e1a(%rip), %rdi     # 0x2366a
callq 0x50b0
leaq 0xfa86(%rip), %rdi      # 0x212e2
xorl %eax, %eax
callq 0x5130
testb $0x1, 0x18(%rsp)
jne 0x1187d
leaq 0xca29(%rip), %rdi      # 0x1e29a
movl %r13d, %esi
xorl %eax, %eax
callq 0x5130
jmp 0x1189c
leaq 0xfa6e(%rip), %rdi      # 0x212f2
leaq 0xfa6e(%rip), %rsi      # 0x212f9
movl %r13d, %edx
leaq 0xfa7c(%rip), %rcx      # 0x21311
xorl %eax, %eax
callq 0x5130
testq %rbp, %rbp
movl %ebx, 0x20(%rsp)
je 0x118ac
movq (%rbp,%r13,8), %rbp
jmp 0x118ae
xorl %ebp, %ebp
xorl %ebx, %ebx
pushq $0x2
popq %r14
testq %rbp, %rbp
je 0x11910
movq 0x8(%rbp), %rdi
movq %r15, %rsi
movl %r12d, %edx
callq 0x9665
testl %eax, %eax
je 0x11905
leaq 0xfa51(%rip), %rdi      # 0x21324
xorl %eax, %eax
callq 0x5130
movl %r13d, 0x1d6f7(%rip)    # 0x2efd8
movl 0xc(%rsp), %eax
movl %eax, 0x1d6f1(%rip)     # 0x2efdc
movl %r13d, 0x1d6ee(%rip)    # 0x2efe0
movl 0x8(%rsp), %eax
movl %eax, 0x1d6e8(%rip)     # 0x2efe4
movq 0x8(%rbp), %rdi
callq 0x11aa6
movq 0x10(%rbp), %rbp
decl %ebx
decl %r14d
jmp 0x118b4
movl 0x20(%rsp), %eax
cltd
pushq $0x7
popq %rcx
idivl %ecx
movl %edx, %ebp
testl %edx, %edx
jne 0x1193d
negl %ebx
cmpl $0x1, %ebx
ja 0x1193d
subl $0x1, %r14d
jb 0x1193d
leaq 0xf983(%rip), %rdi      # 0x212b7
xorl %eax, %eax
callq 0x5130
jmp 0x11927
leaq 0xfad7(%rip), %rdi      # 0x2141b
callq 0x50b0
cmpl $0x6, %ebp
jne 0x1195a
leaq 0x11d33(%rip), %rdi     # 0x23688
callq 0x50b0
incq %r13
movl 0x20(%rsp), %ebx
incl %ebx
sarq 0x18(%rsp)
pushq $0x7
popq %r14
movq 0x28(%rsp), %rbp
jmp 0x1182f
movl %ebx, %eax
cltd
idivl %r14d
testl %edx, %edx
je 0x119bb
subl %edx, %r14d
leaq 0xf948(%rip), %rdi      # 0x212d2
movl %r14d, %esi
xorl %eax, %eax
callq 0x5130
pushq $0x2
popq %rbp
leaq 0xf919(%rip), %rbx      # 0x212b7
subl $0x1, %ebp
jb 0x119af
movq %rbx, %rdi
xorl %eax, %eax
callq 0x5130
jmp 0x1199e
leaq 0xfa65(%rip), %rdi      # 0x2141b
callq 0x50b0
leaq 0x11cc6(%rip), %rdi     # 0x23688
callq 0x50b0
leaq 0x11cb1(%rip), %rdi     # 0x2367f
callq 0x50b0
leaq 0x1bab2(%rip), %rax     # 0x2d48c
cmpl $0x3, (%rax)
jl 0x11a97
leaq 0x1abf2(%rip), %rax     # 0x2c5dc
xorl %ebx, %ebx
cmpl $0x1, (%rax)
sete %bl
leaq 0xfa9e(%rip), %rdi      # 0x21497
xorl %eax, %eax
callq 0x5130
leaq 0x1ba7d(%rip), %rax     # 0x2d484
movl (%rax), %r12d
leaq 0x1ba77(%rip), %rax     # 0x2d488
movl (%rax), %ebp
xorl $0x2f, %ebx
pushq $0xb
popq %r13
leaq 0xf909(%rip), %r14      # 0x2132a
xorl %r15d, %r15d
movl %r15d, %eax
xorl %edx, %edx
pushq $0xc
popq %rcx
divl %ecx
leaq 0x1ba57(%rip), %rcx     # 0x2d48c
cmpl (%rcx), %r15d
jge 0x11a97
imull $0xc, %eax, %ecx
addl %r13d, %ecx
movl %ebp, %eax
cltd
pushq $0x64
popq %rsi
idivl %esi
testl %ecx, %ecx
leaq 0xf86a(%rip), %rax      # 0x212bb
leaq 0xf8cd(%rip), %rcx      # 0x21325
cmoveq %rcx, %rax
movq %rax, (%rsp)
movq %r14, %rdi
movl %r12d, %esi
movl %r12d, %ecx
movl %ebx, %r8d
movl %edx, %r9d
xorl %eax, %eax
callq 0x5130
incl %r15d
xorl %eax, %eax
cmpl $0xc, %r12d
leal 0x1(%r12), %ecx
pushq $0x1
popq %rdx
cmovel %edx, %ecx
sete %al
addl %eax, %ebp
decl %r13d
movl %ecx, %r12d
jmp 0x11a24
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq