#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*/ a_function(char *);
int /*<<< orphan*/ another_function();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ yet_another_function();
int main() {
  char message[] = "Hello World\n";
  printf("message: %s", message);
  a_function(message);
  another_function();
  yet_another_function();
  printf("message is stored at memory address: %zx\n", (size_t)&message[0]);
  printf("message values:\n");
  printf("char\tdec\thex\n");
  for (size_t c = 0; c < 13; ++c) {
    printf("%c\t%d\t%02x\n", message[c], message[c], message[c]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x11(%rbp)
mov    0xea8(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xea3(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x11(%rbp),%rsi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x11(%rbp),%rdi
call   1060 <a_function@plt>
mov    $0x0,%al
call   1030 <another_function@plt>
mov    $0x0,%al
call   1050 <yet_another_function@plt>
lea    -0x11(%rbp),%rsi
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movq   $0x0,-0x20(%rbp)
cmpq   $0xd,-0x20(%rbp)
jae    1210 <main+0xd0>
mov    -0x20(%rbp),%rax
movsbl -0x11(%rbp,%rax,1),%esi
mov    -0x20(%rbp),%rax
movsbl -0x11(%rbp,%rax,1),%edx
mov    -0x20(%rbp),%rax
movsbl -0x11(%rbp,%rax,1),%ecx
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    11cb <main+0x8b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0xa646c726f5720,%rax
mov    %rax,0x5(%rsp)
movabs $0x6f57206f6c6c6548,%rax
20 57 6f
mov    %rax,(%rsp)
lea    0xe94(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1070 <a_function@plt>
xor    %eax,%eax
call   1040 <another_function@plt>
xor    %eax,%eax
call   1060 <yet_another_function@plt>
lea    0xe76(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe9b(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9f(%rip),%rdi
call   1030 <puts@plt>
movsbl (%rsp),%ecx
lea    0xe73(%rip),%rbx
mov    %rbx,%rdi
mov    %ecx,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x1(%rsp),%ecx
mov    %rbx,%rdi
mov    %ecx,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x2(%rsp),%ecx
mov    %rbx,%rdi
mov    %ecx,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x3(%rsp),%ecx
mov    %rbx,%rdi
mov    %ecx,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x4(%rsp),%ecx
mov    %rbx,%rdi
mov    %ecx,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x5(%rsp),%ecx
mov    %rbx,%rdi
mov    %ecx,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x6(%rsp),%ecx
mov    %rbx,%rdi
mov    %ecx,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x7(%rsp),%ecx
mov    %rbx,%rdi
mov    %ecx,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x8(%rsp),%ecx
mov    %rbx,%rdi
mov    %ecx,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x9(%rsp),%ecx
mov    %rbx,%rdi
mov    %ecx,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0xa(%rsp),%ecx
mov    %rbx,%rdi
mov    %ecx,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0xb(%rsp),%ecx
mov    %rbx,%rdi
mov    %ecx,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0xc(%rsp),%ecx
mov    %rbx,%rdi
mov    %ecx,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.message = [13 x i8] c"Hello World\0A\00"
@.str = [12 x i8] c"message: %s\00"
@.str.1 = [42 x i8] c"message is stored at memory address: %zx\0A\00"
@.str.2 = [17 x i8] c"message values:\0A\00"
@.str.3 = [14 x i8] c"char\09dec\09hex\0A\00"
@.str.4 = [12 x i8] c"%c\09%d\09%02x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [13 x i8]
%3 = alloca i64
store i32 0, i32* %1
%4 = bitcast [13 x i8]* %2 to i8*
%5 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%8 = call i32 @a_function(i8* %7)
%9 = call i32 (...) @another_function()
%10 = call i32 (...) @yet_another_function()
%11 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%12 = ptrtoint i8* %11 to i64
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i64 %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
store i64 0, i64* %3
br label %16
16: ; preds = %33, %0
%17 = load i64, i64* %3
%18 = icmp ult i64 %17, 13
br i1 %18, label %19, label %36
19: ; preds = %16
%20 = load i64, i64* %3
%21 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = load i64, i64* %3
%25 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = load i64, i64* %3
%29 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %28
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %23, i32 %27, i32 %31)
br label %33
33: ; preds = %19
%34 = load i64, i64* %3
%35 = add i64 %34, 1
store i64 %35, i64* %3
br label %16
36: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
@__const.main.message = [13 x i8] c"Hello World\0A\00"
@.str = [12 x i8] c"message: %s\00"
@.str.1 = [42 x i8] c"message is stored at memory address: %zx\0A\00"
@.str.4 = [12 x i8] c"%c\09%d\09%02x\0A\00"
@str = [16 x i8] c"message values:\00"
@str.5 = [13 x i8] c"char\09dec\09hex\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @a_function(i8* %2)
%5 = call i32 (...) @another_function()
%6 = call i32 (...) @yet_another_function()
%7 = ptrtoint [13 x i8]* %1 to i64
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i64 %7)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.5, i64 0, i64 0))
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %12, i32 %12, i32 %12)
%14 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 1
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %16, i32 %16, i32 %16)
%18 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 2
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %20, i32 %20, i32 %20)
%22 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 3
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %24, i32 %24, i32 %24)
%26 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 4
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %28, i32 %28, i32 %28)
%30 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 5
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %32, i32 %32, i32 %32)
%34 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 6
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %36, i32 %36, i32 %36)
%38 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 7
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %40, i32 %40, i32 %40)
%42 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 8
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %44, i32 %44, i32 %44)
%46 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 9
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %48, i32 %48, i32 %48)
%50 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 10
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %52, i32 %52, i32 %52)
%54 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 11
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %56, i32 %56, i32 %56)
%58 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 12
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %60, i32 %60, i32 %60)
ret i32 0
}