int main() {
  char str[] = "helloooo karl!";
  printf("%i\n", sizeof(str));
  int intArr[] = {1, 2, 3, 1000};
  printf("%i\n", 3 [intArr]);
  fortune_cookie(str);
  int latVal = -30;
  int lonVal = 64;
  int *lat = &latVal;
  int *lon = &lonVal;
  go_south_east(lat, lon);
  printf("[%i,%i]", latVal, lonVal);
  printf("[%p,%p]", lat, lon);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xebf(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xeb9(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xeb1(%rip),%al
mov    %al,-0x1(%rbp)
lea    0xea8(%rip),%rdi
mov    $0xf,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xeb6(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xf(%rbp),%rdi
mov    $0x0,%al
call   1050 <fortune_cookie@plt>
movl   $0xffffffe2,-0x24(%rbp)
movl   $0x40,-0x28(%rbp)
lea    -0x24(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    $0x0,%al
call   1040 <go_south_east@plt>
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movabs $0x216c72616b206f,%rax
mov    %rax,0xf(%rsp)
movabs $0x6f6f6f6f6c6c6568,%rax
6f 6f 6f
mov    %rax,0x8(%rsp)
lea    0xeb3(%rip),%rbx
mov    $0xf,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rdi
xor    %eax,%eax
call   1050 <fortune_cookie@plt>
movl   $0xffffffe2,0x4(%rsp)
ff
movl   $0x40,(%rsp)
lea    0x4(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <go_south_east@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xe5b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe55(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.str = [15 x i8] c"helloooo karl!\00"
@.str = [4 x i8] c"%i\0A\00"
@__const.main.intArr = [4 x i32] [i32 1, i32 2, i32 3, i32 1000]
@.str.1 = [8 x i8] c"[%i,%i]\00"
@.str.2 = [8 x i8] c"[%p,%p]\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = alloca [4 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = bitcast [15 x i8]* %1 to i8*
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 15)
%9 = bitcast [4 x i32]* %2 to i8*
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 3
%11 = load i32, i32* %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @fortune_cookie to i32 (i8*, ...)*)(i8* %13)
store i32 -30, i32* %3
store i32 64, i32* %4
store i32* %3, i32** %5
store i32* %4, i32** %6
%15 = load i32*, i32** %5
%16 = load i32*, i32** %6
%17 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @go_south_east to i32 (i32*, i32*, ...)*)(i32* %15, i32* %16)
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %18, i32 %19)
%21 = load i32*, i32** %5
%22 = load i32*, i32** %6
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32* %21, i32* %22)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [15 x i8] c"helloooo karl!\00"
@.str = [4 x i8] c"%i\0A\00"
@.str.1 = [8 x i8] c"[%i,%i]\00"
@.str.2 = [8 x i8] c"[%p,%p]\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 15)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1000)
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @fortune_cookie to i32 (i8*, ...)*)(i8* %4)
%8 = bitcast i32* %2 to i8*
store i32 -30, i32* %2
%9 = bitcast i32* %3 to i8*
store i32 64, i32* %3
%10 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @go_south_east to i32 (i32*, i32*, ...)*)(i32* %2, i32* %3)
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %12)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32* %2, i32* %3)
ret i32 0
}