#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 double_almost_equal(double, double);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("1.0 = %.16f\n", 1.0);
  printf("0.1 * 10 = %.16f\n", 0.1 * 10);
  printf("0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 = %.16f\n",
         0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1);
  printf("0.1 * 10 == 1.0? %d\n", 0.1 * 10 == 1.0);
  printf(
      "0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 == 1.0? %d\n",
      0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 == 1.0);
  printf("0.1 * 10 == 1.0? %d\n", double_almost_equal(0.1 * 10, 1.0));
  printf(
      "0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 == 1.0? %d\n",
      double_almost_equal(
          0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1, 1.0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
call   1040 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0x1,%esi
call   1040 <printf@plt>
lea    0xed7(%rip),%rdi
xor    %esi,%esi
call   1040 <printf@plt>
lea    0xf0c(%rip),%rdi
mov    $0x1,%esi
call   1040 <printf@plt>
lea    0xf10(%rip),%rdi
xor    %esi,%esi
call   1040 <printf@plt>
movsd  0xe82(%rip),%xmm1
movaps %xmm1,%xmm0
call   1030 <double_almost_equal@plt>
mov    %eax,%esi
lea    0xedb(%rip),%rdi
call   1040 <printf@plt>
movsd  0xe5c(%rip),%xmm0
movsd  0xe5c(%rip),%xmm1
call   1030 <double_almost_equal@plt>
mov    %eax,%esi
lea    0xecd(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1040 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x1,%esi
call   1040 <printf@plt>
lea    0xee2(%rip),%rdi
xor    %esi,%esi
call   1040 <printf@plt>
lea    0xf17(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <printf@plt>
lea    0xf18(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <printf@plt>
movsd  0xe7f(%rip),%xmm0
movaps %xmm0,%xmm1
call   1030 <double_almost_equal@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
movsd  0xe6d(%rip),%xmm0
movsd  0xe5d(%rip),%xmm1
call   1030 <double_almost_equal@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"1.0 = %.16f\0A\00"
@.str.1 = [18 x i8] c"0.1 * 10 = %.16f\0A\00"
@.str.2 = [67 x i8] c"0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 = %.16f\0A\00"
@.str.3 = [21 x i8] c"0.1 * 10 == 1.0? %d\0A\00"
@.str.4 = [70 x i8] c"0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 == 1.0? %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 1)
%4 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0), i32 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 1)
%6 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.4, i64 0, i64 0), i32 0)
%7 = call i32 @double_almost_equal(double 1.000000e+00, double 1.000000e+00)
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = call i32 @double_almost_equal(double 0x3FEFFFFFFFFFFFFF, double 1.000000e+00)
%10 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.4, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"1.0 = %.16f\0A\00"
@.str.1 = [18 x i8] c"0.1 * 10 = %.16f\0A\00"
@.str.2 = [67 x i8] c"0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 = %.16f\0A\00"
@.str.3 = [21 x i8] c"0.1 * 10 == 1.0? %d\0A\00"
@.str.4 = [70 x i8] c"0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 == 1.0? %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0), i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.4, i64 0, i64 0), i32 0)
%6 = tail call i32 @double_almost_equal(double 1.000000e+00, double 1.000000e+00)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %6)
%8 = tail call i32 @double_almost_equal(double 0x3FEFFFFFFFFFFFFF, double 1.000000e+00)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.4, i64 0, i64 0), i32 %8)
ret i32 0
}