#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);
int /*<<< orphan*/ scanf(char *, int *, ...);
int main() {
  int m, n, a, b, N, i;
  scanf("%d%d%d", &N, &m, &n);
  i = 3, b = n;
  for (i = 3; i <= N; i++) {
    scanf("%d", &a);
    if ((m + n) < (a + b)) {
      m = b, n = a, b = a;
    } else
      b = a;
  }
  printf("%d + %d = %d", m, n, m + n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x3,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
movl   $0x3,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     11bf <main+0x9f>
lea    0xea1(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    -0x14(%rbp),%ecx
cmp    %ecx,%eax
jge    11a6 <main+0x86>
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    11ac <main+0x8c>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    11b1 <main+0x91>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    115d <main+0x3d>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
lea    0xe35(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xecf(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x8(%rsp),%ebx
cmpl   $0x3,0x10(%rsp)
jge    1174 <main+0x54>
mov    0xc(%rsp),%esi
mov    %ebx,%edx
lea    (%rdx,%rsi,1),%ecx
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x2,%ebp
lea    0xe91(%rip),%r14
lea    0x14(%rsp),%r15
jmp    119b <main+0x7b>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebp
mov    %eax,%ebx
cmp    0x10(%rsp),%ebp
jge    1158 <main+0x38>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    (%rdx,%rsi,1),%ecx
mov    0x14(%rsp),%eax
lea    (%rax,%rbx,1),%edi
cmp    %edi,%ecx
jge    1190 <main+0x70>
mov    %ebx,0xc(%rsp)
mov    %eax,0x8(%rsp)
mov    %eax,%edx
mov    %ebx,%esi
jmp    1190 <main+0x70>

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

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