#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 */
void flt_reverse(float *array, size_t n) {
  float *end = array + n;
  float t;
  while (--end > array) {
    t = *end;
    *end = *array;
    *array++ = t;
  }
}


x86 assembly (clang, -O0):
<flt_reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x18(%rbp)
cmp    -0x8(%rbp),%rax
jbe    116f <flt_reverse+0x6f>
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x1c(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
movss  %xmm0,(%rax)
jmp    111f <flt_reverse+0x1f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flt_reverse>:
lea    (%rdi,%rsi,4),%rax
add    $0xfffffffffffffffc,%rax
cmp    %rdi,%rax
jbe    1142 <flt_reverse+0x42>
add    $0x4,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movss  (%rax),%xmm0
movss  -0x4(%rdi),%xmm1
movss  %xmm1,(%rax)
movss  %xmm0,-0x4(%rdi)
add    $0xfffffffffffffffc,%rax
lea    0x4(%rdi),%rcx
cmp    %rdi,%rax
mov    %rcx,%rdi
ja     1120 <flt_reverse+0x20>
ret

LLVM IR (-O0):
define void @flt_reverse(float* %0, i64 %1) {
%3 = alloca float*
%4 = alloca i64
%5 = alloca float*
%6 = alloca float
store float* %0, float** %3
store i64 %1, i64* %4
%7 = load float*, float** %3
%8 = load i64, i64* %4
%9 = getelementptr inbounds float, float* %7, i64 %8
store float* %9, float** %5
br label %10
10: ; preds = %15, %2
%11 = load float*, float** %5
%12 = getelementptr inbounds float, float* %11, i32 -1
store float* %12, float** %5
%13 = load float*, float** %3
%14 = icmp ugt float* %12, %13
br i1 %14, label %15, label %24
15: ; preds = %10
%16 = load float*, float** %5
%17 = load float, float* %16
store float %17, float* %6
%18 = load float*, float** %3
%19 = load float, float* %18
%20 = load float*, float** %5
store float %19, float* %20
%21 = load float, float* %6
%22 = load float*, float** %3
%23 = getelementptr inbounds float, float* %22, i32 1
store float* %23, float** %3
store float %21, float* %22
br label %10
24: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @flt_reverse(float* %0, i64 %1) {
%3 = getelementptr inbounds float, float* %0, i64 %1
%4 = getelementptr inbounds float, float* %3, i64 -1
%5 = icmp ugt float* %4, %0
br i1 %5, label %6, label %14
6: ; preds = %2, %6
%7 = phi float* [ %12, %6 ], [ %4, %2 ]
%8 = phi float* [ %11, %6 ], [ %0, %2 ]
%9 = load float, float* %7
%10 = load float, float* %8
store float %10, float* %7
%11 = getelementptr inbounds float, float* %8, i64 1
store float %9, float* %8
%12 = getelementptr inbounds float, float* %7, i64 -1
%13 = icmp ugt float* %12, %11
br i1 %13, label %6, label %14
14: ; preds = %6, %2
ret void
}