#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, int);
int /*<<< orphan*/ putchar(char);
int main(void) {
  int array[] = {0, 1, 2, 3, 4, 5}, element;
  int *parray = array;
  for (element = 0; element <= 5; ++element)
    printf("array[%d] = [%d]\n", element, array[element]);
  putchar('\n');
  while ((*parray++ = parray[1]) && *parray < 5)
    ;
  for (element = 0; element <= 5; ++element)
    printf("array[%d] = [%d]\n", element, array[element]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jg     118e <main+0x6e>
mov    -0x24(%rbp),%esi
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edx
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115f <main+0x3f>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x30(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x30(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x30(%rbp)
mov    %ecx,(%rax)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x31(%rbp)
je     11cb <main+0xab>
mov    -0x30(%rbp),%rax
cmpl   $0x5,(%rax)
setl   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
test   $0x1,%al
jne    11db <main+0xbb>
jmp    11e0 <main+0xc0>
jmp    1198 <main+0x78>
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jg     1216 <main+0xf6>
mov    -0x24(%rbp),%esi
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edx
lea    0xe15(%rip),%rdi
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11e7 <main+0xc7>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xee4(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xed5(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x4,%edx
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x5,%edx
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x4(%rsp),%rax
nopl   0x0(%rax,%rax,1)
mov    (%rax),%ecx
mov    %ecx,-0x4(%rax)
test   %ecx,%ecx
je     11d2 <main+0xb2>
add    $0x4,%rax
cmp    $0x5,%ecx
jl     11c0 <main+0xa0>
mov    (%rsp),%edx
lea    0xe3c(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <printf@plt>
mov    0x4(%rsp),%edx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <printf@plt>
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <printf@plt>
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <printf@plt>
mov    0x10(%rsp),%edx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <printf@plt>
mov    0x14(%rsp),%edx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.array = [6 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [18 x i8] c"array[%d] = [%d]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca i32
%4 = alloca i32*
store i32 0, i32* %1
%5 = bitcast [6 x i32]* %2 to i8*
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
store i32* %6, i32** %4
store i32 0, i32* %3
br label %7
7: ; preds = %17, %0
%8 = load i32, i32* %3
%9 = icmp sle i32 %8, 5
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = load i32, i32* %3
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %7
20: ; preds = %7
%21 = call i32 @putchar(i8 signext 10)
br label %22
22: ; preds = %35, %20
%23 = load i32*, i32** %4
%24 = getelementptr inbounds i32, i32* %23, i64 1
%25 = load i32, i32* %24
%26 = load i32*, i32** %4
%27 = getelementptr inbounds i32, i32* %26, i32 1
store i32* %27, i32** %4
store i32 %25, i32* %26
%28 = icmp ne i32 %25, 0
br i1 %28, label %29, label %33
29: ; preds = %22
%30 = load i32*, i32** %4
%31 = load i32, i32* %30
%32 = icmp slt i32 %31, 5
br label %33
33: ; preds = %29, %22
%34 = phi i1 [ false, %22 ], [ %32, %29 ]
br i1 %34, label %35, label %36
35: ; preds = %33
br label %22
36: ; preds = %33
store i32 0, i32* %3
br label %37
37: ; preds = %47, %36
%38 = load i32, i32* %3
%39 = icmp sle i32 %38, 5
br i1 %39, label %40, label %50
40: ; preds = %37
%41 = load i32, i32* %3
%42 = load i32, i32* %3
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 %43
%45 = load i32, i32* %44
%46 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %41, i32 %45)
br label %47
47: ; preds = %40
%48 = load i32, i32* %3
%49 = add nsw i32 %48, 1
store i32 %49, i32* %3
br label %37
50: ; preds = %37
ret i32 0
}

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