#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 */

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
int main() {
  fprintf(stdout, "");
  fprintf(stdout, "Hello!\n");
  fprintf(stdout, "%u..%u..%u.. YAY!\n", 1, 2, 3);
  fprintf(stdout, "EOF is %i\n", -1);
  const char *s = "this is a string";
  fprintf(stdout, "\"%s\" is at %p\n", s, s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    0xef2(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x3,%r8d
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
mov    $0xffffffff,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
lea    0xe96(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xe8b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xef9(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x3,%r8d
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeba(%rip),%rsi
mov    $0xffffffff,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xec1(%rip),%rsi
lea    0xea9(%rip),%rcx
mov    %rcx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [8 x i8] c"Hello!\0A\00"
@.str.2 = [19 x i8] c"%u..%u..%u.. YAY!\0A\00"
@.str.3 = [11 x i8] c"EOF is %i\0A\00"
@.str.4 = [17 x i8] c"this is a string\00"
@.str.5 = [15 x i8] c"\22%s\22 is at %p\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = load i32, i32* @stdout
%3 = call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stdout
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 2, i32 3)
%8 = load i32, i32* @stdout
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 -1)
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8** %1
%10 = load i32, i32* @stdout
%11 = load i8*, i8** %1
%12 = load i8*, i8** %1
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* %11, i8* %12)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [8 x i8] c"Hello!\0A\00"
@.str.2 = [19 x i8] c"%u..%u..%u.. YAY!\0A\00"
@.str.3 = [11 x i8] c"EOF is %i\0A\00"
@.str.4 = [17 x i8] c"this is a string\00"
@.str.5 = [15 x i8] c"\22%s\22 is at %p\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 2, i32 3)
%7 = load i32, i32* @stdout
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 -1)
%9 = load i32, i32* @stdout
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}