#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() {
  int l = 1;
  printf("Float:\n");
  float x = 1.0;
  while (1.0 + x > 1.0) {
    x = x / 2.0;
    printf("%i. %f => %e\n", l, x, x);
    l++;
  }
  l = 1;
  printf("Double:\n");
  double x1 = 1.0;
  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");
  long double x2 = 1.0;
  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   $0x1,-0x8(%rbp)
lea    0xeeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  0xec4(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeb6(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  0xeaa(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11b7 <main+0xa7>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe97(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%esi
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe7e(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <main+0x31>
movl   $0x1,-0x8(%rbp)
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  0xe34(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe27(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xe1a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1237 <main+0x127>
movsd  -0x18(%rbp),%xmm0
movsd  0xe0b(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xdfe(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11d9 <main+0xc9>
movl   $0x1,-0x8(%rbp)
lea    0xdf2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
fld1
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
fld1
fadd   %st,%st(1)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    12a5 <main+0x195>
jmp    1269 <main+0x159>
fldt   -0x30(%rbp)
flds   0xd92(%rip)
fdivrp %st,%st(1)
fstpt  -0x30(%rbp)
mov    -0x8(%rbp),%esi
fldt   -0x30(%rbp)
fld    %st(0)
mov    %rsp,%rax
fxch   %st(1)
fstpt  0x10(%rax)
fstpt  (%rax)
lea    0xdb5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1251 <main+0x141>
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>
mov    $0x1,%ebx
fld1
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 i32
%3 = alloca float
%4 = alloca double
%5 = alloca x86_fp80
store i32 0, i32* %1
store i32 1, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store float 1.000000e+00, float* %3
br label %7
7: ; preds = %12, %0
%8 = load float, float* %3
%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* %3
%14 = fpext float %13 to double
%15 = fdiv double %14, 2.000000e+00
%16 = fptrunc double %15 to float
store float %16, float* %3
%17 = load i32, i32* %2
%18 = load float, float* %3
%19 = fpext float %18 to double
%20 = load float, float* %3
%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* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %7
25: ; preds = %7
store i32 1, i32* %2
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
store double 1.000000e+00, double* %4
br label %27
27: ; preds = %31, %25
%28 = load double, double* %4
%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* %4
%33 = fdiv double %32, 2.000000e+00
store double %33, double* %4
%34 = load i32, i32* %2
%35 = load double, double* %4
%36 = load double, double* %4
%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* %2
%39 = add nsw i32 %38, 1
store i32 %39, i32* %2
br label %27
40: ; preds = %27
store i32 1, i32* %2
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
store x86_fp80 0xK3FFF8000000000000000, x86_fp80* %5
br label %42
42: ; preds = %46, %40
%43 = load x86_fp80, x86_fp80* %5
%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* %5
%48 = fdiv x86_fp80 %47, 0xK40008000000000000000
store x86_fp80 %48, x86_fp80* %5
%49 = load i32, i32* %2
%50 = load x86_fp80, x86_fp80* %5
%51 = load x86_fp80, x86_fp80* %5
%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* %2
%54 = add nsw i32 %53, 1
store i32 %54, i32* %2
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 x86_fp80 [ 0xK3FFF8000000000000000, %19 ], [ %24, %21 ]
%23 = phi i32 [ 1, %19 ], [ %26, %21 ]
%24 = fmul x86_fp80 %22, 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 %23, x86_fp80 %24, x86_fp80 %24)
%26 = add nuw nsw i32 %23, 1
%27 = icmp eq i32 %26, 65
br i1 %27, label %28, label %21
28: ; preds = %21
ret i32 0
}