#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*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void set_simple_head(FILE *f, char *title, char *description, char *keywords) {
  fprintf(f, "<head>");
  fprintf(f, "<meta charset=\"UTF-8\" />");
  if (description)
    fprintf(f, "<meta name=\"description\" value=\"%s\" />", description);
  if (keywords)
    fprintf(f, "<meta name=\"keywords\" value=\"%s\" />", keywords);
  if (title)
    fprintf(f, "<title>%s</title>", title);
  fprintf(f, "</head>");
}


x86 assembly (clang, -O0):
<set_simple_head>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpq   $0x0,-0x18(%rbp)
je     116d <set_simple_head+0x5d>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xeba(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpq   $0x0,-0x20(%rbp)
je     118e <set_simple_head+0x7e>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpq   $0x0,-0x10(%rbp)
je     11af <set_simple_head+0x9f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xec3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_simple_head>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xeb3(%rip),%rdi
mov    $0x18,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
test   %r12,%r12
je     117f <set_simple_head+0x5f>
lea    0xeae(%rip),%rsi
mov    %rbx,%rdi
mov    %r12,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
test   %r15,%r15
je     1198 <set_simple_head+0x78>
lea    0xebc(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
test   %r14,%r14
je     11b1 <set_simple_head+0x91>
lea    0xec7(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xec5(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"<head>\00"
@.str.1 = [25 x i8] c"<meta charset=\22UTF-8\22 />\00"
@.str.2 = [39 x i8] c"<meta name=\22description\22 value=\22%s\22 />\00"
@.str.3 = [36 x i8] c"<meta name=\22keywords\22 value=\22%s\22 />\00"
@.str.4 = [18 x i8] c"<title>%s</title>\00"
@.str.5 = [8 x i8] c"</head>\00"
define void @set_simple_head(i32* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i32* %0, i32** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32*, i32** %5
%10 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%11 = load i32*, i32** %5
%12 = call i32 (i32*, i8*, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%13 = load i8*, i8** %7
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %19
15: ; preds = %4
%16 = load i32*, i32** %5
%17 = load i8*, i8** %7
%18 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %15, %4
%20 = load i8*, i8** %8
%21 = icmp ne i8* %20, null
br i1 %21, label %22, label %26
22: ; preds = %19
%23 = load i32*, i32** %5
%24 = load i8*, i8** %8
%25 = call i32 (i32*, i8*, ...) @fprintf(i32* %23, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8* %24)
br label %26
26: ; preds = %22, %19
%27 = load i8*, i8** %6
%28 = icmp ne i8* %27, null
br i1 %28, label %29, label %33
29: ; preds = %26
%30 = load i32*, i32** %5
%31 = load i8*, i8** %6
%32 = call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %31)
br label %33
33: ; preds = %29, %26
%34 = load i32*, i32** %5
%35 = call i32 (i32*, i8*, ...) @fprintf(i32* %34, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"<head>\00"
@.str.1 = [25 x i8] c"<meta charset=\22UTF-8\22 />\00"
@.str.2 = [39 x i8] c"<meta name=\22description\22 value=\22%s\22 />\00"
@.str.3 = [36 x i8] c"<meta name=\22keywords\22 value=\22%s\22 />\00"
@.str.4 = [18 x i8] c"<title>%s</title>\00"
@.str.5 = [8 x i8] c"</head>\00"
define void @set_simple_head(i32* nocapture %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 6, i64 1, i32* %0)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i64 24, i64 1, i32* %0)
%7 = icmp eq i8* %2, null
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %8, %4
%11 = icmp eq i8* %3, null
br i1 %11, label %14, label %12
12: ; preds = %10
%13 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8* %3)
br label %14
14: ; preds = %12, %10
%15 = icmp eq i8* %1, null
br i1 %15, label %18, label %16
16: ; preds = %14
%17 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %1)
br label %18
18: ; preds = %16, %14
%19 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i64 7, i64 1, i32* %0)
ret void
}