#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*/ err(int, int);
double fabs(float);
void do_calcs(void) {
  float a, b, c, d, e;
  float foo, bar;
  int i;
  a = 1.1;
  b = 2.2;
  c = 3.3;
  d = 4.4;
  e = 5.5;
  foo = a * b;
  bar = c * d;
  i = 0;
  while (i < 10) {
    foo += c;
    foo *= d;
    foo /= e;
    bar -= a;
    bar *= b;
    bar /= e;
    foo *= e;
    foo /= d;
    foo -= c;
    bar *= e;
    bar /= b;
    bar += a;
    i++;
  }
  if (fabs(foo - (a * b)) > 0.0001)
    err(8, 1);
  if (fabs(bar - (c * d)) > 0.0001)
    err(8, 2);
}


x86 assembly (clang, -O0):
<do_calcs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  0xee0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xecf(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xebe(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xead(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xe9c(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0xa,-0x20(%rbp)
jge    1272 <do_calcs+0x152>
movss  -0xc(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm1
movss  -0x18(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
mulss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0x18(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0x18(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    118e <do_calcs+0x6e>
movss  -0x18(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <fabs@plt>
movsd  0xd75(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12bc <do_calcs+0x19c>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <err@plt>
movss  -0x1c(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <fabs@plt>
movsd  0xd2b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1306 <do_calcs+0x1e6>
mov    $0x8,%edi
mov    $0x2,%esi
call   1040 <err@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_calcs>:
push   %rax
movss  0xed7(%rip),%xmm0
call   1030 <fabs@plt>
ucomisd 0xed2(%rip),%xmm0
jbe    1147 <do_calcs+0x27>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <err@plt>
movss  0xeb5(%rip),%xmm0
call   1030 <fabs@plt>
ucomisd 0xeac(%rip),%xmm0
jbe    116e <do_calcs+0x4e>
mov    $0x8,%edi
mov    $0x2,%esi
pop    %rax
jmp    1040 <err@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @do_calcs() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca i32
store float 0x3FF19999A0000000, float* %1
store float 0x40019999A0000000, float* %2
store float 0x400A666660000000, float* %3
store float 0x40119999A0000000, float* %4
store float 5.500000e+00, float* %5
%9 = load float, float* %1
%10 = load float, float* %2
%11 = fmul float %9, %10
store float %11, float* %6
%12 = load float, float* %3
%13 = load float, float* %4
%14 = fmul float %12, %13
store float %14, float* %7
store i32 0, i32* %8
br label %15
15: ; preds = %18, %0
%16 = load i32, i32* %8
%17 = icmp slt i32 %16, 10
br i1 %17, label %18, label %57
18: ; preds = %15
%19 = load float, float* %3
%20 = load float, float* %6
%21 = fadd float %20, %19
store float %21, float* %6
%22 = load float, float* %4
%23 = load float, float* %6
%24 = fmul float %23, %22
store float %24, float* %6
%25 = load float, float* %5
%26 = load float, float* %6
%27 = fdiv float %26, %25
store float %27, float* %6
%28 = load float, float* %1
%29 = load float, float* %7
%30 = fsub float %29, %28
store float %30, float* %7
%31 = load float, float* %2
%32 = load float, float* %7
%33 = fmul float %32, %31
store float %33, float* %7
%34 = load float, float* %5
%35 = load float, float* %7
%36 = fdiv float %35, %34
store float %36, float* %7
%37 = load float, float* %5
%38 = load float, float* %6
%39 = fmul float %38, %37
store float %39, float* %6
%40 = load float, float* %4
%41 = load float, float* %6
%42 = fdiv float %41, %40
store float %42, float* %6
%43 = load float, float* %3
%44 = load float, float* %6
%45 = fsub float %44, %43
store float %45, float* %6
%46 = load float, float* %5
%47 = load float, float* %7
%48 = fmul float %47, %46
store float %48, float* %7
%49 = load float, float* %2
%50 = load float, float* %7
%51 = fdiv float %50, %49
store float %51, float* %7
%52 = load float, float* %1
%53 = load float, float* %7
%54 = fadd float %53, %52
store float %54, float* %7
%55 = load i32, i32* %8
%56 = add nsw i32 %55, 1
store i32 %56, i32* %8
br label %15
57: ; preds = %15
%58 = load float, float* %6
%59 = load float, float* %1
%60 = load float, float* %2
%61 = fneg float %59
%62 = call float @llvm.fmuladd.f32(float %61, float %60, float %58)
%63 = call double @fabs(float %62)
%64 = fcmp ogt double %63, 1.000000e-04
br i1 %64, label %65, label %67
65: ; preds = %57
%66 = call i32 @err(i32 8, i32 1)
br label %67
67: ; preds = %65, %57
%68 = load float, float* %7
%69 = load float, float* %3
%70 = load float, float* %4
%71 = fneg float %69
%72 = call float @llvm.fmuladd.f32(float %71, float %70, float %68)
%73 = call double @fabs(float %72)
%74 = fcmp ogt double %73, 1.000000e-04
br i1 %74, label %75, label %77
75: ; preds = %67
%76 = call i32 @err(i32 8, i32 2)
br label %77
77: ; preds = %75, %67
ret void
}

LLVM IR (-O2):
define void @do_calcs() {
%1 = tail call double @fabs(float 0x3E90000000000000)
%2 = fcmp ogt double %1, 1.000000e-04
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @err(i32 8, i32 1)
br label %5
5: ; preds = %3, %0
%6 = tail call double @fabs(float 0x3E97AE1480000000)
%7 = fcmp ogt double %6, 1.000000e-04
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @err(i32 8, i32 2)
br label %10
10: ; preds = %8, %5
ret void
}