#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*/ clr();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int x[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
  int i, *p;
  clr();
  p = x;
  for (i = 0; i < 9; i++) {
    printf("\n \tArray Elements x[%d] is %d", i, *p);
    printf("\n \tArray Elements x[%d] is %d", i, *p + 5);
    printf("\n \tArray Elements x[%d] is %d", i, *p * 5);
    p++;
  }
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xea6(%rip),%rsi
mov    $0x24,%edx
call   1060 <memcpy@plt>
mov    $0x0,%al
call   1030 <clr@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x9,-0x34(%rbp)
jge    11e1 <main+0xa1>
mov    -0x34(%rbp),%esi
mov    -0x40(%rbp),%rax
mov    (%rax),%edx
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
mov    -0x34(%rbp),%esi
mov    -0x40(%rbp),%rax
mov    (%rax),%edx
add    $0x5,%edx
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
mov    -0x34(%rbp),%esi
mov    -0x40(%rbp),%rax
imul   $0x5,(%rax),%edx
lea    0xe62(%rip),%rdi
call   1040 <printf@plt>
mov    -0x40(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x40(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    117a <main+0x3a>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    0xee3(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,(%rsp)
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <clr@plt>
mov    $0x1,%edx
lea    0xeb7(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
mov    (%rsp,%rbx,4),%edx
add    $0x5,%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
mov    (%rsp,%rbx,4),%eax
lea    (%rax,%rax,4),%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
cmp    $0x8,%ebx
je     11a9 <main+0x79>
mov    0x4(%rsp,%rbx,4),%edx
add    $0x1,%rbx
jmp    1170 <main+0x40>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@__const.main.x = [9 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
@.str = [30 x i8] c"\0A \09Array Elements x[%d] is %d\00"
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = tail call i32 (...) @clr()
%4 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
br label %5
5: ; preds = %19, %0
%6 = phi i32 [ 1, %0 ], [ %20, %19 ]
%7 = phi i32* [ %4, %0 ], [ %16, %19 ]
%8 = phi i32 [ 0, %0 ], [ %17, %19 ]
%9 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %6)
%10 = load i32, i32* %7
%11 = add nsw i32 %10, 5
%12 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %11)
%13 = load i32, i32* %7
%14 = mul nsw i32 %13, 5
%15 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %14)
%16 = getelementptr inbounds i32, i32* %7, i64 1
%17 = add nuw nsw i32 %8, 1
%18 = icmp eq i32 %17, 9
br i1 %18, label %21, label %19
19: ; preds = %5
%20 = load i32, i32* %16
br label %5
21: ; preds = %5
%22 = tail call i32 (...) @getchar()
ret i32 0
}