#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*/ __print_float(float);
int /*<<< orphan*/ bubble_sort(float *, int);
int main() {
  float a[5];
  int i;
  a[0] = 4.6;
  a[1] = 23.7;
  a[2] = -5.5;
  a[3] = 7.6;
  a[4] = 2.9;
  bubble_sort(a, 5);
  for (i = 0; i < 5; i++) {
    __print_float(a[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  0xec8(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xeb7(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xea6(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe95(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1040 <bubble_sort@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    11ac <main+0x8c>
movslq -0x24(%rbp),%rax
movss  -0x20(%rbp,%rax,4),%xmm0
call   1030 <__print_float@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1185 <main+0x65>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x4039999a,0x10(%rsp)
40
mov    %rsp,%rdi
mov    $0x5,%esi
call   1040 <bubble_sort@plt>
movss  (%rsp),%xmm0
call   1030 <__print_float@plt>
movss  0x4(%rsp),%xmm0
call   1030 <__print_float@plt>
movss  0x8(%rsp),%xmm0
call   1030 <__print_float@plt>
movss  0xc(%rsp),%xmm0
call   1030 <__print_float@plt>
movss  0x10(%rsp),%xmm0
call   1030 <__print_float@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x float]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [5 x float], [5 x float]* %2, i64 0, i64 0
store float 0x4012666660000000, float* %4
%5 = getelementptr inbounds [5 x float], [5 x float]* %2, i64 0, i64 1
store float 0x4037B33340000000, float* %5
%6 = getelementptr inbounds [5 x float], [5 x float]* %2, i64 0, i64 2
store float -5.500000e+00, float* %6
%7 = getelementptr inbounds [5 x float], [5 x float]* %2, i64 0, i64 3
store float 0x401E666660000000, float* %7
%8 = getelementptr inbounds [5 x float], [5 x float]* %2, i64 0, i64 4
store float 0x4007333340000000, float* %8
%9 = getelementptr inbounds [5 x float], [5 x float]* %2, i64 0, i64 0
%10 = call i32 @bubble_sort(float* %9, i32 5)
store i32 0, i32* %3
br label %11
11: ; preds = %20, %0
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 5
br i1 %13, label %14, label %23
14: ; preds = %11
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [5 x float], [5 x float]* %2, i64 0, i64 %16
%18 = load float, float* %17
%19 = call i32 @__print_float(float %18)
br label %20
20: ; preds = %14
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %11
23: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [5 x float]
%2 = bitcast [5 x float]* %1 to i8*
%3 = getelementptr inbounds [5 x float], [5 x float]* %1, i64 0, i64 0
%4 = getelementptr inbounds [5 x float], [5 x float]* %1, i64 0, i64 1
%5 = getelementptr inbounds [5 x float], [5 x float]* %1, i64 0, i64 2
%6 = getelementptr inbounds [5 x float], [5 x float]* %1, i64 0, i64 3
%7 = bitcast [5 x float]* %1 to <4 x float>*
store <4 x float> <float 0x4012666660000000, float 0x4037B33340000000, float -5.500000e+00, float 0x401E666660000000>, <4 x float>* %7
%8 = getelementptr inbounds [5 x float], [5 x float]* %1, i64 0, i64 4
store float 0x4007333340000000, float* %8
%9 = call i32 @bubble_sort(float* %3, i32 5)
%10 = load float, float* %3
%11 = call i32 @__print_float(float %10)
%12 = load float, float* %4
%13 = call i32 @__print_float(float %12)
%14 = load float, float* %5
%15 = call i32 @__print_float(float %14)
%16 = load float, float* %6
%17 = call i32 @__print_float(float %16)
%18 = load float, float* %8
%19 = call i32 @__print_float(float %18)
ret i32 0
}