#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 main() {
  int i, j;
  int ar[] = {3, 0, -1, 2, 5, 99};
  int max, min;
  max = ar[0];
  min = ar[0];
  for (i = 1; i < 6; i++) {
    if (ar[i] > max) {
      max = ar[i];
    }
  }
  for (j = 1; j < 6; j++) {
    if (ar[j] < min) {
      min = ar[j];
    }
  }
  printf("Maximum: %d\n", max);
  printf("Minimum: %d\n", min);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x38(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    118c <main+0x7c>
movslq -0x8(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
cmp    -0x34(%rbp),%eax
jle    1179 <main+0x69>
movslq -0x8(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
mov    %eax,-0x34(%rbp)
jmp    117e <main+0x6e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1153 <main+0x43>
movl   $0x1,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jge    11cc <main+0xbc>
movslq -0xc(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
cmp    -0x38(%rbp),%eax
jge    11b9 <main+0xa9>
movslq -0xc(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
mov    %eax,-0x38(%rbp)
jmp    11be <main+0xae>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1193 <main+0x83>
mov    -0x34(%rbp),%esi
lea    0xe42(%rip),%rdi
call   1030 <printf@plt>
mov    -0x38(%rbp),%esi
lea    0xe40(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x63,%esi
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0xffffffff,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"Maximum: %d\0A\00"
@.str.1 = [13 x i8] c"Minimum: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 99)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 -1)
ret i32 0
}