#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 */
double FLT_EPSILON;
double fabs(double);
int /*<<< orphan*/ printf(char *, double, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n = 0;
  int i = 0;
  int ind = 0;
  float x = 0;
  double h = 0;
  double z = 0;
  double err = 0;
  scanf("%d", &n);
  if (n <= 0)
    return 0;
  printf("# FLT_EPSILON = %+.10e \n\n", FLT_EPSILON);
  h = (8.e0 - 1.e0) / n;
  for (i = 0; i <= n; i++) {
    z = 1.e0 + i * h;
    x = z;
    err = (x - z) / z;
    ind = 0;
    if (fabs(err) > FLT_EPSILON)
      ind = 1;
    printf(" %+.6le %+6le %3d \n", z, err, ind);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    0xeb5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jg     118a <main+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    1270 <main+0x150>
mov    0x2e4f(%rip),%rax
movsd  (%rax),%xmm0
lea    0xe87(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xe50(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1269 <main+0x149>
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe26(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
subsd  -0x28(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x10(%rbp)
movsd  -0x30(%rbp),%xmm0
movaps 0xdec(%rip),%xmm1
pand   %xmm1,%xmm0
mov    0x2db1(%rip),%rax
ucomisd (%rax),%xmm0
jbe    1240 <main+0x120>
movl   $0x1,-0x10(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
mov    -0x10(%rbp),%esi
lea    0xdea(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11c0 <main+0xa0>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0x4(%rsp)
lea    0xee9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    11f2 <main+0xd2>
mov    0x2e8d(%rip),%r14
movsd  (%r14),%xmm0
lea    0xec4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
js     11f2 <main+0xd2>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xe7f(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
mov    $0xffffffff,%ebp
lea    0xea7(%rip),%rbx
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebp
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0xe50(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
cvtss2sd %xmm1,%xmm1
subsd  %xmm0,%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm2
andpd  0xe39(%rip),%xmm2
xor    %esi,%esi
ucomisd (%r14),%xmm2
seta   %sil
mov    %rbx,%rdi
mov    $0x2,%al
call   1030 <printf@plt>
cmp    0x4(%rsp),%ebp
jl     11a0 <main+0x80>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [27 x i8] c"# FLT_EPSILON = %+.10e\C2\A0\0A\0A\00"
@FLT_EPSILON = global double 0.000000e+00
@.str.2 = [20 x i8] c" %+.6le %+6le %3d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 1
br i1 %5, label %29, label %6
6: ; preds = %0
%7 = load double, double* @FLT_EPSILON
%8 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), double %7)
%9 = load i32, i32* %1
%10 = sitofp i32 %9 to double
%11 = fdiv double 7.000000e+00, %10
%12 = icmp slt i32 %9, 0
br i1 %12, label %29, label %13
13: ; preds = %6, %13
%14 = phi i32 [ %26, %13 ], [ 0, %6 ]
%15 = sitofp i32 %14 to double
%16 = call double @llvm.fmuladd.f64(double %15, double %11, double 1.000000e+00)
%17 = fptrunc double %16 to float
%18 = fpext float %17 to double
%19 = fsub double %18, %16
%20 = fdiv double %19, %16
%21 = call double @llvm.fabs.f64(double %20)
%22 = load double, double* @FLT_EPSILON
%23 = fcmp ogt double %21, %22
%24 = zext i1 %23 to i32
%25 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %16, double %20, i32 %24)
%26 = add nuw nsw i32 %14, 1
%27 = load i32, i32* %1
%28 = icmp slt i32 %14, %27
br i1 %28, label %13, label %29
29: ; preds = %13, %6, %0
ret i32 0
}