#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;
  int i = 1;
  printf("Float \n");
  while (1.0 + x > 1.0) {
    x = x / 2.0;
    printf("%i. '%f' do '%e' \n", i, x, x);
    i++;
  }
  i = 0;
  double z = 1.0;
  printf("Double \n");
  while (1.0 + z > 1.0) {
    z = z / 2.0;
    printf("%i. '%lf' do '%le' \n", i, z, z);
    i++;
  }
  long double c = 1.0;
  printf("Long double \n");
  while (1.0 + c > 1.0) {
    c = c / 2.0;
    printf("%i. '%Lf' do '%Le' \n", i, c, c);
    i++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeb6(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  0xeaa(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11b7 <main+0xa7>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe97(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0xc(%rbp),%esi
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe7e(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1141 <main+0x31>
movl   $0x0,-0xc(%rbp)
movsd  0xe42(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
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    -0xc(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xe1a(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11d9 <main+0xc9>
fld1
fstpt  -0x30(%rbp)
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
fldt   -0x30(%rbp)
fld1
fadd   %st,%st(1)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    129e <main+0x18e>
jmp    1262 <main+0x152>
fldt   -0x30(%rbp)
flds   0xd99(%rip)
fdivrp %st,%st(1)
fstpt  -0x30(%rbp)
mov    -0xc(%rbp),%esi
fldt   -0x30(%rbp)
fld    %st(0)
mov    %rsp,%rax
fxch   %st(1)
fstpt  0x10(%rax)
fstpt  (%rax)
lea    0xdd6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    124a <main+0x13a>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
lea    0xf27(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
movss  0xec0(%rip),%xmm0
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    0xed0(%rip),%rdi
call   1030 <puts@plt>
xor    %ebx,%ebx
movsd  0xe6d(%rip),%xmm0
lea    0xe89(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
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    $0x35,%ebx
jne    11b0 <main+0x90>
lea    0xe7f(%rip),%rdi
call   1030 <puts@plt>
mov    $0x35,%ebx
fld1
lea    0xe48(%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    $0x75,%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 = [19 x i8] c"%i. '%f' do '%e' \0A\00"
@.str.2 = [9 x i8] c"Double \0A\00"
@.str.3 = [21 x i8] c"%i. '%lf' do '%le' \0A\00"
@.str.4 = [14 x i8] c"Long double \0A\00"
@.str.5 = [21 x i8] c"%i. '%Lf' do '%Le' \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
%4 = alloca double
%5 = alloca x86_fp80
store i32 0, i32* %1
store float 1.000000e+00, float* %2
store i32 1, i32* %3
%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* %3
%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 ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %17, double %19, double %21)
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %7
25: ; preds = %7
store i32 0, i32* %3
store double 1.000000e+00, double* %4
%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* %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* %3
%35 = load double, double* %4
%36 = load double, double* %4
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %34, double %35, double %36)
%38 = load i32, i32* %3
%39 = add nsw i32 %38, 1
store i32 %39, i32* %3
br label %27
40: ; preds = %27
store x86_fp80 0xK3FFF8000000000000000, x86_fp80* %5
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
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* %3
%50 = load x86_fp80, x86_fp80* %5
%51 = load x86_fp80, x86_fp80* %5
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 %49, x86_fp80 %50, x86_fp80 %51)
%53 = load i32, i32* %3
%54 = add nsw i32 %53, 1
store i32 %54, i32* %3
br label %42
55: ; preds = %42
%56 = load i32, i32* %1
ret i32 %56
}

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