#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 */
typedef int /*<<< orphan*/ vec;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int vec[3] = {10, 2, 3};
  int *ptr_v = vec;
  int value = 7;
  for (int i = 0; i < 5; i++) {
    *ptr_v++ *= value;
  }
  for (int i = 0; i < (sizeof(vec) / sizeof((vec)[0])); i++) {
    printf("%d\n", vec[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x7,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x5,-0x20(%rbp)
jge    1178 <main+0x68>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x18(%rbp)
imul   (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1149 <main+0x39>
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
cmp    $0x3,%rax
jae    11af <main+0x9f>
movslq -0x24(%rbp),%rax
mov    -0x10(%rbp,%rax,4),%esi
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    117f <main+0x6f>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x46,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xe,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x15,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 70)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 14)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 21)
ret i32 0
}