#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() {
  int array[3], n, c;
  n = 3;
  array[0] = 5;
  array[1] = 9;
  array[2] = -13;
  printf("Array elements entered by you are:\n");
  for (c = 0; c < n; c++)
    printf("array[%d] = %d\n", c, array[c]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x14(%rbp)
movl   $0x5,-0x10(%rbp)
movl   $0x9,-0xc(%rbp)
movl   $0xfffffff3,-0x8(%rbp)
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1183 <main+0x73>
mov    -0x18(%rbp),%esi
movslq -0x18(%rbp),%rax
mov    -0x10(%rbp,%rax,4),%edx
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1150 <main+0x40>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x5,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x9,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0xfffffff3,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Array elements entered by you are:\0A\00"
@.str.1 = [16 x i8] c"array[%d] = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %3
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
store i32 5, i32* %5
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
store i32 9, i32* %6
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
store i32 -13, i32* %7
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %9
9: ; preds = %20, %0
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %23
13: ; preds = %9
%14 = load i32, i32* %4
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 %16
%18 = load i32, i32* %17
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %18)
br label %20
20: ; preds = %13
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %9
23: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [16 x i8] c"array[%d] = %d\0A\00"
@str = [35 x i8] c"Array elements entered by you are:\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 5)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 9)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 -13)
ret i32 0
}