#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*/ t;
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ fortune_cookie(char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char quote[] = "cookies make you fat";
  printf("This quote string is stored at: %p\n", quote);
  fortune_cookie(quote);
  int contestants[] = {1, 2, 3};
  int *choice = contestants;
  contestants[0] = 2;
  contestants[1] = contestants[2];
  contestants[2] = *choice;
  printf("I'm going to pick contestants number %i\n", contestants[2]);
  char s[] = "How big is it?";
  char *t = s;
  printf("Sizeof array %i\n", sizeof(s));
  printf("Sizeof pointer %i\n", sizeof(t));
  int drinks[] = {4, 2, 3};
  printf("1st order: %i drinks\n", drinks[0]);
  printf("1st order: %i drinks\n", *drinks);
  printf("3rd order: %i drinks\n", drinks[2]);
  printf("3rd order: %i drinks\n", *(drinks + 2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xec0(%rip),%al
mov    %al,-0xc(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <fortune_cookie@plt>
mov    0xf4b(%rip),%rax
mov    %rax,-0x2c(%rbp)
mov    0xf49(%rip),%eax
mov    %eax,-0x24(%rbp)
lea    -0x2c(%rbp),%rax
mov    %rax,-0x38(%rbp)
movl   $0x2,-0x2c(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xea6(%rip),%rax
mov    %rax,-0x47(%rbp)
mov    0xea4(%rip),%eax
mov    %eax,-0x3f(%rbp)
mov    0xe9e(%rip),%ax
mov    %ax,-0x3b(%rbp)
mov    0xe96(%rip),%al
mov    %al,-0x39(%rbp)
lea    -0x47(%rbp),%rax
mov    %rax,-0x50(%rbp)
lea    0xe85(%rip),%rdi
mov    $0xf,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe83(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xebe(%rip),%rax
mov    %rax,-0x5c(%rbp)
mov    0xebc(%rip),%eax
mov    %eax,-0x54(%rbp)
mov    -0x5c(%rbp),%esi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x5c(%rbp),%esi
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x54(%rbp),%esi
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x54(%rbp),%esi
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x74616620756f79,%rax
mov    %rax,0xd(%rsp)
lea    0xecf(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <fortune_cookie@plt>
lea    0xed7(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
mov    $0xf,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeeb(%rip),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedc(%rip),%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.quote = [21 x i8] c"cookies make you fat\00"
@.str = [36 x i8] c"This quote string is stored at: %p\0A\00"
@__const.main.contestants = [3 x i32] [i32 1, i32 2, i32 3]
@.str.1 = [41 x i8] c"I'm going to pick contestants number %i\0A\00"
@__const.main.s = [15 x i8] c"How big is it?\00"
@.str.2 = [17 x i8] c"Sizeof array %i\0A\00"
@.str.3 = [19 x i8] c"Sizeof pointer %i\0A\00"
@__const.main.drinks = [3 x i32] [i32 4, i32 2, i32 3]
@.str.4 = [22 x i8] c"1st order: %i drinks\0A\00"
@.str.5 = [22 x i8] c"3rd order: %i drinks\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [21 x i8]
%3 = alloca [3 x i32]
%4 = alloca i32*
%5 = alloca [15 x i8]
%6 = alloca i8*
%7 = alloca [3 x i32]
store i32 0, i32* %1
%8 = bitcast [21 x i8]* %2 to i8*
%9 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%12 = call i32 @fortune_cookie(i8* %11)
%13 = bitcast [3 x i32]* %3 to i8*
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
store i32* %14, i32** %4
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
store i32 2, i32* %15
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 2
%17 = load i32, i32* %16
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 1
store i32 %17, i32* %18
%19 = load i32*, i32** %4
%20 = load i32, i32* %19
%21 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 2
store i32 %20, i32* %21
%22 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 2
%23 = load i32, i32* %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 %23)
%25 = bitcast [15 x i8]* %5 to i8*
%26 = getelementptr inbounds [15 x i8], [15 x i8]* %5, i64 0, i64 0
store i8* %26, i8** %6
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i64 15)
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i64 8)
%29 = bitcast [3 x i32]* %7 to i8*
%30 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
%31 = load i32, i32* %30
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %31)
%33 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
%34 = load i32, i32* %33
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %34)
%36 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 2
%37 = load i32, i32* %36
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %37)
%39 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
%40 = getelementptr inbounds i32, i32* %39, i64 2
%41 = load i32, i32* %40
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %41)
ret i32 0
}

LLVM IR (-O2):
@__const.main.quote = [21 x i8] c"cookies make you fat\00"
@.str = [36 x i8] c"This quote string is stored at: %p\0A\00"
@.str.1 = [41 x i8] c"I'm going to pick contestants number %i\0A\00"
@.str.2 = [17 x i8] c"Sizeof array %i\0A\00"
@.str.3 = [19 x i8] c"Sizeof pointer %i\0A\00"
@.str.4 = [22 x i8] c"1st order: %i drinks\0A\00"
@.str.5 = [22 x i8] c"3rd order: %i drinks\0A\00"
define i32 @main() {
%1 = alloca [21 x i8]
%2 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @fortune_cookie(i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i64 15)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i64 8)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 4)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 4)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 3)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 3)
ret i32 0
}