#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 M_PI;
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  int rowCount = 0;
  float filRadius = 65.0f;
  float innerRadius = 25.0f;
  float filDiameter = 1.75f;
  float filStrandsHigh = (filRadius - innerRadius) / filDiameter;
  float estLength = 0.0f;
  float reelWidth = 85.91f;
  float filStrandsWide = reelWidth / filDiameter;
  for (rowCount = 0; (rowCount <= filStrandsHigh) && (filRadius >= innerRadius);
       rowCount++) {
    estLength += (M_PI * (2 * filRadius)) * filStrandsWide;
    filRadius = filRadius - filDiameter;
  }
  estLength = estLength / 1000;
  printf("Estimated length: %0.2f\n", estLength);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movss  0xede(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xecd(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xebc(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
divss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xe8f(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
divss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movl   $0x0,-0x8(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm1
movss  -0x18(%rbp),%xmm0
xor    %eax,%eax
ucomiss %xmm1,%xmm0
mov    %al,-0x25(%rbp)
jb     11b3 <main+0xa3>
movss  -0xc(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
setae  %al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
test   $0x1,%al
jne    11c3 <main+0xb3>
jmp    1213 <main+0x103>
mov    0x2e1e(%rip),%rax
cvtsi2ssl (%rax),%xmm0
movss  0xe3e(%rip),%xmm1
mulss  -0xc(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  -0x24(%rbp),%xmm2
movss  -0x1c(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    118c <main+0x7c>
movss  -0x1c(%rbp),%xmm0
movss  0xdf0(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
lea    0xde3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
cvtsi2ssl (%rax),%xmm0
movss  0xedc(%rip),%xmm2
mulss  %xmm0,%xmm2
movss  0xed4(%rip),%xmm1
mulss  %xmm1,%xmm2
xorps  %xmm3,%xmm3
addss  %xmm2,%xmm3
movss  0xec5(%rip),%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm1,%xmm2
addss  %xmm3,%xmm2
movss  0xeb5(%rip),%xmm3
mulss  %xmm0,%xmm3
mulss  %xmm1,%xmm3
addss  %xmm2,%xmm3
movss  0xea5(%rip),%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm1,%xmm2
addss  %xmm3,%xmm2
movss  0xe95(%rip),%xmm3
mulss  %xmm0,%xmm3
mulss  %xmm1,%xmm3
addss  %xmm2,%xmm3
movss  0xe85(%rip),%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm1,%xmm2
addss  %xmm3,%xmm2
movss  0xe75(%rip),%xmm3
mulss  %xmm0,%xmm3
mulss  %xmm1,%xmm3
addss  %xmm2,%xmm3
movss  0xe65(%rip),%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm1,%xmm2
addss  %xmm3,%xmm2
movss  0xe55(%rip),%xmm3
mulss  %xmm0,%xmm3
mulss  %xmm1,%xmm3
addss  %xmm2,%xmm3
movss  0xe45(%rip),%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm1,%xmm2
addss  %xmm3,%xmm2
movss  0xe35(%rip),%xmm3
mulss  %xmm0,%xmm3
mulss  %xmm1,%xmm3
addss  %xmm2,%xmm3
movss  0xe25(%rip),%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm1,%xmm2
addss  %xmm3,%xmm2
movss  0xe15(%rip),%xmm3
mulss  %xmm0,%xmm3
mulss  %xmm1,%xmm3
addss  %xmm2,%xmm3
movss  0xe05(%rip),%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm1,%xmm2
addss  %xmm3,%xmm2
movss  0xdf5(%rip),%xmm3
mulss  %xmm0,%xmm3
mulss  %xmm1,%xmm3
addss  %xmm2,%xmm3
movss  0xde5(%rip),%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm1,%xmm2
addss  %xmm3,%xmm2
movss  0xdd5(%rip),%xmm3
mulss  %xmm0,%xmm3
mulss  %xmm1,%xmm3
addss  %xmm2,%xmm3
movss  0xdc5(%rip),%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm1,%xmm2
addss  %xmm3,%xmm2
movss  0xdb5(%rip),%xmm3
mulss  %xmm0,%xmm3
mulss  %xmm1,%xmm3
addss  %xmm2,%xmm3
movss  0xda5(%rip),%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm1,%xmm2
addss  %xmm3,%xmm2
movss  0xd95(%rip),%xmm3
mulss  %xmm0,%xmm3
mulss  %xmm1,%xmm3
addss  %xmm2,%xmm3
movss  0xd85(%rip),%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm1,%xmm2
addss  %xmm3,%xmm2
mulss  0xd75(%rip),%xmm0
mulss  %xmm1,%xmm0
addss  %xmm2,%xmm0
divss  0xd69(%rip),%xmm0
lea    0xd66(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@M_PI = global i32 0
@.str = [25 x i8] c"Estimated length: %0.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
store i32 0, i32* %1
store i32 0, i32* %2
store float 6.500000e+01, float* %3
store float 2.500000e+01, float* %4
store float 1.750000e+00, float* %5
%10 = load float, float* %3
%11 = load float, float* %4
%12 = fsub float %10, %11
%13 = load float, float* %5
%14 = fdiv float %12, %13
store float %14, float* %6
store float 0.000000e+00, float* %7
store float 0x40557A3D80000000, float* %8
%15 = load float, float* %8
%16 = load float, float* %5
%17 = fdiv float %15, %16
store float %17, float* %9
store i32 0, i32* %2
br label %18
18: ; preds = %41, %0
%19 = load i32, i32* %2
%20 = sitofp i32 %19 to float
%21 = load float, float* %6
%22 = fcmp ole float %20, %21
br i1 %22, label %23, label %27
23: ; preds = %18
%24 = load float, float* %3
%25 = load float, float* %4
%26 = fcmp oge float %24, %25
br label %27
27: ; preds = %23, %18
%28 = phi i1 [ false, %18 ], [ %26, %23 ]
br i1 %28, label %29, label %44
29: ; preds = %27
%30 = load i32, i32* @M_PI
%31 = sitofp i32 %30 to float
%32 = load float, float* %3
%33 = fmul float 2.000000e+00, %32
%34 = fmul float %31, %33
%35 = load float, float* %9
%36 = load float, float* %7
%37 = call float @llvm.fmuladd.f32(float %34, float %35, float %36)
store float %37, float* %7
%38 = load float, float* %3
%39 = load float, float* %5
%40 = fsub float %38, %39
store float %40, float* %3
br label %41
41: ; preds = %29
%42 = load i32, i32* %2
%43 = add nsw i32 %42, 1
store i32 %43, i32* %2
br label %18
44: ; preds = %27
%45 = load float, float* %7
%46 = fdiv float %45, 1.000000e+03
store float %46, float* %7
%47 = load float, float* %7
%48 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), float %47)
ret i32 0
}

LLVM IR (-O2):
@M_PI = global i32 0
@.str = [25 x i8] c"Estimated length: %0.2f\0A\00"
define i32 @main() {
%1 = load i32, i32* @M_PI
%2 = sitofp i32 %1 to float
%3 = fmul float %2, 1.300000e+02
%4 = tail call float @llvm.fmuladd.f32(float %3, float 0x40488BB400000000, float 0.000000e+00)
%5 = fmul float %2, 1.265000e+02
%6 = tail call float @llvm.fmuladd.f32(float %5, float 0x40488BB400000000, float %4)
%7 = fmul float %2, 1.230000e+02
%8 = tail call float @llvm.fmuladd.f32(float %7, float 0x40488BB400000000, float %6)
%9 = fmul float %2, 1.195000e+02
%10 = tail call float @llvm.fmuladd.f32(float %9, float 0x40488BB400000000, float %8)
%11 = fmul float %2, 1.160000e+02
%12 = tail call float @llvm.fmuladd.f32(float %11, float 0x40488BB400000000, float %10)
%13 = fmul float %2, 1.125000e+02
%14 = tail call float @llvm.fmuladd.f32(float %13, float 0x40488BB400000000, float %12)
%15 = fmul float %2, 1.090000e+02
%16 = tail call float @llvm.fmuladd.f32(float %15, float 0x40488BB400000000, float %14)
%17 = fmul float %2, 1.055000e+02
%18 = tail call float @llvm.fmuladd.f32(float %17, float 0x40488BB400000000, float %16)
%19 = fmul float %2, 1.020000e+02
%20 = tail call float @llvm.fmuladd.f32(float %19, float 0x40488BB400000000, float %18)
%21 = fmul float %2, 9.850000e+01
%22 = tail call float @llvm.fmuladd.f32(float %21, float 0x40488BB400000000, float %20)
%23 = fmul float %2, 9.500000e+01
%24 = tail call float @llvm.fmuladd.f32(float %23, float 0x40488BB400000000, float %22)
%25 = fmul float %2, 9.150000e+01
%26 = tail call float @llvm.fmuladd.f32(float %25, float 0x40488BB400000000, float %24)
%27 = fmul float %2, 8.800000e+01
%28 = tail call float @llvm.fmuladd.f32(float %27, float 0x40488BB400000000, float %26)
%29 = fmul float %2, 8.450000e+01
%30 = tail call float @llvm.fmuladd.f32(float %29, float 0x40488BB400000000, float %28)
%31 = fmul float %2, 8.100000e+01
%32 = tail call float @llvm.fmuladd.f32(float %31, float 0x40488BB400000000, float %30)
%33 = fmul float %2, 7.750000e+01
%34 = tail call float @llvm.fmuladd.f32(float %33, float 0x40488BB400000000, float %32)
%35 = fmul float %2, 7.400000e+01
%36 = tail call float @llvm.fmuladd.f32(float %35, float 0x40488BB400000000, float %34)
%37 = fmul float %2, 7.050000e+01
%38 = tail call float @llvm.fmuladd.f32(float %37, float 0x40488BB400000000, float %36)
%39 = fmul float %2, 6.700000e+01
%40 = tail call float @llvm.fmuladd.f32(float %39, float 0x40488BB400000000, float %38)
%41 = fmul float %2, 6.350000e+01
%42 = tail call float @llvm.fmuladd.f32(float %41, float 0x40488BB400000000, float %40)
%43 = fmul float %2, 6.000000e+01
%44 = tail call float @llvm.fmuladd.f32(float %43, float 0x40488BB400000000, float %42)
%45 = fmul float %2, 5.650000e+01
%46 = tail call float @llvm.fmuladd.f32(float %45, float 0x40488BB400000000, float %44)
%47 = fmul float %2, 5.300000e+01
%48 = tail call float @llvm.fmuladd.f32(float %47, float 0x40488BB400000000, float %46)
%49 = fdiv float %48, 1.000000e+03
%50 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), float %49)
ret i32 0
}