// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rbp
movl %ebp, 0x1cc42(%rip)     # 0x2efd8
leaq 0x1b0e7(%rip), %r15     # 0x2d484
movl (%r15), %eax
movl %eax, 0x1cc0e(%rip)     # 0x2efb4
leaq 0x1b0db(%rip), %r13     # 0x2d488
movl (%r13), %ecx
movl %ecx, 0x1cc01(%rip)     # 0x2efb8
movl %eax, 0x1cc1f(%rip)     # 0x2efdc
movl %ebp, 0x1cc1d(%rip)     # 0x2efe0
movl %ecx, 0x1cc1b(%rip)     # 0x2efe4
leaq 0x112be(%rip), %rdi     # 0x2368e
callq 0x50b0
leaq 0x112b9(%rip), %rdi     # 0x23695
callq 0x50b0
leaq 0xf071(%rip), %rdi      # 0x21459
xorl %eax, %eax
callq 0x5130
leaq 0x1a04a(%rip), %rax     # 0x2c440
cmpb $0x0, (%rax)
je 0x125ab
movq %r13, %r12
leaq 0x1a037(%rip), %rdi     # 0x2c440
callq 0x11aa6
leaq 0x11287(%rip), %rdi     # 0x2369c
callq 0x50b0
leaq 0x11284(%rip), %rdi     # 0x236a5
callq 0x50b0
leaq 0xf040(%rip), %rdi      # 0x2146d
xorl %eax, %eax
callq 0x5130
leaq 0x19d95(%rip), %rax     # 0x2c1d0
leaq 0x2a2f(%rip), %r13      # 0x14e71
leaq 0xf034(%rip), %r14      # 0x2147d
leaq 0xf023(%rip), %rbx      # 0x21473
movq %rax, 0x1cb91(%rip)     # 0x2efe8
movq (%rax), %rsi
testq %rsi, %rsi
je 0x1249f
movq 0x8(%rax), %rcx
testq %rcx, %rcx
je 0x12499
movb (%rcx), %dil
testb %dil, %dil
je 0x12499
cmpl $0x0, 0x10(%rax)
movq %r13, %rax
je 0x1247c
movq %r14, %rax
movq %r13, %rdx
cmpb $0x23, %dil
je 0x12488
movq %rax, %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x5130
movq 0x1cb4f(%rip), %rax     # 0x2efe8
addq $0x18, %rax
jmp 0x12450
leaq 0xf036(%rip), %rdi      # 0x214dc
callq 0x50b0
leaq 0x19f8e(%rip), %rax     # 0x2c440
cmpb $0x0, (%rax)
je 0x12508
movl 0x1caf7(%rip), %eax     # 0x2efb4
movl %eax, 0x1cb19(%rip)     # 0x2efdc
movl 0x1cb0f(%rip), %eax     # 0x2efd8
movl %eax, 0x1cb11(%rip)     # 0x2efe0
movl 0x1cae3(%rip), %eax     # 0x2efb8
movl %eax, 0x1cb09(%rip)     # 0x2efe4
leaq 0x2916(%rip), %rdi      # 0x14df8
leaq 0xef97(%rip), %rsi      # 0x21480
xorl %eax, %eax
callq 0x5130
leaq 0x19f49(%rip), %rdi     # 0x2c440
callq 0x11aa6
leaq 0xef8f(%rip), %rdi      # 0x21492
callq 0x50b0
movl (%r15), %edi
movl %edi, 0x1caa3(%rip)     # 0x2efb4
movl (%r12), %esi
movl %esi, 0x1ca9d(%rip)     # 0x2efb8
leaq 0x1a192(%rip), %rax     # 0x2c6b4
cmpl $0x0, (%rax)
je 0x12607
leaq 0x15d12(%rip), %rax     # 0x28244
xorl %ebx, %ebx
cmpl $0x5a, (%rax)
sete %bl
addl $0x3, %ebx
xorl %r15d, %r15d
leaq 0x1af45(%rip), %r12     # 0x2d48c
leaq 0xef49(%rip), %r14      # 0x21497
cmpl (%r12), %r15d
jge 0x126e2
testl %r15d, %r15d
je 0x12571
movq %r14, %rdi
callq 0x50b0
movl 0x1ca49(%rip), %edi     # 0x2efb4
movl 0x1ca47(%rip), %esi     # 0x2efb8
movl %ebx, %edx
callq 0x11f05
movl 0x1ca36(%rip), %edi     # 0x2efb4
movl 0x1ca34(%rip), %esi     # 0x2efb8
movl %ebx, %eax
subl $0x1, %eax
jb 0x125a0
cmpl $0xc, %edi
je 0x12594
incl %edi
jmp 0x12586
incl %esi
movl %esi, 0x1ca1c(%rip)     # 0x2efb8
movl %ebp, %edi
jmp 0x12586
movl %edi, 0x1ca0e(%rip)     # 0x2efb4
addl %ebx, %r15d
jmp 0x1254e
leaq 0x1a102(%rip), %rax     # 0x2c6b4
cmpl $0x0, (%rax)
setne %al
movl (%r15), %esi
cmpl $0x1, %esi
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x12708
movl (%r13), %esi
leaq 0xbcc3(%rip), %rdi      # 0x1e29a
xorl %eax, %eax
callq 0x5130
leaq 0x1afe7(%rip), %rax     # 0x2d5cc
movl (%rax), %esi
movq %r13, %r12
cmpl (%r13), %esi
jle 0x1240e
leaq 0xbc9c(%rip), %rdi      # 0x1e297
xorl %eax, %eax
callq 0x5130
jmp 0x1240e
leaq 0x1a0ae(%rip), %rbp     # 0x2c6bc
cmpl $0x0, (%rbp)
je 0x12622
leaq 0xee80(%rip), %rdi      # 0x2149b
xorl %eax, %eax
callq 0x5130
leaq 0x1ae63(%rip), %r15     # 0x2d48c
pushq $0x1
popq %rbx
leaq 0xee74(%rip), %r12      # 0x214a7
leaq 0xee7f(%rip), %r13      # 0x214b9
xorl %r14d, %r14d
movl (%r15), %ecx
cmpl %ecx, %r14d
jge 0x126d4
cmpl $0x0, (%rbp)
je 0x12676
movq %r12, %rdi
xorl %eax, %eax
callq 0x5130
movl 0x1c955(%rip), %edi     # 0x2efb4
movl 0x1c953(%rip), %esi     # 0x2efb8
callq 0x11b3c
movq %r13, %rdi
xorl %eax, %eax
callq 0x5130
jmp 0x126af
pushq $0x64
popq %rax
xorl %edx, %edx
idivl %ecx
leaq 0xee3b(%rip), %rdi      # 0x214bf
movl %eax, %esi
xorl %eax, %eax
callq 0x5130
testl %r14d, %r14d
je 0x1269e
leaq 0x11014(%rip), %rdi     # 0x236ad
callq 0x50b0
movl 0x1c910(%rip), %edi     # 0x2efb4
movl 0x1c90e(%rip), %esi     # 0x2efb8
callq 0x115e3
movl 0x1c8ff(%rip), %eax     # 0x2efb4
cmpl $0xc, %eax
jne 0x126c4
incl 0x1c8f8(%rip)           # 0x2efb8
movl %ebx, %eax
jmp 0x126c6
incl %eax
movl %eax, 0x1c8e8(%rip)     # 0x2efb4
incl %r14d
jmp 0x1263d
leaq 0xee03(%rip), %rdi      # 0x214de
xorl %eax, %eax
callq 0x5130
leaq 0x10fcc(%rip), %rdi     # 0x236b5
callq 0x50b0
leaq 0x10fc8(%rip), %rdi     # 0x236bd
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x50b0
leaq 0x19ecd(%rip), %rax     # 0x2c5dc
xorl %ebx, %ebx
cmpl $0x1, (%rax)
pushq $0x64
popq %r14
sete %bl
xorl $0x2f, %ebx
movq %r13, %r12
movl (%r13), %eax
cltd
idivl %r14d
movl %edx, %ecx
leaq 0xed32(%rip), %rdi      # 0x21464
movl %ebx, %edx
xorl %eax, %eax
callq 0x5130
leaq 0x1ad4a(%rip), %rax     # 0x2d48c
cmpl $0x2, (%rax)
jl 0x1240e
leaq 0x1ae76(%rip), %rax     # 0x2d5c8
movl (%rax), %esi
leaq 0x1ae71(%rip), %rax     # 0x2d5cc
movl (%rax), %eax
cltd
idivl %r14d
movl %edx, %ecx
leaq 0xecf7(%rip), %rdi      # 0x21461
movl %ebx, %edx
xorl %eax, %eax
callq 0x5130
jmp 0x1240e