#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 *, float);
int main(void) {
  int i, subtract = 1;
  long max = 10000000000;
  float f;
  f = 0.0;
  for (i = 0; i <= max; ++i) {
    if (subtract) {
      f -= 0.1;
      subtract = 1;
    } else {
      f += 0.1;
      subtract = 0;
    }
  }
  printf("[%.8f]\n", f);
  f = 0.0;
  for (i = 0; i < max; ++i) {
    f += 0.1;
  }
  f -= 0.1 * max;
  printf("[%.8f]\n", f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movabs $0x2540be400,%rax
mov    %rax,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     11bd <main+0xad>
cmpl   $0x0,-0xc(%rbp)
je     1185 <main+0x75>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe9c(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movl   $0x1,-0xc(%rbp)
jmp    11aa <main+0x9a>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe72(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movl   $0x0,-0xc(%rbp)
jmp    11af <main+0x9f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1143 <main+0x33>
movss  -0x1c(%rbp),%xmm0
lea    0xe47(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1217 <main+0x107>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe0c(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11dd <main+0xcd>
cvtsi2sdq -0x18(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xdd2(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
lea    0xdc5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
@.str = [8 x i8] c"[%.8f]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
%5 = alloca float
store i32 0, i32* %1
store i32 1, i32* %3
store i64 10000000000, i64* %4
store float 0.000000e+00, float* %5
store i32 0, i32* %2
br label %6
6: ; preds = %25, %0
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = load i64, i64* %4
%10 = icmp sle i64 %8, %9
br i1 %10, label %11, label %28
11: ; preds = %6
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load float, float* %5
%16 = fpext float %15 to double
%17 = fsub double %16, 1.000000e-01
%18 = fptrunc double %17 to float
store float %18, float* %5
store i32 1, i32* %3
br label %24
19: ; preds = %11
%20 = load float, float* %5
%21 = fpext float %20 to double
%22 = fadd double %21, 1.000000e-01
%23 = fptrunc double %22 to float
store float %23, float* %5
store i32 0, i32* %3
br label %24
24: ; preds = %19, %14
br label %25
25: ; preds = %24
%26 = load i32, i32* %2
%27 = add nsw i32 %26, 1
store i32 %27, i32* %2
br label %6
28: ; preds = %6
%29 = load float, float* %5
%30 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float %29)
store float 0.000000e+00, float* %5
store i32 0, i32* %2
br label %31
31: ; preds = %41, %28
%32 = load i32, i32* %2
%33 = sext i32 %32 to i64
%34 = load i64, i64* %4
%35 = icmp slt i64 %33, %34
br i1 %35, label %36, label %44
36: ; preds = %31
%37 = load float, float* %5
%38 = fpext float %37 to double
%39 = fadd double %38, 1.000000e-01
%40 = fptrunc double %39 to float
store float %40, float* %5
br label %41
41: ; preds = %36
%42 = load i32, i32* %2
%43 = add nsw i32 %42, 1
store i32 %43, i32* %2
br label %31
44: ; preds = %31
%45 = load i64, i64* %4
%46 = sitofp i64 %45 to double
%47 = load float, float* %5
%48 = fpext float %47 to double
%49 = call double @llvm.fmuladd.f64(double -1.000000e-01, double %46, double %48)
%50 = fptrunc double %49 to float
store float %50, float* %5
%51 = load float, float* %5
%52 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float %51)
ret i32 0
}

LLVM IR (-O2):