#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int arr[500] = {0};
  int size = 0;
  int temp;
  while (size <= 0 || size > 500) {
    scanf("%d", &size);
  }
  temp = 0;
  while (temp < size) {
    scanf("%d", &arr[temp]);
    temp++;
  }
  minmax(arr, size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x7e0(%rbp),%rdi
xor    %esi,%esi
mov    $0x7d0,%edx
call   1030 <memset@plt>
movl   $0x0,-0x7e4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x7e4(%rbp)
mov    %al,-0x7e9(%rbp)
jle    1187 <main+0x57>
cmpl   $0x1f4,-0x7e4(%rbp)
setg   %al
mov    %al,-0x7e9(%rbp)
mov    -0x7e9(%rbp),%al
test   $0x1,%al
jne    119a <main+0x6a>
jmp    11b2 <main+0x82>
lea    0xe5f(%rip),%rdi
lea    -0x7e4(%rbp),%rsi
call   1040 <scanf@plt>
jmp    115f <main+0x2f>
movl   $0x0,-0x7e8(%rbp)
mov    -0x7e8(%rbp),%eax
cmp    -0x7e4(%rbp),%eax
jge    1203 <main+0xd3>
movslq -0x7e8(%rbp),%rax
lea    -0x7e0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe16(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x7e8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7e8(%rbp)
jmp    11bc <main+0x8c>
lea    -0x7e0(%rbp),%rdi
mov    -0x7e4(%rbp),%esi
call   1050 <minmax@plt>
xor    %eax,%eax
add    $0x7f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x7e8,%rsp
lea    0x10(%rsp),%r12
mov    $0x7d0,%edx
mov    %r12,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
movl   $0x0,0xc(%rsp)
lea    0xe9f(%rip),%r14
lea    0xc(%rsp),%r15
mov    $0xfffffe0b,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
add    %ebx,%eax
cmp    $0xfffffe0c,%eax
jb     1170 <main+0x40>
xor    %ebx,%ebx
lea    0xe6f(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rsi
add    $0x4,%r12
cmp    %rsi,%rbx
jl     11a0 <main+0x70>
lea    0x10(%rsp),%rdi
call   1050 <minmax@plt>
xor    %eax,%eax
add    $0x7e8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [500 x i32]
%2 = alloca i32
%3 = bitcast [500 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
br label %5
5: ; preds = %0, %5
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = add i32 %7, -501
%9 = icmp ult i32 %8, -500
br i1 %9, label %5, label %10
10: ; preds = %5, %10
%11 = phi i64 [ %14, %10 ], [ 0, %5 ]
%12 = getelementptr inbounds [500 x i32], [500 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
%19 = getelementptr inbounds [500 x i32], [500 x i32]* %1, i64 0, i64 0
%20 = call i32 @minmax(i32* %19, i32 %15)
ret i32 0
}