#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 *);
int test_double() {
  static double f;
  static int i;
  static int e = 0;
  f = 1.0;
  for (i = 0; i < 10; i++)
    f += (1 << i);
  if (f != 1024.0) {
    printf("d1 ");
    e++;
  }
  f = 1024.0;
  for (i = 0; i < 10; i++)
    f -= (1 << i);
  if (f != 1.0) {
    printf("d2 ");
    e++;
  }
  f = 1.0;
  for (i = 1; i < 10; i++)
    f *= i;
  if (f != 362880.0) {
    printf("d3 ");
    e++;
  }
  f = 362880.0;
  for (i = 1; i < 10; i++)
    f /= i;
  if (f != 1.0) {
    printf("d4 ");
    e++;
  }
  f = 0.5;
  for (i = 1; i < 1000000; i++) {
    f += 2.0;
    f *= 0.5;
  }
  if (f != 2.0) {
    printf("d5 ");
    e++;
  }
  f = 2.0;
  for (i = 1; i < 1000000; i++) {
    f /= 0.5;
    f -= 2.0;
  }
  if (f != 2.0) {
    printf("d6 ");
    e++;
  }
  f = 1000000.0;
  for (i = 1; i < 1000000; i++)
    f = ((((f + 1.5) * 0.5) - 1.25) / 0.5);
  if (f != 1.0) {
    printf("d7 ");
    e++;
  }
  f = 1.0;
  for (i = 1; i < 1000000; i++)
    f = ((((f * 5.0) + 3.0) / 2.0) - 3.0);
  if (f != 1.0)
    printf("d8 ");
  f = 8.0;
  for (i = 1; i < 1000000; i++)
    f = ((((f - 5.0) / 2.0) + 2.5) * 2.0);
  if (f != 8.0) {
    printf("d9 ");
    e++;
  }
  f = 42.0;
  for (i = 1; i < 1000000; i++)
    f = ((((f / 6.0) - 5.0) * 19.75) + 2.5);
  if (f != 42.0) {
    printf("d10 ");
    e++;
  }
  if (e) {
    printf("\n");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<test_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,0x2f08(%rip)
movl   $0x0,0x2f06(%rip)
cmpl   $0xa,0x2eff(%rip)
jge    1174 <test_double+0x64>
mov    0x2ef3(%rip),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cvtsi2sd %eax,%xmm0
addsd  0x2ed8(%rip),%xmm0
movsd  %xmm0,0x2ed0(%rip)
mov    0x2ed2(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ec9(%rip)
jmp    1132 <test_double+0x22>
movsd  0x2eb4(%rip),%xmm0
movsd  0xe84(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1199 <test_double+0x89>
jp     1199 <test_double+0x89>
jmp    11b4 <test_double+0xa4>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e91(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2e88(%rip)
movsd  0xe4c(%rip),%xmm0
movsd  %xmm0,0x2e6c(%rip)
movl   $0x0,0x2e6a(%rip)
cmpl   $0xa,0x2e63(%rip)
jge    1214 <test_double+0x104>
mov    0x2e57(%rip),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cvtsi2sd %eax,%xmm1
movsd  0x2e3c(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x2e30(%rip)
mov    0x2e32(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2e29(%rip)
jmp    11ce <test_double+0xbe>
movsd  0x2e14(%rip),%xmm0
movsd  0xddc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1239 <test_double+0x129>
jp     1239 <test_double+0x129>
jmp    1254 <test_double+0x144>
lea    0xe3c(%rip),%rdi
call   1030 <printf@plt>
mov    0x2df1(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2de8(%rip)
movsd  0xda4(%rip),%xmm0
movsd  %xmm0,0x2dcc(%rip)
movl   $0x1,0x2dca(%rip)
cmpl   $0xa,0x2dc3(%rip)
jge    12a7 <test_double+0x197>
cvtsi2sdl 0x2db5(%rip),%xmm0
mulsd  0x2da5(%rip),%xmm0
movsd  %xmm0,0x2d9d(%rip)
mov    0x2d9f(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2d96(%rip)
jmp    126e <test_double+0x15e>
movsd  0x2d81(%rip),%xmm0
movsd  0xd59(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    12cc <test_double+0x1bc>
jp     12cc <test_double+0x1bc>
jmp    12e7 <test_double+0x1d7>
lea    0xdad(%rip),%rdi
call   1030 <printf@plt>
mov    0x2d5e(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2d55(%rip)
movsd  0xd21(%rip),%xmm0
movsd  %xmm0,0x2d39(%rip)
movl   $0x1,0x2d37(%rip)
cmpl   $0xa,0x2d30(%rip)
jge    133e <test_double+0x22e>
cvtsi2sdl 0x2d22(%rip),%xmm1
movsd  0x2d12(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x2d06(%rip)
mov    0x2d08(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2cff(%rip)
jmp    1301 <test_double+0x1f1>
movsd  0x2cea(%rip),%xmm0
movsd  0xcb2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1363 <test_double+0x253>
jp     1363 <test_double+0x253>
jmp    137e <test_double+0x26e>
lea    0xd1a(%rip),%rdi
call   1030 <printf@plt>
mov    0x2cc7(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2cbe(%rip)
movsd  0xc92(%rip),%xmm0
movsd  %xmm0,0x2ca2(%rip)
movl   $0x1,0x2ca0(%rip)
cmpl   $0xf4240,0x2c96(%rip)
jge    13ec <test_double+0x2dc>
movsd  0xc70(%rip),%xmm0
addsd  0x2c78(%rip),%xmm0
movsd  %xmm0,0x2c70(%rip)
movsd  0xc50(%rip),%xmm0
mulsd  0x2c60(%rip),%xmm0
movsd  %xmm0,0x2c58(%rip)
mov    0x2c5a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2c51(%rip)
jmp    1398 <test_double+0x288>
movsd  0x2c3c(%rip),%xmm0
movsd  0xc24(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1411 <test_double+0x301>
jp     1411 <test_double+0x301>
jmp    142c <test_double+0x31c>
lea    0xc70(%rip),%rdi
call   1030 <printf@plt>
mov    0x2c19(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2c10(%rip)
movsd  0xbec(%rip),%xmm0
movsd  %xmm0,0x2bf4(%rip)
movl   $0x1,0x2bf2(%rip)
cmpl   $0xf4240,0x2be8(%rip)
jge    14a2 <test_double+0x392>
movsd  0x2bd2(%rip),%xmm0
movsd  0xbb2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,0x2bbe(%rip)
movsd  0x2bb6(%rip),%xmm0
movsd  0xb9e(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,0x2ba2(%rip)
mov    0x2ba4(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2b9b(%rip)
jmp    1446 <test_double+0x336>
movsd  0x2b86(%rip),%xmm0
movsd  0xb6e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    14c7 <test_double+0x3b7>
jp     14c7 <test_double+0x3b7>
jmp    14e2 <test_double+0x3d2>
lea    0xbbe(%rip),%rdi
call   1030 <printf@plt>
mov    0x2b63(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2b5a(%rip)
movsd  0xb3e(%rip),%xmm0
movsd  %xmm0,0x2b3e(%rip)
movl   $0x1,0x2b3c(%rip)
cmpl   $0xf4240,0x2b32(%rip)
jge    155c <test_double+0x44c>
movsd  0xb5c(%rip),%xmm0
addsd  0x2b14(%rip),%xmm0
movsd  0xaf4(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xb38(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xadc(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,0x2ae8(%rip)
mov    0x2aea(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ae1(%rip)
jmp    14fc <test_double+0x3ec>
movsd  0x2acc(%rip),%xmm0
movsd  0xa94(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1581 <test_double+0x471>
jp     1581 <test_double+0x471>
jmp    159c <test_double+0x48c>
lea    0xb08(%rip),%rdi
call   1030 <printf@plt>
mov    0x2aa9(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2aa0(%rip)
movsd  0xa5c(%rip),%xmm0
movsd  %xmm0,0x2a84(%rip)
movl   $0x1,0x2a82(%rip)
cmpl   $0xf4240,0x2a78(%rip)
jge    161a <test_double+0x50a>
movsd  0x2a62(%rip),%xmm0
movsd  0xa7a(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xa7e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xa32(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xa66(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,0x2a2a(%rip)
mov    0x2a2c(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2a23(%rip)
jmp    15b6 <test_double+0x4a6>
movsd  0x2a0e(%rip),%xmm0
movsd  0x9d6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    163f <test_double+0x52f>
jp     163f <test_double+0x52f>
jmp    164b <test_double+0x53b>
lea    0xa4e(%rip),%rdi
call   1030 <printf@plt>
movsd  0x9dd(%rip),%xmm0
movsd  %xmm0,0x29d5(%rip)
movl   $0x1,0x29d3(%rip)
cmpl   $0xf4240,0x29c9(%rip)
jge    16c9 <test_double+0x5b9>
movsd  0x29b3(%rip),%xmm0
movsd  0x9cb(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0x98f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0x9ab(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0x977(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x297b(%rip)
mov    0x297d(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2974(%rip)
jmp    1665 <test_double+0x555>
movsd  0x295f(%rip),%xmm0
movsd  0x957(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    16ee <test_double+0x5de>
jp     16ee <test_double+0x5de>
jmp    1709 <test_double+0x5f9>
lea    0x9a3(%rip),%rdi
call   1030 <printf@plt>
mov    0x293c(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2933(%rip)
movsd  0x927(%rip),%xmm0
movsd  %xmm0,0x2917(%rip)
movl   $0x1,0x2915(%rip)
cmpl   $0xf4240,0x290b(%rip)
jge    1787 <test_double+0x677>
movsd  0x28f5(%rip),%xmm0
movsd  0x915(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0x901(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0x8e5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x8e1(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x28bd(%rip)
mov    0x28bf(%rip),%eax
add    $0x1,%eax
mov    %eax,0x28b6(%rip)
jmp    1723 <test_double+0x613>
movsd  0x28a1(%rip),%xmm0
movsd  0x8a1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    17ac <test_double+0x69c>
jp     17ac <test_double+0x69c>
jmp    17c7 <test_double+0x6b7>
lea    0x8e9(%rip),%rdi
call   1030 <printf@plt>
mov    0x287e(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2875(%rip)
cmpl   $0x0,0x286e(%rip)
je     17ec <test_double+0x6dc>
lea    0x8c6(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    17f3 <test_double+0x6e3>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_double>:
push   %rax
movsd  0xed7(%rip),%xmm0
mov    $0xf423f,%eax
movsd  0xed2(%rip),%xmm1
movapd %xmm0,%xmm2
nopw   0x0(%rax,%rax,1)
addsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
add    $0xfffffff9,%eax
jne    1140 <test_double+0x20>
ucomisd 0xe83(%rip),%xmm2
jne    1189 <test_double+0x69>
jnp    119c <test_double+0x7c>
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
addl   $0x1,0x2e98(%rip)
movsd  0xe6c(%rip),%xmm0
mov    $0xf423f,%eax
movsd  0xe67(%rip),%xmm1
movsd  0xe47(%rip),%xmm2
movsd  0xe5f(%rip),%xmm3
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
addsd  %xmm0,%xmm0
add    $0xfffffffd,%eax
jne    11d0 <test_double+0xb0>
ucomisd 0xe1b(%rip),%xmm0
jne    1211 <test_double+0xf1>
jnp    1224 <test_double+0x104>
lea    0xe1c(%rip),%rdi
call   1040 <printf@plt>
addl   $0x1,0x2e10(%rip)
cmpl   $0x0,0x2e09(%rip)
je     123e <test_double+0x11e>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@test_double.f = internal global double 0.000000e+00
@test_double.i = internal global i32 0
@test_double.e = internal global i32 0
@.str = [4 x i8] c"d1 \00"
@.str.1 = [4 x i8] c"d2 \00"
@.str.2 = [4 x i8] c"d3 \00"
@.str.3 = [4 x i8] c"d4 \00"
@.str.4 = [4 x i8] c"d5 \00"
@.str.5 = [4 x i8] c"d6 \00"
@.str.6 = [4 x i8] c"d7 \00"
@.str.7 = [4 x i8] c"d8 \00"
@.str.8 = [4 x i8] c"d9 \00"
@.str.9 = [5 x i8] c"d10 \00"
@.str.10 = [2 x i8] c"\0A\00"
define i32 @test_double() {
%1 = alloca i32
store double 1.000000e+00, double* @test_double.f
store i32 0, i32* @test_double.i
br label %2
2: ; preds = %11, %0
%3 = load i32, i32* @test_double.i
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %14
5: ; preds = %2
%6 = load i32, i32* @test_double.i
%7 = shl i32 1, %6
%8 = sitofp i32 %7 to double
%9 = load double, double* @test_double.f
%10 = fadd double %9, %8
store double %10, double* @test_double.f
br label %11
11: ; preds = %5
%12 = load i32, i32* @test_double.i
%13 = add nsw i32 %12, 1
store i32 %13, i32* @test_double.i
br label %2
14: ; preds = %2
%15 = load double, double* @test_double.f
%16 = fcmp une double %15, 1.024000e+03
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%19 = load i32, i32* @test_double.e
%20 = add nsw i32 %19, 1
store i32 %20, i32* @test_double.e
br label %21
21: ; preds = %17, %14
store double 1.024000e+03, double* @test_double.f
store i32 0, i32* @test_double.i
br label %22
22: ; preds = %31, %21
%23 = load i32, i32* @test_double.i
%24 = icmp slt i32 %23, 10
br i1 %24, label %25, label %34
25: ; preds = %22
%26 = load i32, i32* @test_double.i
%27 = shl i32 1, %26
%28 = sitofp i32 %27 to double
%29 = load double, double* @test_double.f
%30 = fsub double %29, %28
store double %30, double* @test_double.f
br label %31
31: ; preds = %25
%32 = load i32, i32* @test_double.i
%33 = add nsw i32 %32, 1
store i32 %33, i32* @test_double.i
br label %22
34: ; preds = %22
%35 = load double, double* @test_double.f
%36 = fcmp une double %35, 1.000000e+00
br i1 %36, label %37, label %41
37: ; preds = %34
%38 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%39 = load i32, i32* @test_double.e
%40 = add nsw i32 %39, 1
store i32 %40, i32* @test_double.e
br label %41
41: ; preds = %37, %34
store double 1.000000e+00, double* @test_double.f
store i32 1, i32* @test_double.i
br label %42
42: ; preds = %50, %41
%43 = load i32, i32* @test_double.i
%44 = icmp slt i32 %43, 10
br i1 %44, label %45, label %53
45: ; preds = %42
%46 = load i32, i32* @test_double.i
%47 = sitofp i32 %46 to double
%48 = load double, double* @test_double.f
%49 = fmul double %48, %47
store double %49, double* @test_double.f
br label %50
50: ; preds = %45
%51 = load i32, i32* @test_double.i
%52 = add nsw i32 %51, 1
store i32 %52, i32* @test_double.i
br label %42
53: ; preds = %42
%54 = load double, double* @test_double.f
%55 = fcmp une double %54, 3.628800e+05
br i1 %55, label %56, label %60
56: ; preds = %53
%57 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%58 = load i32, i32* @test_double.e
%59 = add nsw i32 %58, 1
store i32 %59, i32* @test_double.e
br label %60
60: ; preds = %56, %53
store double 3.628800e+05, double* @test_double.f
store i32 1, i32* @test_double.i
br label %61
61: ; preds = %69, %60
%62 = load i32, i32* @test_double.i
%63 = icmp slt i32 %62, 10
br i1 %63, label %64, label %72
64: ; preds = %61
%65 = load i32, i32* @test_double.i
%66 = sitofp i32 %65 to double
%67 = load double, double* @test_double.f
%68 = fdiv double %67, %66
store double %68, double* @test_double.f
br label %69
69: ; preds = %64
%70 = load i32, i32* @test_double.i
%71 = add nsw i32 %70, 1
store i32 %71, i32* @test_double.i
br label %61
72: ; preds = %61
%73 = load double, double* @test_double.f
%74 = fcmp une double %73, 1.000000e+00
br i1 %74, label %75, label %79
75: ; preds = %72
%76 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%77 = load i32, i32* @test_double.e
%78 = add nsw i32 %77, 1
store i32 %78, i32* @test_double.e
br label %79
79: ; preds = %75, %72
store double 5.000000e-01, double* @test_double.f
store i32 1, i32* @test_double.i
br label %80
80: ; preds = %88, %79
%81 = load i32, i32* @test_double.i
%82 = icmp slt i32 %81, 1000000
br i1 %82, label %83, label %91
83: ; preds = %80
%84 = load double, double* @test_double.f
%85 = fadd double %84, 2.000000e+00
store double %85, double* @test_double.f
%86 = load double, double* @test_double.f
%87 = fmul double %86, 5.000000e-01
store double %87, double* @test_double.f
br label %88
88: ; preds = %83
%89 = load i32, i32* @test_double.i
%90 = add nsw i32 %89, 1
store i32 %90, i32* @test_double.i
br label %80
91: ; preds = %80
%92 = load double, double* @test_double.f
%93 = fcmp une double %92, 2.000000e+00
br i1 %93, label %94, label %98
94: ; preds = %91
%95 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%96 = load i32, i32* @test_double.e
%97 = add nsw i32 %96, 1
store i32 %97, i32* @test_double.e
br label %98
98: ; preds = %94, %91
store double 2.000000e+00, double* @test_double.f
store i32 1, i32* @test_double.i
br label %99
99: ; preds = %107, %98
%100 = load i32, i32* @test_double.i
%101 = icmp slt i32 %100, 1000000
br i1 %101, label %102, label %110
102: ; preds = %99
%103 = load double, double* @test_double.f
%104 = fdiv double %103, 5.000000e-01
store double %104, double* @test_double.f
%105 = load double, double* @test_double.f
%106 = fsub double %105, 2.000000e+00
store double %106, double* @test_double.f
br label %107
107: ; preds = %102
%108 = load i32, i32* @test_double.i
%109 = add nsw i32 %108, 1
store i32 %109, i32* @test_double.i
br label %99
110: ; preds = %99
%111 = load double, double* @test_double.f
%112 = fcmp une double %111, 2.000000e+00
br i1 %112, label %113, label %117
113: ; preds = %110
%114 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%115 = load i32, i32* @test_double.e
%116 = add nsw i32 %115, 1
store i32 %116, i32* @test_double.e
br label %117
117: ; preds = %113, %110
store double 1.000000e+06, double* @test_double.f
store i32 1, i32* @test_double.i
br label %118
118: ; preds = %126, %117
%119 = load i32, i32* @test_double.i
%120 = icmp slt i32 %119, 1000000
br i1 %120, label %121, label %129
121: ; preds = %118
%122 = load double, double* @test_double.f
%123 = fadd double %122, 1.500000e+00
%124 = call double @llvm.fmuladd.f64(double %123, double 5.000000e-01, double -1.250000e+00)
%125 = fdiv double %124, 5.000000e-01
store double %125, double* @test_double.f
br label %126
126: ; preds = %121
%127 = load i32, i32* @test_double.i
%128 = add nsw i32 %127, 1
store i32 %128, i32* @test_double.i
br label %118
129: ; preds = %118
%130 = load double, double* @test_double.f
%131 = fcmp une double %130, 1.000000e+00
br i1 %131, label %132, label %136
132: ; preds = %129
%133 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%134 = load i32, i32* @test_double.e
%135 = add nsw i32 %134, 1
store i32 %135, i32* @test_double.e
br label %136
136: ; preds = %132, %129
store double 1.000000e+00, double* @test_double.f
store i32 1, i32* @test_double.i
br label %137
137: ; preds = %145, %136
%138 = load i32, i32* @test_double.i
%139 = icmp slt i32 %138, 1000000
br i1 %139, label %140, label %148
140: ; preds = %137
%141 = load double, double* @test_double.f
%142 = call double @llvm.fmuladd.f64(double %141, double 5.000000e+00, double 3.000000e+00)
%143 = fdiv double %142, 2.000000e+00
%144 = fsub double %143, 3.000000e+00
store double %144, double* @test_double.f
br label %145
145: ; preds = %140
%146 = load i32, i32* @test_double.i
%147 = add nsw i32 %146, 1
store i32 %147, i32* @test_double.i
br label %137
148: ; preds = %137
%149 = load double, double* @test_double.f
%150 = fcmp une double %149, 1.000000e+00
br i1 %150, label %151, label %153
151: ; preds = %148
%152 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %153
153: ; preds = %151, %148
store double 8.000000e+00, double* @test_double.f
store i32 1, i32* @test_double.i
br label %154
154: ; preds = %163, %153
%155 = load i32, i32* @test_double.i
%156 = icmp slt i32 %155, 1000000
br i1 %156, label %157, label %166
157: ; preds = %154
%158 = load double, double* @test_double.f
%159 = fsub double %158, 5.000000e+00
%160 = fdiv double %159, 2.000000e+00
%161 = fadd double %160, 2.500000e+00
%162 = fmul double %161, 2.000000e+00
store double %162, double* @test_double.f
br label %163
163: ; preds = %157
%164 = load i32, i32* @test_double.i
%165 = add nsw i32 %164, 1
store i32 %165, i32* @test_double.i
br label %154
166: ; preds = %154
%167 = load double, double* @test_double.f
%168 = fcmp une double %167, 8.000000e+00
br i1 %168, label %169, label %173
169: ; preds = %166
%170 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%171 = load i32, i32* @test_double.e
%172 = add nsw i32 %171, 1
store i32 %172, i32* @test_double.e
br label %173
173: ; preds = %169, %166
store double 4.200000e+01, double* @test_double.f
store i32 1, i32* @test_double.i
br label %174
174: ; preds = %182, %173
%175 = load i32, i32* @test_double.i
%176 = icmp slt i32 %175, 1000000
br i1 %176, label %177, label %185
177: ; preds = %174
%178 = load double, double* @test_double.f
%179 = fdiv double %178, 6.000000e+00
%180 = fsub double %179, 5.000000e+00
%181 = call double @llvm.fmuladd.f64(double %180, double 1.975000e+01, double 2.500000e+00)
store double %181, double* @test_double.f
br label %182
182: ; preds = %177
%183 = load i32, i32* @test_double.i
%184 = add nsw i32 %183, 1
store i32 %184, i32* @test_double.i
br label %174
185: ; preds = %174
%186 = load double, double* @test_double.f
%187 = fcmp une double %186, 4.200000e+01
br i1 %187, label %188, label %192
188: ; preds = %185
%189 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%190 = load i32, i32* @test_double.e
%191 = add nsw i32 %190, 1
store i32 %191, i32* @test_double.e
br label %192
192: ; preds = %188, %185
%193 = load i32, i32* @test_double.e
%194 = icmp ne i32 %193, 0
br i1 %194, label %195, label %197
195: ; preds = %192
%196 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
store i32 1, i32* %1
br label %198
197: ; preds = %192
store i32 0, i32* %1
br label %198
198: ; preds = %197, %195
%199 = load i32, i32* %1
ret i32 %199
}

LLVM IR (-O2):
@test_double.e = internal unnamed_addr global i32 0
@.str.4 = [4 x i8] c"d5 \00"
@.str.6 = [4 x i8] c"d7 \00"
define i32 @test_double() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 1, %0 ], [ %18, %1 ]
%3 = phi double [ 5.000000e-01, %0 ], [ %17, %1 ]
%4 = fadd double %3, 2.000000e+00
%5 = fmul double %4, 5.000000e-01
%6 = fadd double %5, 2.000000e+00
%7 = fmul double %6, 5.000000e-01
%8 = fadd double %7, 2.000000e+00
%9 = fmul double %8, 5.000000e-01
%10 = fadd double %9, 2.000000e+00
%11 = fmul double %10, 5.000000e-01
%12 = fadd double %11, 2.000000e+00
%13 = fmul double %12, 5.000000e-01
%14 = fadd double %13, 2.000000e+00
%15 = fmul double %14, 5.000000e-01
%16 = fadd double %15, 2.000000e+00
%17 = fmul double %16, 5.000000e-01
%18 = add nuw nsw i32 %2, 7
%19 = icmp eq i32 %18, 1000000
br i1 %19, label %20, label %1
20: ; preds = %1
%21 = fcmp une double %17, 2.000000e+00
br i1 %21, label %22, label %26
22: ; preds = %20
%23 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%24 = load i32, i32* @test_double.e
%25 = add nsw i32 %24, 1
store i32 %25, i32* @test_double.e
br label %26
26: ; preds = %20, %22
br label %27
27: ; preds = %27, %26
%28 = phi i32 [ 1, %26 ], [ %39, %27 ]
%29 = phi double [ 1.000000e+06, %26 ], [ %38, %27 ]
%30 = fadd double %29, 1.500000e+00
%31 = tail call double @llvm.fmuladd.f64(double %30, double 5.000000e-01, double -1.250000e+00)
%32 = fmul double %31, 2.000000e+00
%33 = fadd double %32, 1.500000e+00
%34 = tail call double @llvm.fmuladd.f64(double %33, double 5.000000e-01, double -1.250000e+00)
%35 = fmul double %34, 2.000000e+00
%36 = fadd double %35, 1.500000e+00
%37 = tail call double @llvm.fmuladd.f64(double %36, double 5.000000e-01, double -1.250000e+00)
%38 = fmul double %37, 2.000000e+00
%39 = add nuw nsw i32 %28, 3
%40 = icmp eq i32 %39, 1000000
br i1 %40, label %41, label %27
41: ; preds = %27
%42 = fcmp une double %38, 1.000000e+00
br i1 %42, label %43, label %47
43: ; preds = %41
%44 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%45 = load i32, i32* @test_double.e
%46 = add nsw i32 %45, 1
store i32 %46, i32* @test_double.e
br label %47
47: ; preds = %41, %43
%48 = load i32, i32* @test_double.e
%49 = icmp eq i32 %48, 0
br i1 %49, label %52, label %50
50: ; preds = %47
%51 = tail call i32 @putchar(i32 10)
br label %52
52: ; preds = %47, %50
%53 = phi i32 [ 1, %50 ], [ 0, %47 ]
ret i32 %53
}