#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*/ getchar();
int /*<<< orphan*/ printf(char *, float);
void main() {
  float temp;
  int i, j, k;
  float a[7] = {3, 7, 2, 4, 1, 9, 5};
  for (i = 0; i < 7 - 1; i++) {
    k = i;
    for (j = i + 1; j < 7; j++)
      if (a[j] < a[k])
        k = j;
    temp = a[k];
    a[k] = a[i];
    a[i] = temp;
  }
  for (i = 0; i < 7; i++)
    printf("%f\t", a[i]);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec9(%rip),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    11f2 <main+0xd2>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jge    11b2 <main+0x92>
movslq -0xc(%rbp),%rax
movss  -0x30(%rbp,%rax,4),%xmm1
movslq -0x10(%rbp),%rax
movss  -0x30(%rbp,%rax,4),%xmm0
ucomiss %xmm1,%xmm0
jbe    119f <main+0x7f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11a4 <main+0x84>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1172 <main+0x52>
movslq -0x10(%rbp),%rax
movss  -0x30(%rbp,%rax,4),%xmm0
movss  %xmm0,-0x4(%rbp)
movslq -0x8(%rbp),%rax
movss  -0x30(%rbp,%rax,4),%xmm0
movslq -0x10(%rbp),%rax
movss  %xmm0,-0x30(%rbp,%rax,4)
movss  -0x4(%rbp),%xmm0
movslq -0x8(%rbp),%rax
movss  %xmm0,-0x30(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1159 <main+0x39>
movl   $0x0,-0x8(%rbp)
cmpl   $0x7,-0x8(%rbp)
jge    1227 <main+0x107>
movslq -0x8(%rbp),%rax
movss  -0x30(%rbp,%rax,4),%xmm0
lea    0xe08(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11f9 <main+0xd9>
mov    $0x0,%al
call   1040 <getchar@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef4(%rip),%rbx
movss  0xed0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xec4(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xeb8(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xeac(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xea0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xe94(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xe88(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <getchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\09\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 1.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 2.000000e+00)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 3.000000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 4.000000e+00)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 5.000000e+00)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 7.000000e+00)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 9.000000e+00)
%8 = tail call i32 (...) @getchar()
ret void
}