#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int array[7];
  int i, j, search, max;
  for (i = 0; i < 7; i++) {
    printf("Enter ur value of [%d]:\n", i);
    scanf("%d", &array[i]);
  }
  max = array[0];
  for (j = 0; j < 7; j++) {
    if (max < array[j]) {
      max = array[j];
    }
  }
  printf("Maximum value is %d\n", max);
  max = array[0];
  for (j = 0; j < 7; j++) {
    if (max > array[j]) {
      max = array[j];
    }
  }
  printf("Mini value is %d\n", max);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x7,-0x24(%rbp)
jge    1178 <main+0x58>
mov    -0x24(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
movslq -0x24(%rbp),%rax
lea    -0x20(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeb4(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1136 <main+0x16>
mov    -0x20(%rbp),%eax
mov    %eax,-0x30(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x7,-0x28(%rbp)
jge    11be <main+0x9e>
mov    -0x30(%rbp),%eax
movslq -0x28(%rbp),%rcx
cmp    -0x20(%rbp,%rcx,4),%eax
jge    11ab <main+0x8b>
movslq -0x28(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
mov    %eax,-0x30(%rbp)
jmp    11b0 <main+0x90>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1185 <main+0x65>
mov    -0x30(%rbp),%esi
lea    0xe54(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x30(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x7,-0x28(%rbp)
jge    1213 <main+0xf3>
mov    -0x30(%rbp),%eax
movslq -0x28(%rbp),%rcx
cmp    -0x20(%rbp,%rcx,4),%eax
jle    1200 <main+0xe0>
movslq -0x28(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
mov    %eax,-0x30(%rbp)
jmp    1205 <main+0xe5>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11da <main+0xba>
mov    -0x30(%rbp),%esi
lea    0xe14(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0xed2(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xeda(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %r14,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %r14,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %r14,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %r14,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %r14,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %r14,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%eax
cmp    %eax,%esi
cmovl  %eax,%esi
mov    0x8(%rsp),%eax
cmp    %eax,%esi
cmovl  %eax,%esi
mov    0xc(%rsp),%eax
cmp    %eax,%esi
cmovl  %eax,%esi
mov    0x10(%rsp),%eax
cmp    %eax,%esi
cmovl  %eax,%esi
mov    0x14(%rsp),%eax
cmp    %eax,%esi
cmovl  %eax,%esi
mov    0x18(%rsp),%eax
cmp    %eax,%esi
cmovl  %eax,%esi
lea    0xdf6(%rip),%rdi
call   1030 <printf@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%eax
cmp    %eax,%esi
cmovg  %eax,%esi
mov    0x8(%rsp),%eax
cmp    %eax,%esi
cmovg  %eax,%esi
mov    0xc(%rsp),%eax
cmp    %eax,%esi
cmovg  %eax,%esi
mov    0x10(%rsp),%eax
cmp    %eax,%esi
cmovg  %eax,%esi
mov    0x14(%rsp),%eax
cmp    %eax,%esi
cmovg  %eax,%esi
mov    0x18(%rsp),%eax
cmp    %eax,%esi
cmovg  %eax,%esi
lea    0xdc6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [25 x i8] c"Enter ur value of [%d]:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"Maximum value is %d\0A\00"
@.str.3 = [18 x i8] c"Mini value is %d\0A\00"
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 1)
%7 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 1
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 2)
%10 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 2
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 3)
%13 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 3
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 4)
%16 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 4
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 5)
%19 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 5
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 6)
%22 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 6
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %22)
%24 = load i32, i32* %4
%25 = load i32, i32* %7
%26 = icmp slt i32 %24, %25
%27 = select i1 %26, i32 %25, i32 %24
%28 = load i32, i32* %10
%29 = icmp slt i32 %27, %28
%30 = select i1 %29, i32 %28, i32 %27
%31 = load i32, i32* %13
%32 = icmp slt i32 %30, %31
%33 = select i1 %32, i32 %31, i32 %30
%34 = load i32, i32* %16
%35 = icmp slt i32 %33, %34
%36 = select i1 %35, i32 %34, i32 %33
%37 = load i32, i32* %19
%38 = icmp slt i32 %36, %37
%39 = select i1 %38, i32 %37, i32 %36
%40 = load i32, i32* %22
%41 = icmp slt i32 %39, %40
%42 = select i1 %41, i32 %40, i32 %39
%43 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %42)
%44 = load i32, i32* %4
%45 = load i32, i32* %7
%46 = icmp sgt i32 %44, %45
%47 = select i1 %46, i32 %45, i32 %44
%48 = load i32, i32* %10
%49 = icmp sgt i32 %47, %48
%50 = select i1 %49, i32 %48, i32 %47
%51 = load i32, i32* %13
%52 = icmp sgt i32 %50, %51
%53 = select i1 %52, i32 %51, i32 %50
%54 = load i32, i32* %16
%55 = icmp sgt i32 %53, %54
%56 = select i1 %55, i32 %54, i32 %53
%57 = load i32, i32* %19
%58 = icmp sgt i32 %56, %57
%59 = select i1 %58, i32 %57, i32 %56
%60 = load i32, i32* %22
%61 = icmp sgt i32 %59, %60
%62 = select i1 %61, i32 %60, i32 %59
%63 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %62)
ret i32 0
}