#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 *, ...);
void test_floatarr(int len) {
  float arr[len];
  unsigned int *iarr = (unsigned int *)&arr;
  int i;
  arr[0] = 2.5;
  for (i = 1; i < len; i++) {
    arr[i] = (arr[i - 1] * arr[i - 1] + arr[0]) / 1.25 - 0.19;
  }
  printf("arr: ");
  for (i = 0; i < len; i++) {
    printf("%08X", *iarr++);
    printf(" ");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<test_floatarr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
lea    0xf(,%rcx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,-0x30(%rbp)
mov    %rax,%rsp
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
mov    %rcx,-0x20(%rbp)
movss  0xead(%rip),%xmm0
movss  %xmm0,(%rax)
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11cd <test_floatarr+0xbd>
mov    -0x30(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm2
movss  (%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe6e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe5a(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movslq -0x24(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115e <test_floatarr+0x4e>
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1229 <test_floatarr+0x119>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%esi
lea    0xe18(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11e2 <test_floatarr+0xd2>
lea    0xdf3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_floatarr>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edi,%r15d
mov    %edi,%r14d
mov    %rsp,%rax
lea    0xf(,%r14,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rax,%r12
sub    %rcx,%r12
mov    %r12,%rsp
neg    %rcx
movl   $0x40200000,(%rax,%rcx,1)
cmp    $0x2,%edi
jl     1221 <test_floatarr+0x101>
lea    -0x1(%r14),%rcx
cmp    $0x2,%r15d
jne    1175 <test_floatarr+0x55>
mov    $0x1,%eax
movss  0xe8d(%rip),%xmm3
jmp    11ef <test_floatarr+0xcf>
mov    %rcx,%rdx
and    $0xfffffffffffffffe,%rdx
neg    %rdx
mov    $0x1,%eax
movss  0xe74(%rip),%xmm0
movsd  0xe74(%rip),%xmm1
movsd  0xe74(%rip),%xmm2
movaps %xmm0,%xmm3
nop
mulss  %xmm3,%xmm3
addss  %xmm0,%xmm3
cvtss2sd %xmm3,%xmm3
divsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
cvtsd2ss %xmm3,%xmm3
movss  %xmm3,(%r12,%rax,4)
mulss  %xmm3,%xmm3
addss  %xmm0,%xmm3
cvtss2sd %xmm3,%xmm3
divsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
cvtsd2ss %xmm3,%xmm3
movss  %xmm3,0x4(%r12,%rax,4)
lea    (%rdx,%rax,1),%rsi
add    $0x2,%rsi
add    $0x2,%rax
cmp    $0x1,%rsi
jne    11a0 <test_floatarr+0x80>
test   $0x1,%cl
je     1221 <test_floatarr+0x101>
mulss  %xmm3,%xmm3
addss  0xe00(%rip),%xmm3
xorps  %xmm0,%xmm0
cvtss2sd %xmm3,%xmm0
divsd  0xdf9(%rip),%xmm0
addsd  0xdf9(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r12,%rax,4)
lea    0xdf0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r15d,%r15d
jle    1291 <test_floatarr+0x171>
lea    0xde3(%rip),%rdi
mov    $0x40200000,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
cmp    $0x1,%r15d
je     1291 <test_floatarr+0x171>
mov    $0x1,%ebx
lea    0xdbb(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r12,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %ebx,%r14d
jne    1270 <test_floatarr+0x150>
mov    $0xa,%edi
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"arr: \00"
@.str.1 = [5 x i8] c"%08X\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [2 x i8] c"\0A\00"
define void @test_floatarr(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %3
%10 = alloca float, i64 %8
store i64 %8, i64* %4
%11 = bitcast float* %10 to i32*
store i32* %11, i32** %5
%12 = getelementptr inbounds float, float* %10, i64 0
store float 2.500000e+00, float* %12
store i32 1, i32* %6
br label %13
13: ; preds = %38, %1
%14 = load i32, i32* %6
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %41
17: ; preds = %13
%18 = load i32, i32* %6
%19 = sub nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds float, float* %10, i64 %20
%22 = load float, float* %21
%23 = load i32, i32* %6
%24 = sub nsw i32 %23, 1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds float, float* %10, i64 %25
%27 = load float, float* %26
%28 = getelementptr inbounds float, float* %10, i64 0
%29 = load float, float* %28
%30 = call float @llvm.fmuladd.f32(float %22, float %27, float %29)
%31 = fpext float %30 to double
%32 = fdiv double %31, 1.250000e+00
%33 = fsub double %32, 1.900000e-01
%34 = fptrunc double %33 to float
%35 = load i32, i32* %6
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds float, float* %10, i64 %36
store float %34, float* %37
br label %38
38: ; preds = %17
%39 = load i32, i32* %6
%40 = add nsw i32 %39, 1
store i32 %40, i32* %6
br label %13
41: ; preds = %13
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %6
br label %43
43: ; preds = %53, %41
%44 = load i32, i32* %6
%45 = load i32, i32* %2
%46 = icmp slt i32 %44, %45
br i1 %46, label %47, label %56
47: ; preds = %43
%48 = load i32*, i32** %5
%49 = getelementptr inbounds i32, i32* %48, i32 1
store i32* %49, i32** %5
%50 = load i32, i32* %48
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %50)
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %53
53: ; preds = %47
%54 = load i32, i32* %6
%55 = add nsw i32 %54, 1
store i32 %55, i32* %6
br label %43
56: ; preds = %43
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%58 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"arr: \00"
@.str.1 = [5 x i8] c"%08X\00"
define void @test_floatarr(i32 %0) {
%2 = zext i32 %0 to i64
%3 = alloca float, i64 %2
store float 2.500000e+00, float* %3
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %42
5: ; preds = %1
%6 = add nsw i64 %2, -1
%7 = and i64 %6, 1
%8 = icmp eq i32 %0, 2
br i1 %8, label %31, label %9
9: ; preds = %5
%10 = and i64 %6, -2
br label %11
11: ; preds = %11, %9
%12 = phi float [ 2.500000e+00, %9 ], [ %26, %11 ]
%13 = phi i64 [ 1, %9 ], [ %28, %11 ]
%14 = phi i64 [ 0, %9 ], [ %29, %11 ]
%15 = tail call float @llvm.fmuladd.f32(float %12, float %12, float 2.500000e+00)
%16 = fpext float %15 to double
%17 = fdiv double %16, 1.250000e+00
%18 = fadd double %17, -1.900000e-01
%19 = fptrunc double %18 to float
%20 = getelementptr inbounds float, float* %3, i64 %13
store float %19, float* %20
%21 = add nuw nsw i64 %13, 1
%22 = tail call float @llvm.fmuladd.f32(float %19, float %19, float 2.500000e+00)
%23 = fpext float %22 to double
%24 = fdiv double %23, 1.250000e+00
%25 = fadd double %24, -1.900000e-01
%26 = fptrunc double %25 to float
%27 = getelementptr inbounds float, float* %3, i64 %21
store float %26, float* %27
%28 = add nuw nsw i64 %13, 2
%29 = add i64 %14, 2
%30 = icmp eq i64 %29, %10
br i1 %30, label %31, label %11
31: ; preds = %11, %5
%32 = phi float [ 2.500000e+00, %5 ], [ %26, %11 ]
%33 = phi i64 [ 1, %5 ], [ %28, %11 ]
%34 = icmp eq i64 %7, 0
br i1 %34, label %42, label %35
35: ; preds = %31
%36 = tail call float @llvm.fmuladd.f32(float %32, float %32, float 2.500000e+00)
%37 = fpext float %36 to double
%38 = fdiv double %37, 1.250000e+00
%39 = fadd double %38, -1.900000e-01
%40 = fptrunc double %39 to float
%41 = getelementptr inbounds float, float* %3, i64 %33
store float %40, float* %41
br label %42
42: ; preds = %35, %31, %1
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%44 = icmp sgt i32 %0, 0
br i1 %44, label %45, label %61
45: ; preds = %42
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 1075838976)
%47 = tail call i32 @putchar(i32 32)
%48 = icmp eq i32 %0, 1
br i1 %48, label %61, label %49
49: ; preds = %45
%50 = getelementptr inbounds float, float* %3, i64 1
%51 = bitcast float* %50 to i32*
br label %52
52: ; preds = %49, %52
%53 = phi i32 [ 1, %49 ], [ %59, %52 ]
%54 = phi i32* [ %51, %49 ], [ %56, %52 ]
%55 = load i32, i32* %54
%56 = getelementptr inbounds i32, i32* %54, i64 1
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %55)
%58 = tail call i32 @putchar(i32 32)
%59 = add nuw nsw i32 %53, 1
%60 = icmp eq i32 %59, %0
br i1 %60, label %61, label %52
61: ; preds = %52, %45, %42
%62 = tail call i32 @putchar(i32 10)
ret void
}