// File: /workspace/github_c_makefile_star2_O1/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, 0x1bb45(%rip)     # 0x2efe8
leaq 0x19fea(%rip), %r14     # 0x2d494
movl (%r14), %ecx
movl %ecx, 0x1bb11(%rip)     # 0x2efc4
leaq 0x19fde(%rip), %r15     # 0x2d498
movl (%r15), %edx
movl %edx, 0x1bb05(%rip)     # 0x2efc8
movl %ecx, 0x1bb23(%rip)     # 0x2efec
movl %eax, 0x1bb21(%rip)     # 0x2eff0
movl %edx, 0x1bb1f(%rip)     # 0x2eff4
leaq 0x11192(%rip), %rdi     # 0x2466e
callq 0x50b0
leaq 0x1118d(%rip), %rdi     # 0x24675
callq 0x50b0
leaq 0xef45(%rip), %rdi      # 0x22439
xorl %eax, %eax
callq 0x5130
leaq 0x18f4e(%rip), %r12     # 0x2c450
cmpb $0x0, (%r12)
je 0x136c9
leaq 0x18f3c(%rip), %rdi     # 0x2c450
callq 0x12976
leaq 0x1115c(%rip), %rdi     # 0x2467c
callq 0x50b0
leaq 0x11159(%rip), %rdi     # 0x24685
callq 0x50b0
leaq 0xef15(%rip), %rdi      # 0x2244d
xorl %eax, %eax
callq 0x5130
leaq 0x18c9a(%rip), %rax     # 0x2c1e0
movq %rax, 0x1baab(%rip)     # 0x2eff8
movq 0x18c8c(%rip), %rsi     # 0x2c1e0
testq %rsi, %rsi
je 0x135bc
leaq 0x2911(%rip), %r13      # 0x15e71
leaq 0xeef6(%rip), %rbp      # 0x2245d
leaq 0xeee5(%rip), %rbx      # 0x22453
movq 0x8(%rax), %rcx
testq %rcx, %rcx
je 0x135a1
movb (%rcx), %dil
testb %dil, %dil
je 0x135a1
cmpl $0x0, 0x10(%rax)
movq %r13, %rax
je 0x1358b
movq %rbp, %rax
movq %r13, %rdx
cmpb $0x23, %dil
je 0x13597
movq %rax, %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x5130
movq 0x1ba50(%rip), %rcx     # 0x2eff8
leaq 0x18(%rcx), %rax
movq %rax, 0x1ba45(%rip)     # 0x2eff8
movq 0x18(%rcx), %rsi
testq %rsi, %rsi
jne 0x1356e
leaq 0xeef9(%rip), %rdi      # 0x224bc
callq 0x50b0
cmpb $0x0, (%r12)
je 0x13620
movl 0x1b9ef(%rip), %eax     # 0x2efc4
movl %eax, 0x1ba11(%rip)     # 0x2efec
movl 0x1ba07(%rip), %eax     # 0x2efe8
movl %eax, 0x1ba09(%rip)     # 0x2eff0
movl 0x1b9db(%rip), %eax     # 0x2efc8
movl %eax, 0x1ba01(%rip)     # 0x2eff4
leaq 0x27fe(%rip), %rdi      # 0x15df8
leaq 0xee5f(%rip), %rsi      # 0x22460
xorl %eax, %eax
callq 0x5130
leaq 0x18e41(%rip), %rdi     # 0x2c450
callq 0x12976
leaq 0xee57(%rip), %rdi      # 0x22472
callq 0x50b0
movl (%r14), %eax
movl %eax, 0x1b99b(%rip)     # 0x2efc4
movl (%r15), %eax
movl %eax, 0x1b996(%rip)     # 0x2efc8
leaq 0x1908b(%rip), %rax     # 0x2c6c4
cmpl $0x0, (%rax)
je 0x13720
leaq 0x14c0b(%rip), %rax     # 0x28254
xorl %ebx, %ebx
cmpl $0x5a, (%rax)
sete %al
leaq 0x19e44(%rip), %r15     # 0x2d49c
cmpl $0x0, (%r15)
jle 0x13808
movb %al, %bl
addl $0x3, %ebx
xorl %ebp, %ebp
leaq 0xee07(%rip), %r14      # 0x22477
testl %ebp, %ebp
je 0x1367c
movq %r14, %rdi
callq 0x50b0
movl 0x1b942(%rip), %edi     # 0x2efc4
movl 0x1b940(%rip), %esi     # 0x2efc8
movl %ebx, %edx
callq 0x12f6d
movl 0x1b92f(%rip), %edx     # 0x2efc4
movl 0x1b92d(%rip), %eax     # 0x2efc8
movl %ebx, %ecx
cmpl $0xc, %edx
je 0x136a6
incl %edx
jmp 0x136b3
incl %eax
movl %eax, 0x1b91a(%rip)     # 0x2efc8
movl $0x1, %edx
decl %ecx
jne 0x1369d
movl %edx, 0x1b907(%rip)     # 0x2efc4
addl %ebx, %ebp
cmpl (%r15), %ebp
jl 0x13670
jmp 0x13808
leaq 0x18ff4(%rip), %rax     # 0x2c6c4
cmpl $0x0, (%rax)
setne %al
movl (%r14), %esi
cmpl $0x1, %esi
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x1382e
movl (%r15), %esi
leaq 0xbb86(%rip), %rdi      # 0x1f27a
xorl %eax, %eax
callq 0x5130
leaq 0x19eda(%rip), %rax     # 0x2d5dc
movl (%rax), %esi
cmpl (%r15), %esi
jle 0x13519
leaq 0xbb63(%rip), %rdi      # 0x1f277
xorl %eax, %eax
callq 0x5130
jmp 0x13519
leaq 0x18fa5(%rip), %r13     # 0x2c6cc
cmpl $0x0, (%r13)
je 0x1373c
leaq 0xed46(%rip), %rdi      # 0x2247b
xorl %eax, %eax
callq 0x5130
leaq 0x19d59(%rip), %rbp     # 0x2d49c
movl (%rbp), %ecx
testl %ecx, %ecx
jle 0x137fa
leaq 0xed4a(%rip), %rbx      # 0x2249f
leaq 0xed2b(%rip), %r15      # 0x22487
leaq 0xed36(%rip), %r12      # 0x22499
xorl %r14d, %r14d
cmpl $0x0, (%r13)
je 0x13794
movq %r15, %rdi
xorl %eax, %eax
callq 0x5130
movl 0x1b847(%rip), %edi     # 0x2efc4
movl 0x1b845(%rip), %esi     # 0x2efc8
callq 0x12a1a
movq %r12, %rdi
xorl %eax, %eax
callq 0x5130
jmp 0x137cb
movl $0x64, %eax
xorl %edx, %edx
idivl %ecx
movq %rbx, %rdi
movl %eax, %esi
xorl %eax, %eax
callq 0x5130
testl %r14d, %r14d
je 0x137ba
leaq 0x10ed8(%rip), %rdi     # 0x2468d
callq 0x50b0
movl 0x1b804(%rip), %edi     # 0x2efc4
movl 0x1b802(%rip), %esi     # 0x2efc8
callq 0x123c9
movl 0x1b7f3(%rip), %eax     # 0x2efc4
cmpl $0xc, %eax
jne 0x137e3
incl 0x1b7ec(%rip)           # 0x2efc8
movl $0x1, %eax
jmp 0x137e5
incl %eax
movl %eax, 0x1b7d9(%rip)     # 0x2efc4
incl %r14d
movl (%rbp), %ecx
cmpl %ecx, %r14d
jl 0x13766
leaq 0xecbd(%rip), %rdi      # 0x224be
xorl %eax, %eax
callq 0x5130
leaq 0x10e86(%rip), %rdi     # 0x24695
callq 0x50b0
leaq 0x10e82(%rip), %rdi     # 0x2469d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x50b0
leaq 0x18db7(%rip), %rax     # 0x2c5ec
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 0xebe1(%rip), %rdi      # 0x22444
movl %ebx, %edx
xorl %eax, %eax
callq 0x5130
leaq 0x19c29(%rip), %rax     # 0x2d49c
cmpl $0x2, (%rax)
jl 0x13519
leaq 0x19d55(%rip), %rax     # 0x2d5d8
movl (%rax), %esi
leaq 0x19d50(%rip), %rax     # 0x2d5dc
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 0xeb92(%rip), %rdi      # 0x22441
movl %ebx, %edx
xorl %eax, %eax
callq 0x5130
jmp 0x13519