// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x1, 0x1cdc6(%rip)     # 0x35068
leaq 0x1b26b(%rip), %rax     # 0x33514
movl (%rax), %eax
movl %eax, 0x1cd93(%rip)     # 0x35044
leaq 0x1b260(%rip), %rax     # 0x33518
movl (%rax), %eax
movl %eax, 0x1cd88(%rip)     # 0x35048
movl 0x1cd7e(%rip), %eax     # 0x35044
movl %eax, 0x1cda0(%rip)     # 0x3506c
movl 0x1cd96(%rip), %eax     # 0x35068
movl %eax, 0x1cd98(%rip)     # 0x35070
movl 0x1cd6a(%rip), %eax     # 0x35048
movl %eax, 0x1cd90(%rip)     # 0x35074
leaq 0x123cf(%rip), %rdi     # 0x2a6ba
movb $0x0, %al
callq 0x5110
leaq 0x123c9(%rip), %rdi     # 0x2a6c2
movb $0x0, %al
callq 0x5110
leaq 0x123c3(%rip), %rdi     # 0x2a6ca
movb $0x0, %al
callq 0x5110
leaq 0x1a1bb(%rip), %rax     # 0x324d0
cmpb $0x0, (%rax)
je 0x1832b
leaq 0x1a1af(%rip), %rdi     # 0x324d0
callq 0x17500
jmp 0x1841e
leaq 0x1a412(%rip), %rax     # 0x32744
cmpl $0x0, (%rax)
je 0x1838a
leaq 0x1b1d6(%rip), %rax     # 0x33514
cmpl $0x1, (%rax)
jne 0x1838a
leaq 0x1b1ce(%rip), %rax     # 0x33518
movl (%rax), %esi
leaq 0xd20d(%rip), %rdi      # 0x25560
movb $0x0, %al
callq 0x5110
leaq 0x1b2fb(%rip), %rax     # 0x3365c
movl (%rax), %eax
leaq 0x1b1ae(%rip), %rcx     # 0x33518
cmpl (%rcx), %eax
jle 0x18385
leaq 0x1b2e7(%rip), %rax     # 0x3365c
movl (%rax), %esi
leaq 0xd1df(%rip), %rdi      # 0x2555d
movb $0x0, %al
callq 0x5110
jmp 0x1841c
leaq 0x1a2db(%rip), %rax     # 0x3266c
movl (%rax), %edx
movl $0x2f, %eax
movl $0x2e, %ecx
cmpl $0x1, %edx
cmovel %ecx, %eax
movb %al, -0x5(%rbp)
leaq 0x1b167(%rip), %rax     # 0x33514
movl (%rax), %esi
movsbl -0x5(%rbp), %eax
movl %eax, -0x1c(%rbp)
leaq 0x1b15b(%rip), %rax     # 0x33518
movl (%rax), %eax
movl $0x64, %ecx
cltd
idivl %ecx
movl %edx, %ecx
movl -0x1c(%rbp), %edx
leaq 0x12302(%rip), %rdi     # 0x2a6d5
movb $0x0, %al
callq 0x5110
leaq 0x1b13b(%rip), %rax     # 0x3351c
cmpl $0x1, (%rax)
jle 0x1841a
leaq 0x1b26b(%rip), %rax     # 0x33658
movl (%rax), %esi
movsbl -0x5(%rbp), %eax
movl %eax, -0x20(%rbp)
leaq 0x1b25f(%rip), %rax     # 0x3365c
movl (%rax), %eax
movl $0x64, %ecx
cltd
idivl %ecx
movl %edx, %ecx
movl -0x20(%rbp), %edx
leaq 0x122bf(%rip), %rdi     # 0x2a6d2
movb $0x0, %al
callq 0x5110
jmp 0x1841c
jmp 0x1841e
leaq 0x122b9(%rip), %rdi     # 0x2a6de
movb $0x0, %al
callq 0x5110
leaq 0x122b5(%rip), %rdi     # 0x2a6e8
movb $0x0, %al
callq 0x5110
leaq 0x122b0(%rip), %rdi     # 0x2a6f1
movb $0x0, %al
callq 0x5110
leaq 0x19df1(%rip), %rax     # 0x32240
movq %rax, 0x1cc22(%rip)     # 0x35078
movq 0x1cc1b(%rip), %rax     # 0x35078
cmpq $0x0, (%rax)
je 0x18507
movq 0x1cc0a(%rip), %rax     # 0x35078
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x184ee
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x184ee
movq 0x1cbe8(%rip), %rax     # 0x35078
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq 0x1cbda(%rip), %rcx     # 0x35078
xorl %eax, %eax
cmpl $0x0, 0x10(%rcx)
movb %al, -0x21(%rbp)
je 0x184b9
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
setne %al
movb %al, -0x21(%rbp)
movq -0x30(%rbp), %rsi
movb -0x21(%rbp), %cl
leaq 0x39b6(%rip), %rdx      # 0x1be7d
leaq 0x12233(%rip), %rax     # 0x2a701
testb $0x1, %cl
cmovneq %rax, %rdx
movq 0x1cb9c(%rip), %rax     # 0x35078
movq 0x8(%rax), %rcx
leaq 0x12210(%rip), %rdi     # 0x2a6f7
movb $0x0, %al
callq 0x5110
jmp 0x184f0
movq 0x1cb81(%rip), %rax     # 0x35078
addq $0x18, %rax
movq %rax, 0x1cb76(%rip)     # 0x35078
jmp 0x18456
leaq 0x12113(%rip), %rdi     # 0x2a621
movb $0x0, %al
callq 0x5110
leaq 0x19fb4(%rip), %rax     # 0x324d0
cmpb $0x0, (%rax)
je 0x1857b
movl 0x1cb1d(%rip), %eax     # 0x35044
movl %eax, 0x1cb3f(%rip)     # 0x3506c
movl 0x1cb35(%rip), %eax     # 0x35068
movl %eax, 0x1cb37(%rip)     # 0x35070
movl 0x1cb09(%rip), %eax     # 0x35048
movl %eax, 0x1cb2f(%rip)     # 0x35074
leaq 0x38b8(%rip), %rdi      # 0x1be04
leaq 0x121b1(%rip), %rsi     # 0x2a704
movb $0x0, %al
callq 0x5110
leaq 0x19f6f(%rip), %rdi     # 0x324d0
callq 0x17500
leaq 0x3b5c(%rip), %rdi      # 0x1c0c9
leaq 0x121a2(%rip), %rsi     # 0x2a716
movb $0x0, %al
callq 0x5110
leaq 0x1af92(%rip), %rax     # 0x33514
movl (%rax), %eax
movl %eax, 0x1caba(%rip)     # 0x35044
leaq 0x1af87(%rip), %rax     # 0x33518
movl (%rax), %eax
movl %eax, 0x1caaf(%rip)     # 0x35048
leaq 0x1a1a4(%rip), %rax     # 0x32744
cmpl $0x0, (%rax)
je 0x18668
leaq 0x15c74(%rip), %rax     # 0x2e224
movl (%rax), %edx
movl $0x3, %eax
movl $0x4, %ecx
cmpl $0x5a, %edx
cmovel %ecx, %eax
movl %eax, -0x18(%rbp)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
leaq 0x1af46(%rip), %rcx     # 0x3351c
cmpl (%rcx), %eax
jge 0x18663
cmpl $0x0, -0x4(%rbp)
jle 0x185f2
leaq 0x12134(%rip), %rdi     # 0x2a71f
movb $0x0, %al
callq 0x5110
movl 0x1ca4c(%rip), %edi     # 0x35044
movl 0x1ca4a(%rip), %esi     # 0x35048
movl -0x18(%rbp), %edx
callq 0x17cb0
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x18653
cmpl $0xc, 0x1ca28(%rip)     # 0x35044
jne 0x18639
movl 0x1ca24(%rip), %eax     # 0x35048
addl $0x1, %eax
movl %eax, 0x1ca1b(%rip)     # 0x35048
movl $0x1, 0x1ca0d(%rip)     # 0x35044
jmp 0x18648
movl 0x1ca05(%rip), %eax     # 0x35044
addl $0x1, %eax
movl %eax, 0x1c9fc(%rip)     # 0x35044
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1860d
jmp 0x18655
movl -0x18(%rbp), %eax
addl -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x185cc
jmp 0x18769
leaq 0x1a0dd(%rip), %rax     # 0x3274c
cmpl $0x0, (%rax)
je 0x18682
leaq 0x120a9(%rip), %rdi     # 0x2a724
movb $0x0, %al
callq 0x5110
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
leaq 0x1ae89(%rip), %rcx     # 0x3351c
cmpl (%rcx), %eax
jge 0x1875b
leaq 0x1a0aa(%rip), %rax     # 0x3274c
cmpl $0x0, (%rax)
je 0x186d6
leaq 0x12082(%rip), %rdi     # 0x2a730
movb $0x0, %al
callq 0x5110
movl 0x1c989(%rip), %edi     # 0x35044
movl 0x1c987(%rip), %esi     # 0x35048
callq 0x17620
leaq 0x12075(%rip), %rdi     # 0x2a742
movb $0x0, %al
callq 0x5110
jmp 0x1871a
movl $0x64, %eax
leaq 0x1ae3a(%rip), %rcx     # 0x3351c
cltd
idivl (%rcx)
movl %eax, %esi
leaq 0x1205a(%rip), %rdi     # 0x2a748
movb $0x0, %al
callq 0x5110
cmpl $0x0, -0x4(%rbp)
jle 0x18709
leaq 0x12065(%rip), %rdi     # 0x2a767
movb $0x0, %al
callq 0x5110
movl 0x1c935(%rip), %edi     # 0x35044
movl 0x1c933(%rip), %esi     # 0x35048
callq 0x16ed0
cmpl $0xc, 0x1c923(%rip)     # 0x35044
jne 0x1873e
movl 0x1c91f(%rip), %eax     # 0x35048
addl $0x1, %eax
movl %eax, 0x1c916(%rip)     # 0x35048
movl $0x1, 0x1c908(%rip)     # 0x35044
jmp 0x1874d
movl 0x1c900(%rip), %eax     # 0x35044
addl $0x1, %eax
movl %eax, 0x1c8f7(%rip)     # 0x35044
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x18689
leaq 0x1200e(%rip), %rdi     # 0x2a770
movb $0x0, %al
callq 0x5110
leaq 0x1200e(%rip), %rdi     # 0x2a77e
movb $0x0, %al
callq 0x5110
leaq 0x12009(%rip), %rdi     # 0x2a787
movb $0x0, %al
callq 0x5110
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)