#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*/ printf(char *, ...);
int main(void) {
  int value1 = 44;
  int arr[4];
  int value2 = 88;
  int i;
  printf("value1 = %d, value2 = %d\n", value1, value2);
  for (i = -1; i <= 4; i++)
    arr[i] = 2 * i + 1;
  for (i = -1; i < 7; i++)
    printf("%2d  %d\n", i, arr[i]);
  printf("value1 = %d, value2 = %d\n", value1, value2);
  printf("address of arr[-1]: %p\n", &arr[-1]);
  printf("address of arr[4]: %p\n", &arr[4]);
  printf("address of value1: %p\n", &value1);
  printf("address of value2: %p\n", &value2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2c,-0x8(%rbp)
movl   $0x58,-0x24(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x28(%rbp)
cmpl   $0x4,-0x28(%rbp)
jg     1171 <main+0x61>
mov    -0x28(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq -0x28(%rbp),%rax
mov    %ecx,-0x20(%rbp,%rax,4)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1148 <main+0x38>
movl   $0xffffffff,-0x28(%rbp)
cmpl   $0x7,-0x28(%rbp)
jge    11a9 <main+0x99>
mov    -0x28(%rbp),%esi
movslq -0x28(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edx
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1178 <main+0x68>
mov    -0x8(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
add    $0xfffffffffffffffc,%rsi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
add    $0x10,%rsi
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe62(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe67(%rip),%rdi
lea    -0x24(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
movl   $0x2c,0xc(%rsp)
movl   $0x58,0x8(%rsp)
lea    0xede(%rip),%r12
mov    %r12,%rdi
mov    $0x2c,%esi
mov    $0x58,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc(%rsp),%r15
movaps 0xeae(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movabs $0x900000007,%rax
mov    %rax,0x1c(%rsp)
lea    0x20(%rsp),%r14
lea    0xeb8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x5,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x7,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x9,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r12,%rdi
mov    $0x2c,%esi
mov    $0x58,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe13(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe1a(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe20(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe24(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [26 x i8] c"value1 = %d, value2 = %d\0A\00"
@.str.1 = [9 x i8] c"%2d %d\0A\00"
@.str.2 = [24 x i8] c"address of arr[-1]: %p\0A\00"
@.str.3 = [23 x i8] c"address of arr[4]: %p\0A\00"
@.str.4 = [23 x i8] c"address of value1: %p\0A\00"
@.str.5 = [23 x i8] c"address of value2: %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [4 x i32]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 44, i32* %2
store i32 88, i32* %4
%6 = load i32, i32* %2
%7 = load i32, i32* %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
store i32 -1, i32* %5
br label %9
9: ; preds = %19, %0
%10 = load i32, i32* %5
%11 = icmp sle i32 %10, 4
br i1 %11, label %12, label %22
12: ; preds = %9
%13 = load i32, i32* %5
%14 = mul nsw i32 2, %13
%15 = add nsw i32 %14, 1
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 %17
store i32 %15, i32* %18
br label %19
19: ; preds = %12
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %9
22: ; preds = %9
store i32 -1, i32* %5
br label %23
23: ; preds = %33, %22
%24 = load i32, i32* %5
%25 = icmp slt i32 %24, 7
br i1 %25, label %26, label %36
26: ; preds = %23
%27 = load i32, i32* %5
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 %29
%31 = load i32, i32* %30
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %27, i32 %31)
br label %33
33: ; preds = %26
%34 = load i32, i32* %5
%35 = add nsw i32 %34, 1
store i32 %35, i32* %5
br label %23
36: ; preds = %23
%37 = load i32, i32* %2
%38 = load i32, i32* %4
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %37, i32 %38)
%40 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 -1
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32* %40)
%42 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 4
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32* %42)
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32* %2)
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i32* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"value1 = %d, value2 = %d\0A\00"
@.str.1 = [9 x i8] c"%2d %d\0A\00"
@.str.2 = [24 x i8] c"address of arr[-1]: %p\0A\00"
@.str.3 = [23 x i8] c"address of arr[4]: %p\0A\00"
@.str.4 = [23 x i8] c"address of value1: %p\0A\00"
@.str.5 = [23 x i8] c"address of value2: %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
store i32 44, i32* %1
%5 = bitcast [4 x i32]* %2 to i8*
%6 = bitcast i32* %3 to i8*
store i32 88, i32* %3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 44, i32 88)
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 -1
%9 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> <i32 -1, i32 1, i32 3, i32 5>, <4 x i32>* %9
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 3
store i32 7, i32* %10
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 4
store i32 9, i32* %11
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 -1, i32 -1)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 1)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 3)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 5)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 7)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 9)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 undef)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 6, i32 undef)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 44, i32 88)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32* %8)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32* %11)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i32* %3)
ret i32 0
}