// File: /workspace/github_c_makefile_star2_O3/mmayer[P]pcal/src/writefil.c
// Function: write_htmlfile
void write_htmlfile (void)
{
   int i;
   static struct {
      char *attribute;   /* attribute name */
      char *value;   /* attribute value */
      int   numeric;   /* TRUE if value is numeric */
   } *pb, body_attributes[] = {   /* cf. pcaldefs.h */
      { "bgcolor",	BGCOLOR,	TRUE },
      { "background",	BACKGROUND,	FALSE },
      { "text",		TEXT,		TRUE },
      { "link",		LINK,		TRUE },
      { "alink",	ALINK,		TRUE },
      { "vlink",	VLINK,		TRUE },
      { NULL,		NULL,		FALSE }   /* must be last */
   };

   this_day = 1;   /* initialize working date */
   this_month = init_month;
   this_year = init_year;
   RESET_DATE();
   
   /* HTML boilerplate */
   printf("<html>\n");
   printf("<head>\n");
   
   /*
    * if center footstring (-C) was specified, use it as the title;
    * otherwise contrive title from beginning/ending month/year
    */
   printf("<title>");
   if (cfoot[0]) {
      print_html(cfoot);
   }
   else {
      if (do_whole_year && init_month == JAN) {
         printf("%d", init_year);
         if (final_year > init_year) printf(" - %d", final_year);
      } 
      else {
         char c = date_style == EUR_DATES ? '.' : '/';
         printf("%d%c%02d", init_month, c, init_year % 100);
         if (nmonths > 1) {
            printf(" - %d%c%02d", final_month, c, final_year % 100);
         }
      }
   }
   printf("</title>\n");
   printf("</head>\n");
   
   /* generate <body> definition with attributes */
   printf("<body");
   for (pb = body_attributes; pb->attribute; pb++) {
      char *p = pb->value;
      if (p && *p) {
         printf(" %s=%s%s\"", pb->attribute,
                pb->numeric && p[0] != '#' ? "\"#" : "\"",
                pb->value);
      }
   }
   printf(">\n");
   
   /* repeat center footstring (if specified) as heading */
   if (cfoot[0]) {
      RESET_DATE();
      printf("%s", HEADING_PRE);
      print_html(cfoot);
      printf("%s\n", HEADING_POST);
   }
   
   /* loop over all specified months, creating HTML table for each */
   this_month = init_month;
   this_year = init_year;
   
   if (do_whole_year) {
      /* whole-year mode - generate 3- or 4-column tables */
      int j, nc;
      
      nc = (rotate == LANDSCAPE) ? 4 : 3;
      for (i = 0; i < nmonths; i += nc) {
         if (i > 0) printf("<p>\n");
         multiple_months_html(this_month, this_year, nc);
         for (j = 0; j < nc; j++) BUMP_MONTH_AND_YEAR(this_month, this_year);
      }
   }
   else {
      /* single-month mode - generate one month per table
       * either in one or several columns */
      if (one_column) printf("<TABLE><TR>");
      for (i = 0; i < nmonths; i++) {
         if (one_column) {
            printf("<TD valign=\"top\">");
            single_month_one_column_html(this_month, this_year);
            printf("</TD>");
         }
         else {
            printf("<TD valign=\"top\" width=\"%i%%\">",100/nmonths);
            if (i > 0) printf("<p><br>\n");
            single_month_html(this_month, this_year);
         }
         BUMP_MONTH_AND_YEAR(this_month, this_year);
      }
      printf("</TR></TABLE>");
   }
   
   /* boilerplate to terminate HTML file */
   printf("</body>\n");
   printf("</html>\n");

   return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl $0x1, %eax
movl %eax, 0x1c690(%rip)     # 0x2ffe8
leaq 0x1ab35(%rip), %r14     # 0x2e494
movl (%r14), %ecx
movl %ecx, 0x1c65c(%rip)     # 0x2ffc4
leaq 0x1ab29(%rip), %r15     # 0x2e498
movl (%r15), %edx
movl %edx, 0x1c650(%rip)     # 0x2ffc8
movl %ecx, 0x1c66e(%rip)     # 0x2ffec
movl %eax, 0x1c66c(%rip)     # 0x2fff0
movl %edx, 0x1c66a(%rip)     # 0x2fff4
leaq 0x11d4d(%rip), %rdi     # 0x256de
callq 0x50b0
leaq 0x11d48(%rip), %rdi     # 0x256e5
callq 0x50b0
leaq 0xfb00(%rip), %rdi      # 0x234a9
xorl %eax, %eax
callq 0x5130
leaq 0x19a99(%rip), %r12     # 0x2d450
cmpb $0x0, (%r12)
je 0x13b81
leaq 0x19a87(%rip), %rdi     # 0x2d450
callq 0x12e02
leaq 0x11d17(%rip), %rdi     # 0x256ec
callq 0x50b0
leaq 0x11d14(%rip), %rdi     # 0x256f5
callq 0x50b0
leaq 0xfad0(%rip), %rdi      # 0x234bd
xorl %eax, %eax
callq 0x5130
leaq 0x197e5(%rip), %rax     # 0x2d1e0
movq %rax, 0x1c5f6(%rip)     # 0x2fff8
movq 0x197d7(%rip), %rsi     # 0x2d1e0
testq %rsi, %rsi
je 0x13a74
leaq 0x34b4(%rip), %r13      # 0x16ec9
leaq 0xfab1(%rip), %rbp      # 0x234cd
leaq 0xfaa0(%rip), %rbx      # 0x234c3
movq 0x8(%rax), %rcx
testq %rcx, %rcx
je 0x13a5d
movb (%rcx), %dil
testb %dil, %dil
je 0x13a5d
cmpl $0x0, 0x10(%rax)
movq %r13, %rax
je 0x13a40
movq %rbp, %rax
movq %r13, %rdx
cmpb $0x23, %dil
je 0x13a4c
movq %rax, %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x5130
movq 0x1c59b(%rip), %rax     # 0x2fff8
leaq 0x18(%rax), %rcx
movq %rcx, 0x1c590(%rip)     # 0x2fff8
movq 0x18(%rax), %rsi
movq %rcx, %rax
testq %rsi, %rsi
jne 0x13a23
leaq 0xfab1(%rip), %rdi      # 0x2352c
callq 0x50b0
cmpb $0x0, (%r12)
je 0x13ad8
movl 0x1c537(%rip), %eax     # 0x2ffc4
movl %eax, 0x1c559(%rip)     # 0x2ffec
movl 0x1c54f(%rip), %eax     # 0x2ffe8
movl %eax, 0x1c551(%rip)     # 0x2fff0
movl 0x1c523(%rip), %eax     # 0x2ffc8
movl %eax, 0x1c549(%rip)     # 0x2fff4
leaq 0x339e(%rip), %rdi      # 0x16e50
leaq 0xfa17(%rip), %rsi      # 0x234d0
xorl %eax, %eax
callq 0x5130
leaq 0x19989(%rip), %rdi     # 0x2d450
callq 0x12e02
leaq 0xfa0f(%rip), %rdi      # 0x234e2
callq 0x50b0
movl (%r14), %edi
movl %edi, 0x1c4e3(%rip)     # 0x2ffc4
movl (%r15), %esi
movl %esi, 0x1c4de(%rip)     # 0x2ffc8
leaq 0x19bd3(%rip), %rax     # 0x2d6c4
cmpl $0x0, (%rax)
je 0x13bd8
leaq 0x15753(%rip), %rax     # 0x29254
xorl %ebx, %ebx
cmpl $0x5a, (%rax)
sete %al
leaq 0x1a98c(%rip), %r15     # 0x2e49c
cmpl $0x0, (%r15)
jle 0x13cc0
movb %al, %bl
addl $0x3, %ebx
xorl %ebp, %ebp
leaq 0xf9bf(%rip), %r14      # 0x234e7
testl %ebp, %ebp
je 0x13b40
movq %r14, %rdi
callq 0x50b0
movl 0x1c48a(%rip), %edi     # 0x2ffc4
movl 0x1c488(%rip), %esi     # 0x2ffc8
movl %ebx, %edx
callq 0x133ec
movl 0x1c477(%rip), %edi     # 0x2ffc4
movl 0x1c475(%rip), %esi     # 0x2ffc8
movl %ebx, %eax
cmpl $0xc, %edi
je 0x13b5e
incl %edi
jmp 0x13b6b
incl %esi
movl %esi, 0x1c462(%rip)     # 0x2ffc8
movl $0x1, %edi
decl %eax
jne 0x13b55
movl %edi, 0x1c44f(%rip)     # 0x2ffc4
addl %ebx, %ebp
cmpl (%r15), %ebp
jl 0x13b28
jmp 0x13cc0
leaq 0x19b3c(%rip), %rax     # 0x2d6c4
cmpl $0x0, (%rax)
setne %al
movl (%r14), %esi
cmpl $0x1, %esi
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x13ce6
movl (%r15), %esi
leaq 0xc73e(%rip), %rdi      # 0x202ea
xorl %eax, %eax
callq 0x5130
leaq 0x1aa22(%rip), %rax     # 0x2e5dc
movl (%rax), %esi
cmpl (%r15), %esi
jle 0x139ce
leaq 0xc71b(%rip), %rdi      # 0x202e7
xorl %eax, %eax
callq 0x5130
jmp 0x139ce
leaq 0x19aed(%rip), %r13     # 0x2d6cc
cmpl $0x0, (%r13)
je 0x13bf4
leaq 0xf8fe(%rip), %rdi      # 0x234eb
xorl %eax, %eax
callq 0x5130
leaq 0x1a8a1(%rip), %rbp     # 0x2e49c
movl (%rbp), %ecx
testl %ecx, %ecx
jle 0x13cb2
leaq 0xf902(%rip), %rbx      # 0x2350f
leaq 0xf8e3(%rip), %r15      # 0x234f7
leaq 0xf8ee(%rip), %r12      # 0x23509
xorl %r14d, %r14d
cmpl $0x0, (%r13)
je 0x13c4c
movq %r15, %rdi
xorl %eax, %eax
callq 0x5130
movl 0x1c38f(%rip), %edi     # 0x2ffc4
movl 0x1c38d(%rip), %esi     # 0x2ffc8
callq 0x12ea7
movq %r12, %rdi
xorl %eax, %eax
callq 0x5130
jmp 0x13c83
movl $0x64, %eax
xorl %edx, %edx
idivl %ecx
movq %rbx, %rdi
movl %eax, %esi
xorl %eax, %eax
callq 0x5130
testl %r14d, %r14d
je 0x13c72
leaq 0x11a90(%rip), %rdi     # 0x256fd
callq 0x50b0
movl 0x1c34c(%rip), %edi     # 0x2ffc4
movl 0x1c34a(%rip), %esi     # 0x2ffc8
callq 0x1285d
movl 0x1c33b(%rip), %eax     # 0x2ffc4
cmpl $0xc, %eax
jne 0x13c9b
incl 0x1c334(%rip)           # 0x2ffc8
movl $0x1, %eax
jmp 0x13c9d
incl %eax
movl %eax, 0x1c321(%rip)     # 0x2ffc4
incl %r14d
movl (%rbp), %ecx
cmpl %ecx, %r14d
jl 0x13c1e
leaq 0xf875(%rip), %rdi      # 0x2352e
xorl %eax, %eax
callq 0x5130
leaq 0x11a3e(%rip), %rdi     # 0x25705
callq 0x50b0
leaq 0x11a3a(%rip), %rdi     # 0x2570d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x50b0
leaq 0x198ff(%rip), %rax     # 0x2d5ec
xorl %ebx, %ebx
cmpl $0x1, (%rax)
sete %bl
xorl $0x2f, %ebx
movslq (%r15), %rcx
imulq $0x51eb851f, %rcx, %rax # imm = 0x51EB851F
movq %rax, %rdx
shrq $0x3f, %rdx
sarq $0x25, %rax
addl %edx, %eax
imull $0x64, %eax, %eax
subl %eax, %ecx
leaq 0xf799(%rip), %rdi      # 0x234b4
movl %ebx, %edx
xorl %eax, %eax
callq 0x5130
leaq 0x1a771(%rip), %rax     # 0x2e49c
cmpl $0x2, (%rax)
jl 0x139ce
leaq 0x1a89d(%rip), %rax     # 0x2e5d8
movl (%rax), %esi
leaq 0x1a898(%rip), %rax     # 0x2e5dc
movslq (%rax), %rcx
imulq $0x51eb851f, %rcx, %rax # imm = 0x51EB851F
movq %rax, %rdx
shrq $0x3f, %rdx
sarq $0x25, %rax
addl %edx, %eax
imull $0x64, %eax, %eax
subl %eax, %ecx
leaq 0xf74a(%rip), %rdi      # 0x234b1
movl %ebx, %edx
xorl %eax, %eax
callq 0x5130
jmp 0x139ce