#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 /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int array[6] = {};
  int i, min_flag = 0, temp;
  for (i = 0; i < 6; i++) {
    scanf("%d", &array[i]);
  }
  for (i = 1; i < 6; i++) {
    if (array[min_flag] > array[i]) {
      min_flag = i;
    }
  }
  temp = array[0];
  array[0] = array[min_flag];
  array[min_flag] = temp;
  for (i = 0; i < 6; i++) {
    printf("%d ", array[i]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1040 <memset@plt>
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x6,-0x24(%rbp)
jge    1190 <main+0x60>
movslq -0x24(%rbp),%rax
lea    -0x20(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe83(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115d <main+0x2d>
movl   $0x1,-0x24(%rbp)
cmpl   $0x6,-0x24(%rbp)
jge    11d0 <main+0xa0>
movslq -0x28(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
movslq -0x24(%rbp),%rcx
cmp    -0x20(%rbp,%rcx,4),%eax
jle    11bd <main+0x8d>
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    11c2 <main+0x92>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1197 <main+0x67>
mov    -0x20(%rbp),%eax
mov    %eax,-0x2c(%rbp)
movslq -0x28(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
mov    %eax,-0x20(%rbp)
mov    -0x2c(%rbp),%ecx
movslq -0x28(%rbp),%rax
mov    %ecx,-0x20(%rbp,%rax,4)
movl   $0x0,-0x24(%rbp)
cmpl   $0x6,-0x24(%rbp)
jge    1221 <main+0xf1>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%esi
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11f3 <main+0xc3>
lea    0xddf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x10(%rsp),%r14
lea    0xead(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    (%rsp),%eax
xor    %ecx,%ecx
cmp    0x4(%rsp),%eax
setg   %cl
mov    (%rsp,%rcx,4),%edx
cmp    0x8(%rsp),%edx
mov    $0x2,%edx
cmovle %ecx,%edx
mov    (%rsp,%rdx,4),%ecx
cmp    0xc(%rsp),%ecx
mov    $0x3,%ecx
cmovle %edx,%ecx
mov    (%rsp,%rcx,4),%edx
cmp    0x10(%rsp),%edx
mov    $0x4,%edx
cmovle %ecx,%edx
mov    (%rsp,%rdx,4),%ecx
cmp    0x14(%rsp),%ecx
mov    $0x5,%ecx
cmovle %edx,%ecx
mov    (%rsp,%rcx,4),%edx
mov    %edx,(%rsp)
mov    %eax,(%rsp,%rcx,4)
mov    (%rsp),%esi
lea    0xe0b(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \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 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 1
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%7 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 2
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%9 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 3
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 4
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %11)
%13 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 5
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %13)
%15 = load i32, i32* %3
%16 = load i32, i32* %5
%17 = icmp sgt i32 %15, %16
%18 = zext i1 %17 to i32
%19 = zext i1 %17 to i64
%20 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = load i32, i32* %7
%23 = icmp sgt i32 %21, %22
%24 = select i1 %23, i32 2, i32 %18
%25 = zext i32 %24 to i64
%26 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = load i32, i32* %9
%29 = icmp sgt i32 %27, %28
%30 = select i1 %29, i32 3, i32 %24
%31 = zext i32 %30 to i64
%32 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = load i32, i32* %11
%35 = icmp sgt i32 %33, %34
%36 = select i1 %35, i32 4, i32 %30
%37 = zext i32 %36 to i64
%38 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 %37
%39 = load i32, i32* %38
%40 = load i32, i32* %13
%41 = icmp sgt i32 %39, %40
%42 = select i1 %41, i32 5, i32 %36
%43 = zext i32 %42 to i64
%44 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 %43
%45 = load i32, i32* %44
store i32 %45, i32* %3
store i32 %15, i32* %44
%46 = load i32, i32* %3
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %46)
%48 = load i32, i32* %5
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %48)
%50 = load i32, i32* %7
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %50)
%52 = load i32, i32* %9
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %52)
%54 = load i32, i32* %11
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %54)
%56 = load i32, i32* %13
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %56)
%58 = call i32 @putchar(i32 10)
ret i32 0
}