#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 main7() {
  int iArr[5] = {0, 0, 0, 0, 0};
  for (int i = 0; i < 5; i++) {
    iArr[i] = (2 * i) + 1;
  }
  printf("size of integer is %d\n\n", sizeof(int));
  for (int i = 0; i < 5; i++) {
    printf("memory address %p \n", &iArr[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    1168 <main7+0x48>
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq -0x24(%rbp),%rax
mov    %ecx,-0x20(%rbp,%rax,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    113f <main7+0x1f>
lea    0xe91(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x28(%rbp)
cmpl   $0x5,-0x28(%rbp)
jge    11b7 <main7+0x97>
movslq -0x28(%rbp),%rax
lea    -0x20(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1182 <main7+0x62>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main7>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
lea    0x4(%rsp),%r13
lea    0x8(%rsp),%r12
lea    0xc(%rsp),%r15
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%r14
movl   $0x9,0x10(%rsp)
lea    0xec5(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeca(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [24 x i8] c"size of integer is %d\0A\0A\00"
@.str.1 = [20 x i8] c"memory address %p \0A\00"
define i32 @main7() {
%1 = alloca [5 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [5 x i32]* %1 to i8*
store i32 0, i32* %2
br label %5
5: ; preds = %15, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 5
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = load i32, i32* %2
%10 = mul nsw i32 2, %9
%11 = add nsw i32 %10, 1
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 %13
store i32 %11, i32* %14
br label %15
15: ; preds = %8
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %5
18: ; preds = %5
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 4)
store i32 0, i32* %3
br label %20
20: ; preds = %28, %18
%21 = load i32, i32* %3
%22 = icmp slt i32 %21, 5
br i1 %22, label %23, label %31
23: ; preds = %20
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 %25
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32* %26)
br label %28
28: ; preds = %23
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %20
31: ; preds = %20
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"size of integer is %d\0A\0A\00"
@.str.1 = [20 x i8] c"memory address %p \0A\00"
define i32 @main7() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 3
%7 = bitcast [5 x i32]* %1 to <4 x i32>*
store <4 x i32> <i32 1, i32 3, i32 5, i32 7>, <4 x i32>* %7
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 4
store i32 9, i32* %8
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 4)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32* %8)
ret i32 0
}