#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 main() {
  float x = 1.0;
  double x1 = 1.0;
  long double x2 = 1.0;
  int l = 1;
  printf("Float:\n");
  while (1.0 + x > 1.0) {
    x = x / 2.0;
    printf("%i. %f >> %e\n", l, x, x);
    l++;
  }
  l = 1;
  printf("Double:\n");
  while (1.0 + x1 > 1.0) {
    x1 = x1 / 2.0;
    printf("%i. %f >> %e\n", l, x1, x1);
    l++;
  }
  l = 1;
  printf("Long double:\n");
  while (1.0 + x2 > 1.0) {
    x2 = x2 / 2.0;
    printf("%i. %Lf >> %Le\n", l, x2, x2);
    l++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3f800000,-0x8(%rbp)
movabs $0x3ff0000000000000,%rax
mov    %rax,-0x10(%rbp)
fld1
fstpt  -0x20(%rbp)
movl   $0x1,-0x24(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea1(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  0xe95(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11c4 <main+0xb4>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe82(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x24(%rbp),%esi
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe6d(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    114e <main+0x3e>
movl   $0x1,-0x24(%rbp)
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  0xe1f(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xe12(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1237 <main+0x127>
movsd  -0x10(%rbp),%xmm0
movsd  0xe03(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x24(%rbp),%esi
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xdfa(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11d9 <main+0xc9>
movl   $0x1,-0x24(%rbp)
lea    0xdee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
fldt   -0x20(%rbp)
fld1
fadd   %st,%st(1)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    12a0 <main+0x190>
jmp    1264 <main+0x154>
fldt   -0x20(%rbp)
flds   0xda3(%rip)
fdivrp %st,%st(1)
fstpt  -0x20(%rbp)
mov    -0x24(%rbp),%esi
fldt   -0x20(%rbp)
fld    %st(0)
mov    %rsp,%rax
fxch   %st(1)
fstpt  0x10(%rax)
fstpt  (%rax)
lea    0xdb6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    124c <main+0x13c>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
movss  0xec5(%rip),%xmm0
mov    $0x1,%ebx
lea    0xed1(%rip),%r14
nopw   0x0(%rax,%rax,1)
mulss  0xeac(%rip),%xmm0
movss  %xmm0,0x28(%rsp)
movss  0x28(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    %ebx,%esi
movaps %xmm0,%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
movss  0x28(%rsp),%xmm0
add    $0x1,%ebx
cmp    $0x36,%ebx
jne    1150 <main+0x30>
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
movsd  0xe6f(%rip),%xmm0
mov    $0x1,%ebx
lea    0xe73(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mulsd  0xe58(%rip),%xmm0
movsd  %xmm0,0x28(%rsp)
mov    %r14,%rdi
mov    %ebx,%esi
movsd  0x28(%rsp),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0x28(%rsp),%xmm0
add    $0x1,%ebx
cmp    $0x36,%ebx
jne    11b0 <main+0x90>
lea    0xe60(%rip),%rdi
call   1030 <puts@plt>
fld1
mov    $0x1,%ebx
lea    0xe2e(%rip),%r14
nopl   0x0(%rax,%rax,1)
fmuls  0xdfe(%rip)
fld    %st(0)
fstpt  0x28(%rsp)
fld    %st(0)
fstpt  0x10(%rsp)
fstpt  (%rsp)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
fldt   0x28(%rsp)
add    $0x1,%ebx
cmp    $0x41,%ebx
jne    1200 <main+0xe0>
fstp   %st(0)
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Float:\0A\00"
@.str.1 = [14 x i8] c"%i. %f >> %e\0A\00"
@.str.2 = [9 x i8] c"Double:\0A\00"
@.str.3 = [14 x i8] c"Long double:\0A\00"
@.str.4 = [16 x i8] c"%i. %Lf >> %Le\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca double
%4 = alloca x86_fp80
%5 = alloca i32
store i32 0, i32* %1
store float 1.000000e+00, float* %2
store double 1.000000e+00, double* %3
store x86_fp80 0xK3FFF8000000000000000, x86_fp80* %4
store i32 1, i32* %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %12, %0
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = fadd double 1.000000e+00, %9
%11 = fcmp ogt double %10, 1.000000e+00
br i1 %11, label %12, label %25
12: ; preds = %7
%13 = load float, float* %2
%14 = fpext float %13 to double
%15 = fdiv double %14, 2.000000e+00
%16 = fptrunc double %15 to float
store float %16, float* %2
%17 = load i32, i32* %5
%18 = load float, float* %2
%19 = fpext float %18 to double
%20 = load float, float* %2
%21 = fpext float %20 to double
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %17, double %19, double %21)
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %7
25: ; preds = %7
store i32 1, i32* %5
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %27
27: ; preds = %31, %25
%28 = load double, double* %3
%29 = fadd double 1.000000e+00, %28
%30 = fcmp ogt double %29, 1.000000e+00
br i1 %30, label %31, label %40
31: ; preds = %27
%32 = load double, double* %3
%33 = fdiv double %32, 2.000000e+00
store double %33, double* %3
%34 = load i32, i32* %5
%35 = load double, double* %3
%36 = load double, double* %3
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %34, double %35, double %36)
%38 = load i32, i32* %5
%39 = add nsw i32 %38, 1
store i32 %39, i32* %5
br label %27
40: ; preds = %27
store i32 1, i32* %5
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %42
42: ; preds = %46, %40
%43 = load x86_fp80, x86_fp80* %4
%44 = fadd x86_fp80 0xK3FFF8000000000000000, %43
%45 = fcmp ogt x86_fp80 %44, 0xK3FFF8000000000000000
br i1 %45, label %46, label %55
46: ; preds = %42
%47 = load x86_fp80, x86_fp80* %4
%48 = fdiv x86_fp80 %47, 0xK40008000000000000000
store x86_fp80 %48, x86_fp80* %4
%49 = load i32, i32* %5
%50 = load x86_fp80, x86_fp80* %4
%51 = load x86_fp80, x86_fp80* %4
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %49, x86_fp80 %50, x86_fp80 %51)
%53 = load i32, i32* %5
%54 = add nsw i32 %53, 1
store i32 %54, i32* %5
br label %42
55: ; preds = %42
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"%i. %f >> %e\0A\00"
@.str.4 = [16 x i8] c"%i. %Lf >> %Le\0A\00"
@str = [7 x i8] c"Float:\00"
@str.5 = [8 x i8] c"Double:\00"
@str.6 = [13 x i8] c"Long double:\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 1, %0 ], [ %8, %2 ]
%4 = phi float [ 1.000000e+00, %0 ], [ %5, %2 ]
%5 = fmul float %4, 5.000000e-01
%6 = fpext float %5 to double
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %3, double %6, double %6)
%8 = add nuw nsw i32 %3, 1
%9 = icmp eq i32 %8, 54
br i1 %9, label %10, label %2
10: ; preds = %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.5, i64 0, i64 0))
br label %12
12: ; preds = %10, %12
%13 = phi i32 [ 1, %10 ], [ %17, %12 ]
%14 = phi double [ 1.000000e+00, %10 ], [ %15, %12 ]
%15 = fmul double %14, 5.000000e-01
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %13, double %15, double %15)
%17 = add nuw nsw i32 %13, 1
%18 = icmp eq i32 %17, 54
br i1 %18, label %19, label %12
19: ; preds = %12
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.6, i64 0, i64 0))
br label %21
21: ; preds = %19, %21
%22 = phi i32 [ 1, %19 ], [ %26, %21 ]
%23 = phi x86_fp80 [ 0xK3FFF8000000000000000, %19 ], [ %24, %21 ]
%24 = fmul x86_fp80 %23, 0xK3FFE8000000000000000
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %22, x86_fp80 %24, x86_fp80 %24)
%26 = add nuw nsw i32 %22, 1
%27 = icmp eq i32 %26, 65
br i1 %27, label %28, label %21
28: ; preds = %21
ret i32 0
}