#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, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  int i = 0;
  double N[101], X;
  scanf(" %lf", &X);
  while (i < 100) {
    printf("N[%d] = %0.4lf\n", i, X);
    X /= 2;
    i++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec8(%rip),%rdi
lea    -0x338(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x64,-0x8(%rbp)
jge    1197 <main+0x77>
mov    -0x8(%rbp),%esi
movsd  -0x338(%rbp),%xmm0
ff
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x338(%rbp),%xmm0
ff
movsd  0xe83(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x338(%rbp)
ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114c <main+0x2c>
mov    -0x4(%rbp),%eax
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xedd(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
xor    %ebx,%ebx
movsd  (%rsp),%xmm0
lea    0xecc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
mulsd  0xe99(%rip),%xmm0
movsd  %xmm0,(%rsp)
add    $0x1,%ebx
cmp    $0x64,%ebx
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c" %lf\00"
@.str.1 = [16 x i8] c"N[%d] = %0.4lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [101 x double]
%4 = alloca double
store i32 0, i32* %1
store i32 0, i32* %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double* %4)
br label %6
6: ; preds = %9, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 100
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = load i32, i32* %2
%11 = load double, double* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %10, double %11)
%13 = load double, double* %4
%14 = fdiv double %13, 2.000000e+00
store double %14, double* %4
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %6
17: ; preds = %6
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@.str = [5 x i8] c" %lf\00"
@.str.1 = [16 x i8] c"N[%d] = %0.4lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
br label %5
5: ; preds = %0, %5
%6 = phi double [ %4, %0 ], [ %10, %5 ]
%7 = phi i32 [ 0, %0 ], [ %11, %5 ]
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %7, double %6)
%9 = load double, double* %1
%10 = fmul double %9, 5.000000e-01
store double %10, double* %1
%11 = add nuw nsw i32 %7, 1
%12 = icmp eq i32 %11, 100
br i1 %12, label %13, label %5
13: ; preds = %5
ret i32 0
}