#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, num = 0;
  float a[7] = {3, 7, 2, 4, 1, 9, 5};
  for (i = 0; i < 7 - 1; i++) {
    for (j = 0; j < 7 - i - 1; j++)
      if (a[j] > a[j + 1]) {
        temp = a[j];
        a[j] = a[j + 1];
        a[j + 1] = 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
movl   $0x0,-0x14(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    1204 <main+0xe4>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x7,%ecx
sub    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11f1 <main+0xd1>
movslq -0xc(%rbp),%rax
movss  -0x30(%rbp,%rax,4),%xmm0
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
ucomiss -0x30(%rbp,%rax,4),%xmm0
jbe    11de <main+0xbe>
movslq -0xc(%rbp),%rax
movss  -0x30(%rbp,%rax,4),%xmm0
movss  %xmm0,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
movss  -0x30(%rbp,%rax,4),%xmm0
movslq -0xc(%rbp),%rax
movss  %xmm0,-0x30(%rbp,%rax,4)
movss  -0x4(%rbp),%xmm0
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
movss  %xmm0,-0x30(%rbp,%rax,4)
jmp    11e3 <main+0xc3>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1171 <main+0x51>
jmp    11f6 <main+0xd6>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1160 <main+0x40>
movl   $0x0,-0x8(%rbp)
cmpl   $0x7,-0x8(%rbp)
jge    1239 <main+0x119>
movslq -0x8(%rbp),%rax
movss  -0x30(%rbp,%rax,4),%xmm0
lea    0xdf6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    120b <main+0xeb>
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 i32
%6 = alloca [7 x float]
store i32 0, i32* %5
%7 = bitcast [7 x float]* %6 to i8*
store i32 0, i32* %2
br label %8
8: ; preds = %52, %0
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 6
br i1 %10, label %11, label %55
11: ; preds = %8
store i32 0, i32* %3
br label %12
12: ; preds = %48, %11
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = sub nsw i32 7, %14
%16 = sub nsw i32 %15, 1
%17 = icmp slt i32 %13, %16
br i1 %17, label %18, label %51
18: ; preds = %12
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [7 x float], [7 x float]* %6, i64 0, i64 %20
%22 = load float, float* %21
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [7 x float], [7 x float]* %6, i64 0, i64 %25
%27 = load float, float* %26
%28 = fcmp ogt float %22, %27
br i1 %28, label %29, label %47
29: ; preds = %18
%30 = load i32, i32* %3
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [7 x float], [7 x float]* %6, i64 0, i64 %31
%33 = load float, float* %32
store float %33, float* %1
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 1
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [7 x float], [7 x float]* %6, i64 0, i64 %36
%38 = load float, float* %37
%39 = load i32, i32* %3
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [7 x float], [7 x float]* %6, i64 0, i64 %40
store float %38, float* %41
%42 = load float, float* %1
%43 = load i32, i32* %3
%44 = add nsw i32 %43, 1
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [7 x float], [7 x float]* %6, i64 0, i64 %45
store float %42, float* %46
br label %47
47: ; preds = %29, %18
br label %48
48: ; preds = %47
%49 = load i32, i32* %3
%50 = add nsw i32 %49, 1
store i32 %50, i32* %3
br label %12
51: ; preds = %12
br label %52
52: ; preds = %51
%53 = load i32, i32* %2
%54 = add nsw i32 %53, 1
store i32 %54, i32* %2
br label %8
55: ; preds = %8
store i32 0, i32* %2
br label %56
56: ; preds = %65, %55
%57 = load i32, i32* %2
%58 = icmp slt i32 %57, 7
br i1 %58, label %59, label %68
59: ; preds = %56
%60 = load i32, i32* %2
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [7 x float], [7 x float]* %6, i64 0, i64 %61
%63 = load float, float* %62
%64 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %63)
br label %65
65: ; preds = %59
%66 = load i32, i32* %2
%67 = add nsw i32 %66, 1
store i32 %67, i32* %2
br label %56
68: ; preds = %56
%69 = 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
}