// File: /workspace/github_c_makefile_star2_O2/mmayer[P]pcal/src/writefil.c
// Function: single_month_one_column_html
void single_month_one_column_html (int this_month, int this_year)
{
   long holidays;
   int day, box = 0, len, i;
   year_info *py;
   month_info *pm;
   register day_info *pd;
   char *text_short;
   
   /* table heading with first 5 chars of the month */
   printf("<table border=%d>\n", BORDER);
   printf("<tr><th width=100px>%s</th></tr>\n", months_ml[output_language][this_month-1]);
   
   /* 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;
      
      /* print only one column for the month */
      printf("<tr>\n");
      printf("<td valign=top>");

      /* special HTML code for holidays (cf. pcaldefs.h) */
      if (holidays & 01) {
         printf("%s%d%s %c", HOLIDAY_PRE, day, HOLIDAY_POST,
                days_ml[output_language][(day + START_BOX(this_month, this_year) + 
                                          first_day_of_week - 1) % 7][0]);
      }
      else {
         /* print Sundays in bold */
         if ((day + START_BOX(this_month, this_year) + first_day_of_week - 1) % 7 == 0) {
            printf("<B>%d %c</B>", day,
                   days_ml[output_language][(day + START_BOX(this_month, this_year) + 
                                             first_day_of_week - 1) % 7][0]);
         }
         /* print Saturdays in gray */
         else if ((day + START_BOX(this_month, this_year) + first_day_of_week - 1) % 7 == 6) {
            printf("<B><FONT color=darkgray>%d</FONT> %c</B>", day,
                   days_ml[output_language][(day + START_BOX(this_month, this_year) + 
                                             first_day_of_week - 1) % 7][0]);
         }
         else {
            printf("%d %c", day, days_ml[output_language]
                   [(day + START_BOX(this_month, this_year) + first_day_of_week - 1) % 7][0]);
         }
         /* print associated text (count lines),
            not for holidays */
         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<I>");
            this_day = day;
            RESET_DATE();   /* reset working date */
            text_short = pd->text;
            for  (i=0; i < 5; i++) {
               if (text_short[i] == '\0') break;
               /* if text starts with < it is probably an HTML tag (e.g. <I>)
                  -> skip three letters
               */
               if(text_short[0] == '<' && text_short[i+3] == '\0') break;
               if(text_short[0] == '<') printf("%c",text_short[i+3]);
               else printf("%c",text_short[i]);
            }
            printf("</I>\n");
         }
      }
      
      /* TR-tag to end the row */
      printf("</td></TR>\n");
      if (box % 7 == 6) printf("</tr>\n");   /* end of row */
   }
   printf("</tr>\n");
   printf("</table>\n");

   return;   
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, %ebx
movl %edi, %ebp
leaq 0xf7fa(%rip), %rdi      # 0x2134f
pushq $0x1
popq %rsi
xorl %eax, %eax
callq 0x5130
leaq 0x1bc9e(%rip), %rax     # 0x2d804
movslq (%rax), %rax
movslq %ebp, %r15
leaq -0x1(%r15), %r14
imulq $0x60, %rax, %rax
addq 0x1642d(%rip), %rax     # 0x27fa8
movq -0x8(%rax,%r15,8), %rsi
leaq 0xf7db(%rip), %rdi      # 0x21362
xorl %eax, %eax
callq 0x5130
movl %ebx, %edi
xorl %esi, %esi
callq 0xb9d3
testq %rax, %rax
je 0x11ba7
movq (%rax,%r15,8), %rax
movq %rax, 0x18(%rsp)
jmp 0x11bb0
movq $0x0, 0x18(%rsp)
leaq 0x165f9(%rip), %rax     # 0x281b0
movsbq (%rax,%r14), %rcx
movl %ebp, %eax
xorl $0x2, %eax
movl %ebx, %edx
andl $0x3, %edx
orl %eax, %edx
jne 0x11bdb
pushq $0x64
popq %rsi
movl %ebx, %eax
cltd
idivl %esi
testl %edx, %edx
je 0x11be6
pushq $0x1
popq %rax
jmp 0x11bf7
movq $0x0, 0x10(%rsp)
jmp 0x11bfc
movl $0x190, %esi            # imm = 0x190
movl %ebx, %eax
cltd
idivl %esi
xorl %eax, %eax
testl %edx, %edx
sete %al
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x11c0b
movq (%rax), %r15
jmp 0x11c0e
xorl %r15d, %r15d
pushq $0x1
popq %r14
addq %rcx, 0x10(%rsp)
leaq 0x1a9ba(%rip), %r12     # 0x2c5d8
pushq $0x7
popq %r13
xorl %ecx, %ecx
cmpq 0x10(%rsp), %r14
jg 0x11edf
movl %ecx, 0xc(%rsp)
leaq 0x11a30(%rip), %rdi     # 0x2366a
callq 0x50b0
leaq 0xf69c(%rip), %rdi      # 0x212e2
xorl %eax, %eax
callq 0x5130
movq %r15, 0x30(%rsp)
testb $0x1, %r15b
jne 0x11d1a
movl %ebp, %edi
pushq $0x1
popq %rsi
movl %ebx, %edx
callq 0x9d79
movl (%r12), %ecx
subl %ecx, %eax
addl %r13d, %eax
cltd
idivl %r13d
leal -0x1(%r14), %r15d
leal (%rcx,%r14), %eax
decl %eax
addl %edx, %eax
cltd
idivl %r13d
testl %edx, %edx
je 0x11d87
movl %ebp, %edi
pushq $0x1
popq %rsi
movl %ebx, %edx
callq 0x9d79
movl (%r12), %ecx
subl %ecx, %eax
addl %r13d, %eax
cltd
idivl %r13d
addl %r15d, %ecx
addl %edx, %ecx
movl %ecx, %eax
cltd
idivl %r13d
movl %edx, 0x20(%rsp)
leaq 0x1bb48(%rip), %rax     # 0x2d804
movslq (%rax), %rax
movq %rax, 0x28(%rsp)
movl %ebp, %edi
pushq $0x1
popq %rsi
movl %ebx, %edx
callq 0x9d79
movl (%r12), %ecx
subl %ecx, %eax
addl %r13d, %eax
cltd
idivl %r13d
addl %r15d, %ecx
addl %edx, %ecx
movl %ecx, %eax
cltd
idivl %r13d
movslq %edx, %rax
imulq $0x14, %rax, %rax
imulq $0x8c, 0x28(%rsp), %rcx
addq 0x162d1(%rip), %rcx     # 0x27fd0
movsbl (%rax,%rcx), %edx
cmpl $0x6, 0x20(%rsp)
jne 0x11de0
leaq 0xf686(%rip), %rdi      # 0x2139b
jmp 0x11de7
leaq 0x1bae3(%rip), %rax     # 0x2d804
movslq (%rax), %r15
movl %ebp, %edi
pushq $0x1
popq %rsi
movl %ebx, %edx
callq 0x9d79
movl (%r12), %ecx
subl %ecx, %eax
addl %r13d, %eax
cltd
idivl %r13d
addl %r14d, %ecx
leal (%rdx,%rcx), %eax
decl %eax
cltd
idivl %r13d
movslq %edx, %rax
imulq $0x14, %rax, %rax
imulq $0x8c, %r15, %rcx
addq 0x16272(%rip), %rcx     # 0x27fd0
movsbl (%rax,%rcx), %r8d
leaq 0xf61a(%rip), %rdi      # 0x21384
leaq 0xf588(%rip), %rsi      # 0x212f9
movl %r14d, %edx
leaq 0xf596(%rip), %rcx      # 0x21311
xorl %eax, %eax
callq 0x5130
jmp 0x11e96
leaq 0x1ba76(%rip), %rax     # 0x2d804
movslq (%rax), %rax
movq %rax, 0x20(%rsp)
movl %ebp, %edi
pushq $0x1
popq %rsi
movl %ebx, %edx
callq 0x9d79
movl (%r12), %ecx
subl %ecx, %eax
addl %r13d, %eax
cltd
idivl %r13d
addl %ecx, %r15d
addl %edx, %r15d
movl %r15d, %eax
cltd
idivl %r13d
movslq %edx, %rax
imulq $0x14, %rax, %rax
imulq $0x8c, 0x20(%rsp), %rcx
addq 0x161fd(%rip), %rcx     # 0x27fd0
movsbl (%rax,%rcx), %edx
leaq 0xf5b0(%rip), %rdi      # 0x2138e
jmp 0x11de7
leaq 0xf5dd(%rip), %rdi      # 0x213c4
movl %r14d, %esi
xorl %eax, %eax
callq 0x5130
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x11e04
movq (%rax,%r14,8), %r13
jmp 0x11e8d
xorl %r13d, %r13d
jmp 0x11e8d
movq 0x8(%r13), %rdi
leaq 0xf506(%rip), %rsi      # 0x2131d
pushq $0x6
popq %rdx
callq 0x9665
testl %eax, %eax
je 0x11e89
leaq 0xf5a0(%rip), %rdi      # 0x213ca
xorl %eax, %eax
callq 0x5130
movl %r14d, 0x1d1a0(%rip)    # 0x2efd8
movl %ebp, 0x1d19e(%rip)     # 0x2efdc
movl %r14d, 0x1d19b(%rip)    # 0x2efe0
movl %ebx, 0x1d199(%rip)     # 0x2efe4
movq 0x8(%r13), %r15
pushq $0x3
popq %r12
cmpq $0x8, %r12
je 0x11e7d
movb -0x3(%r15,%r12), %al
testb %al, %al
je 0x11e7d
cmpb $0x3c, (%r15)
jne 0x11e70
movb (%r15,%r12), %al
testb %al, %al
je 0x11e7d
movsbl %al, %edi
callq 0x5060
incq %r12
jmp 0x11e53
leaq 0x117eb(%rip), %rdi     # 0x2366f
callq 0x50b0
movq 0x10(%r13), %r13
testq %r13, %r13
jne 0x11e0c
leaq 0x117d7(%rip), %rdi     # 0x23674
callq 0x50b0
movl 0xc(%rsp), %ecx
movl %ecx, %eax
xorl %edx, %edx
pushq $0x7
popq %r13
divl %r13d
cmpl $0x6, %edx
jne 0x11ec6
leaq 0x117cb(%rip), %rdi     # 0x23688
callq 0x50b0
movl 0xc(%rsp), %ecx
incq %r14
incl %ecx
movq 0x30(%rsp), %r15
sarq %r15
leaq 0x1a6fe(%rip), %r12     # 0x2c5d8
jmp 0x11c24
leaq 0x117a2(%rip), %rdi     # 0x23688
callq 0x50b0
leaq 0x1178d(%rip), %rdi     # 0x2367f
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x50b0