#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*/ minmax(int *, int, int *, int *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int arr[200], n, i;
  do {
    scanf("%d", &n);
    if (n > 500 && n < 1) {
      printf("Again:");
    }
  } while (n > 500 && n < 1);
  for (i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
  }
  int max, min;
  minmax(arr, n, &min, &max);
  printf("%d\n", max + min);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x350,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x334(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1f4,-0x334(%rbp)
jle    1180 <main+0x50>
cmpl   $0x1,-0x334(%rbp)
jge    1180 <main+0x50>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1185 <main+0x55>
xor    %eax,%eax
cmpl   $0x1f4,-0x334(%rbp)
mov    %al,-0x341(%rbp)
jle    11ad <main+0x7d>
cmpl   $0x1,-0x334(%rbp)
setl   %al
mov    %al,-0x341(%rbp)
mov    -0x341(%rbp),%al
test   $0x1,%al
jne    1142 <main+0x12>
movl   $0x0,-0x338(%rbp)
mov    -0x338(%rbp),%eax
cmp    -0x334(%rbp),%eax
jge    120c <main+0xdc>
movslq -0x338(%rbp),%rax
lea    -0x330(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe0d(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x338(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x338(%rbp)
jmp    11c5 <main+0x95>
lea    -0x330(%rbp),%rdi
mov    -0x334(%rbp),%esi
lea    -0x340(%rbp),%rdx
lea    -0x33c(%rbp),%rcx
call   1050 <minmax@plt>
mov    -0x33c(%rbp),%esi
add    -0x340(%rbp),%esi
lea    0xdcb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x350,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x330,%rsp
lea    0xebd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
test   %esi,%esi
jle    118d <main+0x5d>
lea    0x10(%rsp),%r15
xor    %ebx,%ebx
lea    0xe9d(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
add    $0x1,%rbx
movslq 0x4(%rsp),%rsi
add    $0x4,%r15
cmp    %rsi,%rbx
jl     1170 <main+0x40>
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1050 <minmax@plt>
mov    0x8(%rsp),%esi
add    0xc(%rsp),%esi
lea    0xe53(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x330,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

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