#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[12];
  for (*a = 0, a[11] = 1000; *a < 10; a[11] = a[11] < a[*a] ? a[11] : a[*a])
    scanf("%d", ++*a + a);
  return 0 * printf("%d", a[11]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0x3e8,-0x14(%rbp)
cmpl   $0xa,-0x40(%rbp)
jge    119b <main+0x7b>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
lea    -0x40(%rbp),%rsi
cltq
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe9c(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
movslq -0x40(%rbp),%rcx
cmp    -0x40(%rbp,%rcx,4),%eax
jge    1185 <main+0x65>
mov    -0x14(%rbp),%eax
mov    %eax,-0x44(%rbp)
jmp    1190 <main+0x70>
movslq -0x40(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
mov    -0x14(%rbp),%esi
lea    0xe5b(%rip),%rdi
call   1030 <printf@plt>
imul   $0x0,%eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movl   $0x3e8,0x2c(%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>
mov    0x2c(%rsp),%ecx
movslq (%rsp),%rax
mov    (%rsp,%rax,4),%esi
cmp    %esi,%ecx
cmovl  %ecx,%esi
mov    %esi,0x2c(%rsp)
cmp    $0xa,%rax
jl     1140 <main+0x20>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

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

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