#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);
int main() {
  float number1, number2;
  float result;
  int counter;
  number1 = 1.0;
  number2 = 1.0;
  counter = 0;
  while (number1 + number2 != number1) {
    ++counter;
    number2 = number2 / 10.0;
  }
  printf("%2d digits accuracy in calculations\n", counter);
  number2 = 1.0;
  counter = 0;
  while (1) {
    result = number1 + number2;
    if (result == number1)
      break;
    ++counter;
    number2 = number2 / 10.0;
  }
  printf("%2d digits accuracy in storage\n", counter);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xecc(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jne    115f <main+0x4f>
jp     115f <main+0x4f>
jmp    118b <main+0x7b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe8f(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1140 <main+0x30>
mov    -0x14(%rbp),%esi
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
movss  0xe5e(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jne    11d7 <main+0xc7>
jp     11d7 <main+0xc7>
jmp    1203 <main+0xf3>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe17(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    11ae <main+0x9e>
mov    -0x14(%rbp),%esi
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"%2d digits accuracy in calculations\0A\00"
@.str.1 = [32 x i8] c"%2d digits accuracy in storage\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca i32
store i32 0, i32* %1
store float 1.000000e+00, float* %2
store float 1.000000e+00, float* %3
store i32 0, i32* %5
br label %6
6: ; preds = %12, %0
%7 = load float, float* %2
%8 = load float, float* %3
%9 = fadd float %7, %8
%10 = load float, float* %2
%11 = fcmp une float %9, %10
br i1 %11, label %12, label %19
12: ; preds = %6
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 1
store i32 %14, i32* %5
%15 = load float, float* %3
%16 = fpext float %15 to double
%17 = fdiv double %16, 1.000000e+01
%18 = fptrunc double %17 to float
store float %18, float* %3
br label %6
19: ; preds = %6
%20 = load i32, i32* %5
%21 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %20)
store float 1.000000e+00, float* %3
store i32 0, i32* %5
br label %22
22: ; preds = %19, %30
%23 = load float, float* %2
%24 = load float, float* %3
%25 = fadd float %23, %24
store float %25, float* %4
%26 = load float, float* %4
%27 = load float, float* %2
%28 = fcmp oeq float %26, %27
br i1 %28, label %29, label %30
29: ; preds = %22
br label %37
30: ; preds = %22
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 1
store i32 %32, i32* %5
%33 = load float, float* %3
%34 = fpext float %33 to double
%35 = fdiv double %34, 1.000000e+01
%36 = fptrunc double %35 to float
store float %36, float* %3
br label %22
37: ; preds = %29
%38 = load i32, i32* %5
%39 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %38)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"%2d digits accuracy in calculations\0A\00"
@.str.1 = [32 x i8] c"%2d digits accuracy in storage\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 8)
ret i32 0
}