#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, "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    0xed8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x3,%r8d
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
mov    $0xffffffff,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
lea    0xead(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xea2(%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    0xedf(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed7(%rip),%rsi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x3,%r8d
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeca(%rip),%rsi
mov    $0xffffffff,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed1(%rip),%rsi
lea    0xeb9(%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 = [8 x i8] c"Hello!\0A\00"
@.str.1 = [19 x i8] c"%u..%u..%u.. YAY!\0A\00"
@.str.2 = [11 x i8] c"EOF is %i\0A\00"
@.str.3 = [17 x i8] c"this is a string\00"
@.str.4 = [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 ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 2, i32 3)
%6 = load i32, i32* @stdout
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 -1)
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8** %1
%8 = load i32, i32* @stdout
%9 = load i8*, i8** %1
%10 = load i8*, i8** %1
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %9, i8* %10)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [8 x i8] c"Hello!\0A\00"
@.str.1 = [19 x i8] c"%u..%u..%u.. YAY!\0A\00"
@.str.2 = [11 x i8] c"EOF is %i\0A\00"
@.str.3 = [17 x i8] c"this is a string\00"
@.str.4 = [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 ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 2, i32 3)
%5 = load i32, i32* @stdout
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 -1)
%7 = load i32, i32* @stdout
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}