#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 printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a[7];
  for (a[6] = *a = 0; *a < 5 || 0 * printf("%d", a[6]);
       scanf("%d", ++*a + a), a[6] += *a % 2 * a[*a])
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x5,-0x20(%rbp)
mov    %al,-0x21(%rbp)
jl     1167 <main+0x47>
mov    -0x8(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
imul   $0x0,%eax,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1177 <main+0x57>
jmp    11bf <main+0x9f>
jmp    117c <main+0x5c>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
lea    -0x20(%rbp),%rsi
cltq
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe67(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x20(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
movslq -0x20(%rbp),%rcx
imul   -0x20(%rbp,%rcx,4),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movl   $0x0,0x18(%rsp)
xor    %eax,%eax
lea    0xeca(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
lea    0x1(%rax),%ecx
mov    %ecx,(%rsp)
cltq
lea    (%rsp,%rax,4),%rsi
add    $0x4,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movslq (%rsp),%rax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
mov    %eax,%esi
sub    %ecx,%esi
imul   (%rsp,%rax,4),%esi
add    0x18(%rsp),%esi
mov    %esi,0x18(%rsp)
cmp    $0x5,%rax
jl     1140 <main+0x20>
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 6
store i32 0, i32* %4
br label %7
5: ; preds = %7
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %20)
ret i32 0
7: ; preds = %0, %7
%8 = phi i32 [ 0, %0 ], [ %13, %7 ]
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 %10
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %11)
%13 = load i32, i32* %3
%14 = srem i32 %13, 2
%15 = sext i32 %13 to i64
%16 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = mul nsw i32 %14, %17
%19 = load i32, i32* %4
%20 = add nsw i32 %19, %18
store i32 %20, i32* %4
%21 = icmp slt i32 %13, 5
br i1 %21, label %7, label %5
}