#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 /*<<< orphan*/ scanf(char *, int *, int *, int *, int *, int *, int *);
int main() {
  int tablica[6] = {0, 0, 0, 0, 0, 0};
  scanf("%d %d %d %d %d %d", &tablica[0], &tablica[1], &tablica[2], &tablica[3],
        &tablica[4], &tablica[5]);
  printf("Tablica %d %d %d %d %d %d\n", tablica[0], tablica[1], tablica[2],
         tablica[3], tablica[4], tablica[5]);
  int min, max = tablica[0];
  for (int x = 0; x < 6; x++) {
    int tab = tablica[x];
    if (tab > max) {
      max = tab;
    } else if (tab < min) {
      min = tab;
    }
  }
  printf("min = [ %d ] max = [ %d ]\n", min, max);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1040 <memset@plt>
lea    -0x20(%rbp),%rsi
lea    -0x20(%rbp),%rdx
add    $0x4,%rdx
lea    -0x20(%rbp),%rcx
add    $0x8,%rcx
lea    -0x20(%rbp),%r8
add    $0xc,%r8
lea    -0x20(%rbp),%r9
add    $0x10,%r9
lea    -0x20(%rbp),%rax
add    $0x14,%rax
lea    0xe7e(%rip),%rdi
mov    %rax,(%rsp)
call   1050 <scanf@plt>
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x10(%rbp),%r9d
mov    -0xc(%rbp),%eax
lea    0xe6c(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x6,-0x2c(%rbp)
jge    1213 <main+0xe3>
movslq -0x2c(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x28(%rbp),%eax
jle    11e9 <main+0xb9>
mov    -0x30(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    1200 <main+0xd0>
mov    -0x30(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    11fb <main+0xcb>
mov    -0x30(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1200 <main+0xd0>
jmp    1205 <main+0xd5>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11bd <main+0x8d>
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x20(%rsp)
lea    0x20(%rsp),%r9
lea    0x14(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x1c(%rsp),%r8
lea    0x24(%rsp),%rax
mov    %rax,(%rsp)
lea    0xea7(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x10(%rsp),%esi
mov    0x14(%rsp),%edx
mov    0x18(%rsp),%ecx
mov    0x1c(%rsp),%r8d
mov    0x20(%rsp),%r9d
mov    0x24(%rsp),%eax
mov    %eax,(%rsp)
lea    0xe8b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%edx
mov    0x14(%rsp),%eax
cmp    %edx,%eax
cmovg  %eax,%edx
mov    0x18(%rsp),%eax
cmp    %edx,%eax
cmovg  %eax,%edx
mov    0x1c(%rsp),%eax
cmp    %edx,%eax
cmovg  %eax,%edx
mov    0x20(%rsp),%eax
cmp    %edx,%eax
cmovg  %eax,%edx
mov    0x24(%rsp),%eax
cmp    %edx,%eax
cmovg  %eax,%edx
lea    0xe67(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"%d %d %d %d %d %d\00"
@.str.1 = [27 x i8] c"Tablica %d %d %d %d %d %d\0A\00"
@.str.2 = [27 x i8] c"min = [ %d ] max = [ %d ]\0A\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 1
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 2
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 3
%7 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 4
%8 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 5
%9 = call i32 @scanf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8)
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11, i32 %12, i32 %13, i32 %14, i32 %15)
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = icmp sgt i32 %18, %17
%20 = select i1 %19, i32 %18, i32 %17
%21 = load i32, i32* %5
%22 = icmp sgt i32 %21, %20
%23 = select i1 %22, i32 %21, i32 %20
%24 = load i32, i32* %6
%25 = icmp sgt i32 %24, %23
%26 = select i1 %25, i32 %24, i32 %23
%27 = load i32, i32* %7
%28 = icmp sgt i32 %27, %26
%29 = select i1 %28, i32 %27, i32 %26
%30 = load i32, i32* %8
%31 = icmp sgt i32 %30, %29
%32 = select i1 %31, i32 %30, i32 %29
%33 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 undef, i32 %32)
ret i32 0
}