#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int, ...);
int main(void) {
  int vector[10];
  int *ptr;
  int i;
  for (i = 0; i < 10; i++)
    vector[i] = 100 + i;
  printf("Vector = 0x%lx\n", (unsigned long)vector);
  ptr = vector;
  for (i = 0; i < 10; i++, ptr++) {
    printf("[%d] Vector[%d]:%d <-> ptr(0x%lx):%d\n", i, i, vector[i],
           (unsigned long)ptr, *ptr);
  }
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0xa,-0x3c(%rbp)
jge    114c <main+0x3c>
mov    -0x3c(%rbp),%ecx
add    $0x64,%ecx
movslq -0x3c(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1126 <main+0x16>
lea    -0x30(%rbp),%rax
mov    %eax,%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0xa,-0x3c(%rbp)
jge    11ba <main+0xaa>
mov    -0x3c(%rbp),%esi
mov    -0x3c(%rbp),%edx
movslq -0x3c(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%ecx
mov    -0x38(%rbp),%r8
mov    -0x38(%rbp),%rax
mov    (%rax),%r9d
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x38(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x38(%rbp)
jmp    116f <main+0x5f>
mov    0x2e1f(%rip),%rax
mov    (%rax),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0x4(%rsp),%r13
lea    0x8(%rsp),%r12
lea    0xc(%rsp),%r15
movaps 0xecc(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%r14
movaps 0xecc(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0x6d0000006c,%rax
mov    %rax,0x20(%rsp)
mov    %rsp,%rbp
lea    0xebe(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%ecx
lea    0xebb(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    %rbp,%r8
mov    %ecx,%r9d
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r13,%r8
mov    %ecx,%r9d
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
mov    %r12,%r8
mov    %ecx,%r9d
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
mov    %r15,%r8
mov    %ecx,%r9d
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x4,%edx
mov    %r14,%r8
mov    %ecx,%r9d
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x14(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x5,%edx
lea    0x14(%rsp),%r8
mov    %ecx,%r9d
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x18(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x6,%edx
lea    0x18(%rsp),%r8
mov    %ecx,%r9d
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x1c(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x7,%edx
lea    0x1c(%rsp),%r8
mov    %ecx,%r9d
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x20(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x8,%edx
lea    0x20(%rsp),%r8
mov    %ecx,%r9d
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x24(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x9,%esi
mov    $0x9,%edx
lea    0x24(%rsp),%r8
mov    %ecx,%r9d
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2d38(%rip),%rax
mov    (%rax),%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"Vector = 0x%lx\0A\00"
@.str.1 = [38 x i8] c"[%d] Vector[%d]:%d <-> ptr(0x%lx):%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%7 = bitcast [10 x i32]* %1 to <4 x i32>*
store <4 x i32> <i32 100, i32 101, i32 102, i32 103>, <4 x i32>* %7
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%12 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> <i32 104, i32 105, i32 106, i32 107>, <4 x i32>* %12
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
store i32 108, i32* %13
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
store i32 109, i32* %14
%15 = ptrtoint [10 x i32]* %1 to i64
%16 = trunc i64 %15 to i32
%17 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %3
%19 = ptrtoint [10 x i32]* %1 to i64
%20 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0, i32 %18, i64 %19, i32 %18)
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%22 = load i32, i32* %4
%23 = ptrtoint i32* %21 to i64
%24 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 1, i32 %22, i64 %23, i32 %22)
%25 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%26 = load i32, i32* %5
%27 = ptrtoint i32* %25 to i64
%28 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 2, i32 %26, i64 %27, i32 %26)
%29 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%30 = load i32, i32* %6
%31 = ptrtoint i32* %29 to i64
%32 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 3, i32 %30, i64 %31, i32 %30)
%33 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%34 = load i32, i32* %8
%35 = ptrtoint i32* %33 to i64
%36 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 4, i32 %34, i64 %35, i32 %34)
%37 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%38 = load i32, i32* %9
%39 = ptrtoint i32* %37 to i64
%40 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 5, i32 %38, i64 %39, i32 %38)
%41 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%42 = load i32, i32* %10
%43 = ptrtoint i32* %41 to i64
%44 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 6, i32 6, i32 %42, i64 %43, i32 %42)
%45 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%46 = load i32, i32* %11
%47 = ptrtoint i32* %45 to i64
%48 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 7, i32 7, i32 %46, i64 %47, i32 %46)
%49 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%50 = load i32, i32* %13
%51 = ptrtoint i32* %49 to i64
%52 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 8, i32 8, i32 %50, i64 %51, i32 %50)
%53 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%54 = load i32, i32* %14
%55 = ptrtoint i32* %53 to i64
%56 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 9, i32 9, i32 %54, i64 %55, i32 %54)
%57 = load i32, i32* @EXIT_SUCCESS
ret i32 %57
}