#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ dumpcss(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void htmlheaders(FILE *fp, int vc, char *cssfn, char *attribs_used) {
  fprintf(fp,
          "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" "
          "\"http://www.w3.org/TR/html4/strict.dtd\">\n"
          "<html>\n<head>\n<title>VC %d</title>\n",
          vc);
  if (cssfn)
    fprintf(fp, "<link type=\"text/css\" rel=\"stylesheet\" href=\"%s\">\n",
            cssfn);
  else if (attribs_used) {
    fputs("<style type=\"text/css\">\n", fp);
    dumpcss(fp, attribs_used);
    fputs("</style>\n", fp);
  }
  fprintf(fp, "</head>\n<body>\n<h1>VC %d</h1>", vc);
}


x86 assembly (clang, -O0):
<htmlheaders>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xeab(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
cmpq   $0x0,-0x18(%rbp)
je     1182 <htmlheaders+0x52>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xf09(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    11bf <htmlheaders+0x8f>
cmpq   $0x0,-0x20(%rbp)
je     11ba <htmlheaders+0x8a>
mov    -0x8(%rbp),%rsi
lea    0xf1a(%rip),%rdi
call   1040 <fputs@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <dumpcss@plt>
mov    -0x8(%rbp),%rsi
lea    0xf16(%rip),%rdi
call   1040 <fputs@plt>
jmp    11bf <htmlheaders+0x8f>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xf08(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htmlheaders>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbp
mov    %esi,%r15d
mov    %rdi,%rbx
lea    0xeb6(%rip),%rsi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
test   %rbp,%rbp
je     116f <htmlheaders+0x3f>
lea    0xf1f(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    11b1 <htmlheaders+0x81>
test   %r14,%r14
je     11b1 <htmlheaders+0x81>
lea    0xf37(%rip),%rdi
mov    $0x18,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <dumpcss@plt>
lea    0xf2c(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xf1d(%rip),%rsi
mov    %rbx,%rdi
mov    %r15d,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [127 x i8] c"<!DOCTYPE HTML PUBLIC \22-//W3C//DTD HTML 4.01//EN\22 \22http://www.w3.org/TR/html4/strict.dtd\22>\0A<html>\0A<head>\0A<title>VC %d</title>\0A\00"
@.str.1 = [51 x i8] c"<link type=\22text/css\22 rel=\22stylesheet\22 href=\22%s\22>\0A\00"
@.str.2 = [25 x i8] c"<style type=\22text/css\22>\0A\00"
@.str.3 = [10 x i8] c"</style>\0A\00"
@.str.4 = [30 x i8] c"</head>\0A<body>\0A<h1>VC %d</h1>\00"
define void @htmlheaders(i32* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i8*, i8** %7
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %18
14: ; preds = %4
%15 = load i32*, i32** %5
%16 = load i8*, i8** %7
%17 = call i32 (i32*, i8*, ...) @fprintf(i32* %15, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i8* %16)
br label %30
18: ; preds = %4
%19 = load i8*, i8** %8
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %29
21: ; preds = %18
%22 = load i32*, i32** %5
%23 = call i32 @fputs(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32* %22)
%24 = load i32*, i32** %5
%25 = load i8*, i8** %8
%26 = call i32 @dumpcss(i32* %24, i8* %25)
%27 = load i32*, i32** %5
%28 = call i32 @fputs(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32* %27)
br label %29
29: ; preds = %21, %18
br label %30
30: ; preds = %29, %14
%31 = load i32*, i32** %5
%32 = load i32, i32* %6
%33 = call i32 (i32*, i8*, ...) @fprintf(i32* %31, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i32 %32)
ret void
}

LLVM IR (-O2):
@.str = [127 x i8] c"<!DOCTYPE HTML PUBLIC \22-//W3C//DTD HTML 4.01//EN\22 \22http://www.w3.org/TR/html4/strict.dtd\22>\0A<html>\0A<head>\0A<title>VC %d</title>\0A\00"
@.str.1 = [51 x i8] c"<link type=\22text/css\22 rel=\22stylesheet\22 href=\22%s\22>\0A\00"
@.str.2 = [25 x i8] c"<style type=\22text/css\22>\0A\00"
@.str.3 = [10 x i8] c"</style>\0A\00"
@.str.4 = [30 x i8] c"</head>\0A<body>\0A<h1>VC %d</h1>\00"
define void @htmlheaders(i32* %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = icmp eq i8* %2, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %15
9: ; preds = %4
%10 = icmp eq i8* %3, null
br i1 %10, label %15, label %11
11: ; preds = %9
%12 = tail call i64 @fwrite(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i64 24, i64 1, i32* %0)
%13 = tail call i32 @dumpcss(i32* %0, i8* %3)
%14 = tail call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i64 9, i64 1, i32* %0)
br label %15
15: ; preds = %9, %11, %7
%16 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i32 %1)
ret void
}