#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*/ fill_array(int *, int, int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int x[7];
  int y[] = {2, 3, 7, 11, 13, 17, 19};
  int z[7];
  char str[] = "goodbye cruel world";
  char str2[7];
  int i;
  int start = 3;
  for (i = 0; i < 7; ++i) {
    if (i == 0) {
      x[i] = start;
    } else {
      x[i] = (x[i - 1] + x[i - 1]);
    }
    printf(" x[%d] = %d \n", i, x[i]);
  }
  printf("\n");
  for (i = 0; i < 7; ++i) {
    printf(" y[%d] = %d \n", i, y[i]);
  }
  printf("\n");
  fill_array(z, 7, 27);
  for (i = 0; i < 7; ++i) {
    printf(" z[%d] = %d \n", i, z[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xebf(%rip),%eax
mov    %eax,-0x28(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    0xeb8(%rip),%eax
mov    %eax,-0x70(%rbp)
movl   $0x3,-0x90(%rbp)
movl   $0x0,-0x8c(%rbp)
cmpl   $0x7,-0x8c(%rbp)
jge    121b <main+0xfb>
cmpl   $0x0,-0x8c(%rbp)
jne    11bf <main+0x9f>
mov    -0x90(%rbp),%ecx
movslq -0x8c(%rbp),%rax
mov    %ecx,-0x20(%rbp,%rax,4)
jmp    11e8 <main+0xc8>
mov    -0x8c(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x20(%rbp,%rax,4),%ecx
mov    -0x8c(%rbp),%eax
sub    $0x1,%eax
cltq
add    -0x20(%rbp,%rax,4),%ecx
movslq -0x8c(%rbp),%rax
mov    %ecx,-0x20(%rbp,%rax,4)
mov    -0x8c(%rbp),%esi
movslq -0x8c(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edx
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    118f <main+0x6f>
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8c(%rbp)
cmpl   $0x7,-0x8c(%rbp)
jge    1273 <main+0x153>
mov    -0x8c(%rbp),%esi
movslq -0x8c(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edx
lea    0xdea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    1233 <main+0x113>
lea    0xdc6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x60(%rbp),%rdi
mov    $0x7,%esi
mov    $0x1b,%edx
call   1040 <fill_array@plt>
movl   $0x0,-0x8c(%rbp)
cmpl   $0x7,-0x8c(%rbp)
jge    12de <main+0x1be>
mov    -0x8c(%rbp),%esi
movslq -0x8c(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%edx
lea    0xd8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    129e <main+0x17e>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x6,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0xc,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x18,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x30,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x60,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0xc0,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe38(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x7,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0xb,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0xd,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x11,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x13,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rsp,%rdi
mov    $0x7,%esi
mov    $0x1b,%edx
call   1050 <fill_array@plt>
mov    (%rsp),%edx
lea    0xd97(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%edx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%edx
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%edx
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp),%edx
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.y = [7 x i32] [i32 2, i32 3, i32 7, i32 11, i32 13, i32 17, i32 19]
@__const.main.str = [20 x i8] c"goodbye cruel world\00"
@.str = [14 x i8] c" x[%d] = %d \0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [14 x i8] c" y[%d] = %d \0A\00"
@.str.3 = [14 x i8] c" z[%d] = %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
%3 = alloca [7 x i32]
%4 = alloca [7 x i32]
%5 = alloca [20 x i8]
%6 = alloca [7 x i8]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = bitcast [7 x i32]* %3 to i8*
%10 = bitcast [20 x i8]* %5 to i8*
store i32 3, i32* %8
store i32 0, i32* %7
br label %11
11: ; preds = %44, %0
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 7
br i1 %13, label %14, label %47
14: ; preds = %11
%15 = load i32, i32* %7
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %14
%18 = load i32, i32* %8
%19 = load i32, i32* %7
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 %20
store i32 %18, i32* %21
br label %37
22: ; preds = %14
%23 = load i32, i32* %7
%24 = sub nsw i32 %23, 1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = load i32, i32* %7
%29 = sub nsw i32 %28, 1
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 %30
%32 = load i32, i32* %31
%33 = add nsw i32 %27, %32
%34 = load i32, i32* %7
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 %35
store i32 %33, i32* %36
br label %37
37: ; preds = %22, %17
%38 = load i32, i32* %7
%39 = load i32, i32* %7
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 %40
%42 = load i32, i32* %41
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %38, i32 %42)
br label %44
44: ; preds = %37
%45 = load i32, i32* %7
%46 = add nsw i32 %45, 1
store i32 %46, i32* %7
br label %11
47: ; preds = %11
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %7
br label %49
49: ; preds = %59, %47
%50 = load i32, i32* %7
%51 = icmp slt i32 %50, 7
br i1 %51, label %52, label %62
52: ; preds = %49
%53 = load i32, i32* %7
%54 = load i32, i32* %7
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 %55
%57 = load i32, i32* %56
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %53, i32 %57)
br label %59
59: ; preds = %52
%60 = load i32, i32* %7
%61 = add nsw i32 %60, 1
store i32 %61, i32* %7
br label %49
62: ; preds = %49
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%64 = getelementptr inbounds [7 x i32], [7 x i32]* %4, i64 0, i64 0
%65 = call i32 @fill_array(i32* %64, i32 7, i32 27)
store i32 0, i32* %7
br label %66
66: ; preds = %76, %62
%67 = load i32, i32* %7
%68 = icmp slt i32 %67, 7
br i1 %68, label %69, label %79
69: ; preds = %66
%70 = load i32, i32* %7
%71 = load i32, i32* %7
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [7 x i32], [7 x i32]* %4, i64 0, i64 %72
%74 = load i32, i32* %73
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %70, i32 %74)
br label %76
76: ; preds = %69
%77 = load i32, i32* %7
%78 = add nsw i32 %77, 1
store i32 %78, i32* %7
br label %66
79: ; preds = %66
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c" x[%d] = %d \0A\00"
@.str.2 = [14 x i8] c" y[%d] = %d \0A\00"
@.str.3 = [14 x i8] c" z[%d] = %d \0A\00"
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 0, i32 3)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 1, i32 6)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 2, i32 12)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 3, i32 24)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 4, i32 48)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 5, i32 96)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 6, i32 192)
%10 = tail call i32 @putchar(i32 10)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 2)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 3)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 2, i32 7)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 3, i32 11)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 4, i32 13)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 5, i32 17)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 6, i32 19)
%18 = tail call i32 @putchar(i32 10)
%19 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%20 = call i32 @fill_array(i32* %19, i32 7, i32 27)
%21 = load i32, i32* %19
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 %21)
%23 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 1
%24 = load i32, i32* %23
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 1, i32 %24)
%26 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 2
%27 = load i32, i32* %26
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 2, i32 %27)
%29 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 3
%30 = load i32, i32* %29
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 3, i32 %30)
%32 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 4
%33 = load i32, i32* %32
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 4, i32 %33)
%35 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 5
%36 = load i32, i32* %35
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 5, i32 %36)
%38 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 6
%39 = load i32, i32* %38
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 6, i32 %39)
ret i32 0
}