#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 min(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int numInts, i = 0, j = 0, tmp, intArray[100] = {-1}, minNum;
  scanf("%d", &numInts);
  while (i < numInts) {
    scanf("%d", &intArray[i]);
    i++;
  }
  minNum = intArray[0];
  for (i = 0; i < numInts - 1; i++) {
    tmp = min(intArray[i], intArray[i + 1]);
    if (tmp < minNum)
      minNum = tmp;
  }
  printf("%d\n", minNum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    -0x1b0(%rbp),%rdi
xor    %esi,%esi
mov    $0x190,%edx
call   1050 <memset@plt>
movl   $0xffffffff,-0x1b0(%rbp)
ff ff ff
lea    0xe7c(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11c5 <main+0x85>
movslq -0xc(%rbp),%rax
lea    -0x1b0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe4e(%rip),%rdi
call   1060 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    118d <main+0x4d>
mov    -0x1b0(%rbp),%eax
mov    %eax,-0x1b4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1236 <main+0xf6>
movslq -0xc(%rbp),%rax
mov    -0x1b0(%rbp,%rax,4),%edi
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x1b0(%rbp,%rax,4),%esi
call   1040 <min@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x1b4(%rbp),%eax
jge    1223 <main+0xe3>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1b4(%rbp)
jmp    1228 <main+0xe8>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11d8 <main+0x98>
mov    -0x1b4(%rbp),%esi
lea    0xdc0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x1a0,%rsp
lea    0x10(%rsp),%r15
mov    $0x190,%edx
mov    %r15,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
movl   $0xffffffff,0x10(%rsp)
ff
lea    0xe91(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1209 <main+0xc9>
xor    %ebx,%ebx
lea    0xe73(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
add    $0x4,%r15
cmp    %rax,%rbx
jl     1190 <main+0x50>
mov    0x10(%rsp),%ebx
cmp    $0x2,%eax
jl     120e <main+0xce>
mov    0x14(%rsp),%esi
mov    %ebx,%edi
call   1040 <min@plt>
cmp    %ebx,%eax
cmovl  %eax,%ebx
cmpl   $0x3,0xc(%rsp)
jl     120e <main+0xce>
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1(%rax),%r14
mov    0x10(%rsp,%rax,4),%edi
mov    0x14(%rsp,%rax,4),%esi
call   1040 <min@plt>
cmp    %ebx,%eax
cmovl  %eax,%ebx
movslq 0xc(%rsp),%rcx
add    $0xffffffffffffffff,%rcx
mov    %r14,%rax
cmp    %rcx,%r14
jl     11e0 <main+0xa0>
jmp    120e <main+0xce>
mov    $0xffffffff,%ebx
lea    0xdee(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

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