#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*/ assertEq(int, int);
int /*<<< orphan*/ assertEqf(float, double);
int /*<<< orphan*/ endTest();
int main() {
  int a, b, c, d, e, f;
  float u, v, w, x, y, z;
  a = 10;
  b = a + 10;
  c = b + b - 10;
  d = a * 4;
  e = a * a / 2;
  f = ((2 * a + b + -c + e) * d) / (b * 2);
  assertEq(a, 10);
  assertEq(b, 20);
  assertEq(c, 30);
  assertEq(d, 40);
  assertEq(e, 50);
  assertEq(f, 60);
  u = 0.125;
  v = u + 0.125;
  w = v + v - 0.125;
  x = v * v * 8.0;
  y = x * 5.0 / 4.0;
  z = x * x * x + (w - u) * 2.0 + y - 1.0 / 2.0;
  assertEqf(u, 0.125);
  assertEqf(v, 0.250);
  assertEqf(w, 0.375);
  assertEqf(x, 0.500);
  assertEqf(y, 0.625);
  assertEqf(z, 0.750);
  endTest();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    -0x8(%rbp),%eax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
add    %ecx,%eax
add    -0x14(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xa,%esi
call   1040 <assertEq@plt>
mov    -0x8(%rbp),%edi
mov    $0x14,%esi
call   1040 <assertEq@plt>
mov    -0xc(%rbp),%edi
mov    $0x1e,%esi
call   1040 <assertEq@plt>
mov    -0x10(%rbp),%edi
mov    $0x28,%esi
call   1040 <assertEq@plt>
mov    -0x14(%rbp),%edi
mov    $0x32,%esi
call   1040 <assertEq@plt>
mov    -0x18(%rbp),%edi
mov    $0x3c,%esi
call   1040 <assertEq@plt>
movss  0xe60(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe2a(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
addss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe07(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x20(%rbp),%xmm0
mulss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdfc(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdd6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdc2(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x28(%rbp),%xmm0
mulss  -0x28(%rbp),%xmm0
mulss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x24(%rbp),%xmm0
subss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movss  -0x2c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
movsd  0xd57(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x1c(%rbp),%xmm0
movsd  0xd55(%rip),%xmm1
call   1050 <assertEqf@plt>
movss  -0x20(%rbp),%xmm0
movsd  0xd3b(%rip),%xmm1
call   1050 <assertEqf@plt>
movss  -0x24(%rbp),%xmm0
movsd  0xd21(%rip),%xmm1
call   1050 <assertEqf@plt>
movss  -0x28(%rbp),%xmm0
movsd  0xd07(%rip),%xmm1
call   1050 <assertEqf@plt>
movss  -0x2c(%rbp),%xmm0
movsd  0xced(%rip),%xmm1
call   1050 <assertEqf@plt>
movss  -0x30(%rbp),%xmm0
movsd  0xcd3(%rip),%xmm1
call   1050 <assertEqf@plt>
mov    $0x0,%al
call   1030 <endTest@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0xa,%esi
call   1040 <assertEq@plt>
mov    $0x14,%edi
mov    $0x14,%esi
call   1040 <assertEq@plt>
mov    $0x1e,%edi
mov    $0x1e,%esi
call   1040 <assertEq@plt>
mov    $0x28,%edi
mov    $0x28,%esi
call   1040 <assertEq@plt>
mov    $0x32,%edi
mov    $0x32,%esi
call   1040 <assertEq@plt>
mov    $0x3c,%edi
mov    $0x3c,%esi
call   1040 <assertEq@plt>
movss  0xe6d(%rip),%xmm0
movsd  0xe7d(%rip),%xmm1
call   1050 <assertEqf@plt>
movss  0xe5c(%rip),%xmm0
movsd  0xe70(%rip),%xmm1
call   1050 <assertEqf@plt>
movss  0xe4b(%rip),%xmm0
movsd  0xe63(%rip),%xmm1
call   1050 <assertEqf@plt>
movss  0xe3a(%rip),%xmm0
movsd  0xe56(%rip),%xmm1
call   1050 <assertEqf@plt>
movss  0xe29(%rip),%xmm0
movsd  0xe49(%rip),%xmm1
call   1050 <assertEqf@plt>
movss  0xe18(%rip),%xmm0
movsd  0xe3c(%rip),%xmm1
call   1050 <assertEqf@plt>
xor    %eax,%eax
call   1030 <endTest@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store i32 10, i32* %1
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 10
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = load i32, i32* %2
%17 = add nsw i32 %15, %16
%18 = sub nsw i32 %17, 10
store i32 %18, i32* %3
%19 = load i32, i32* %1
%20 = mul nsw i32 %19, 4
store i32 %20, i32* %4
%21 = load i32, i32* %1
%22 = load i32, i32* %1
%23 = mul nsw i32 %21, %22
%24 = sdiv i32 %23, 2
store i32 %24, i32* %5
%25 = load i32, i32* %1
%26 = mul nsw i32 2, %25
%27 = load i32, i32* %2
%28 = add nsw i32 %26, %27
%29 = load i32, i32* %3
%30 = sub nsw i32 0, %29
%31 = add nsw i32 %28, %30
%32 = load i32, i32* %5
%33 = add nsw i32 %31, %32
%34 = load i32, i32* %4
%35 = mul nsw i32 %33, %34
%36 = load i32, i32* %2
%37 = mul nsw i32 %36, 2
%38 = sdiv i32 %35, %37
store i32 %38, i32* %6
%39 = load i32, i32* %1
%40 = call i32 @assertEq(i32 %39, i32 10)
%41 = load i32, i32* %2
%42 = call i32 @assertEq(i32 %41, i32 20)
%43 = load i32, i32* %3
%44 = call i32 @assertEq(i32 %43, i32 30)
%45 = load i32, i32* %4
%46 = call i32 @assertEq(i32 %45, i32 40)
%47 = load i32, i32* %5
%48 = call i32 @assertEq(i32 %47, i32 50)
%49 = load i32, i32* %6
%50 = call i32 @assertEq(i32 %49, i32 60)
store float 1.250000e-01, float* %7
%51 = load float, float* %7
%52 = fpext float %51 to double
%53 = fadd double %52, 1.250000e-01
%54 = fptrunc double %53 to float
store float %54, float* %8
%55 = load float, float* %8
%56 = load float, float* %8
%57 = fadd float %55, %56
%58 = fpext float %57 to double
%59 = fsub double %58, 1.250000e-01
%60 = fptrunc double %59 to float
store float %60, float* %9
%61 = load float, float* %8
%62 = load float, float* %8
%63 = fmul float %61, %62
%64 = fpext float %63 to double
%65 = fmul double %64, 8.000000e+00
%66 = fptrunc double %65 to float
store float %66, float* %10
%67 = load float, float* %10
%68 = fpext float %67 to double
%69 = fmul double %68, 5.000000e+00
%70 = fdiv double %69, 4.000000e+00
%71 = fptrunc double %70 to float
store float %71, float* %11
%72 = load float, float* %10
%73 = load float, float* %10
%74 = fmul float %72, %73
%75 = load float, float* %10
%76 = fmul float %74, %75
%77 = fpext float %76 to double
%78 = load float, float* %9
%79 = load float, float* %7
%80 = fsub float %78, %79
%81 = fpext float %80 to double
%82 = call double @llvm.fmuladd.f64(double %81, double 2.000000e+00, double %77)
%83 = load float, float* %11
%84 = fpext float %83 to double
%85 = fadd double %82, %84
%86 = fsub double %85, 5.000000e-01
%87 = fptrunc double %86 to float
store float %87, float* %12
%88 = load float, float* %7
%89 = call i32 @assertEqf(float %88, double 1.250000e-01)
%90 = load float, float* %8
%91 = call i32 @assertEqf(float %90, double 2.500000e-01)
%92 = load float, float* %9
%93 = call i32 @assertEqf(float %92, double 3.750000e-01)
%94 = load float, float* %10
%95 = call i32 @assertEqf(float %94, double 5.000000e-01)
%96 = load float, float* %11
%97 = call i32 @assertEqf(float %96, double 6.250000e-01)
%98 = load float, float* %12
%99 = call i32 @assertEqf(float %98, double 7.500000e-01)
%100 = call i32 (...) @endTest()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assertEq(i32 10, i32 10)
%2 = tail call i32 @assertEq(i32 20, i32 20)
%3 = tail call i32 @assertEq(i32 30, i32 30)
%4 = tail call i32 @assertEq(i32 40, i32 40)
%5 = tail call i32 @assertEq(i32 50, i32 50)
%6 = tail call i32 @assertEq(i32 60, i32 60)
%7 = tail call i32 @assertEqf(float 1.250000e-01, double 1.250000e-01)
%8 = tail call i32 @assertEqf(float 2.500000e-01, double 2.500000e-01)
%9 = tail call i32 @assertEqf(float 3.750000e-01, double 3.750000e-01)
%10 = tail call i32 @assertEqf(float 5.000000e-01, double 5.000000e-01)
%11 = tail call i32 @assertEqf(float 6.250000e-01, double 6.250000e-01)
%12 = tail call i32 @assertEqf(float 7.500000e-01, double 7.500000e-01)
%13 = tail call i32 (...) @endTest()
ret i32 0
}