#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*/ *fopen(char const *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
FILE *createHeader(const char *name, FILE *out) {
  char htmlName[512];
  out = fopen(name, "w");
  fputs("<DOCTYPE! html>\n", out);
  fputs("<html lang=\"fr-CA\">\n", out);
  fputs("<head>\n <meta http-equiv=\"Content-Type\" "
        "content=\"text/html;charset=UTF-8\">\n",
        out);
  fputs(" <link rel=\"stylesheet\" type=\"text/css\" href=\"css/forthex.css\">",
        out);
  fputs("</head>\n<body id=\"#top\">\n", out);
  return out;
}


x86 assembly (clang, -O0):
<createHeader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x10(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x10(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x10(%rbp),%rsi
lea    0xef2(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x10(%rbp),%rsi
lea    0xf22(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x10(%rbp),%rax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createHeader>:
push   %rbx
lea    0xed8(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdi
mov    $0x10,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1040 <fwrite@plt>
lea    0xec3(%rip),%rdi
mov    $0x14,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xebf(%rip),%rdi
mov    $0x4b,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xef2(%rip),%rdi
mov    $0x3f,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xf19(%rip),%rdi
mov    $0x19,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [17 x i8] c"<DOCTYPE! html>\0A\00"
@.str.2 = [21 x i8] c"<html lang=\22fr-CA\22>\0A\00"
@.str.3 = [76 x i8] c"<head>\0A <meta http-equiv=\22Content-Type\22 content=\22text/html;charset=UTF-8\22>\0A\00"
@.str.4 = [64 x i8] c" <link rel=\22stylesheet\22 type=\22text/css\22 href=\22css/forthex.css\22>\00"
@.str.5 = [26 x i8] c"</head>\0A<body id=\22#top\22>\0A\00"
define i32* @createHeader(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca [512 x i8]
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %4
%8 = load i32*, i32** %4
%9 = call i32 @fputs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%10 = load i32*, i32** %4
%11 = call i32 @fputs(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32* %10)
%12 = load i32*, i32** %4
%13 = call i32 @fputs(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.3, i64 0, i64 0), i32* %12)
%14 = load i32*, i32** %4
%15 = call i32 @fputs(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.4, i64 0, i64 0), i32* %14)
%16 = load i32*, i32** %4
%17 = call i32 @fputs(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32* %16)
%18 = load i32*, i32** %4
ret i32* %18
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [17 x i8] c"<DOCTYPE! html>\0A\00"
@.str.2 = [21 x i8] c"<html lang=\22fr-CA\22>\0A\00"
@.str.3 = [76 x i8] c"<head>\0A <meta http-equiv=\22Content-Type\22 content=\22text/html;charset=UTF-8\22>\0A\00"
@.str.4 = [64 x i8] c" <link rel=\22stylesheet\22 type=\22text/css\22 href=\22css/forthex.css\22>\00"
@.str.5 = [26 x i8] c"</head>\0A<body id=\22#top\22>\0A\00"
define noalias i32* @createHeader(i8* nocapture %0, i32* nocapture readnone %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i64 16, i64 1, i32* %3)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i64 20, i64 1, i32* %3)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.3, i64 0, i64 0), i64 75, i64 1, i32* %3)
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.4, i64 0, i64 0), i64 63, i64 1, i32* %3)
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i64 25, i64 1, i32* %3)
ret i32* %3
}