#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;
  double x, N[100];
  scanf("%lf", &x);
  N[0] = x;
  for (i = 1; i < 100; i++)
    N[i] = N[i - 1] / 2;
  for (i = 0; i < 100; i++)
    printf("N[%d] = %.4f\n", i, N[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x330,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecf(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x330(%rbp)
ff
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1198 <main+0x78>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x330(%rbp,%rax,8),%xmm0
ff ff
movsd  0xe87(%rip),%xmm1
divsd  %xmm1,%xmm0
movslq -0x8(%rbp),%rax
movsd  %xmm0,-0x330(%rbp,%rax,8)
ff ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1156 <main+0x36>
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    11d3 <main+0xb3>
mov    -0x8(%rbp),%esi
movslq -0x8(%rbp),%rax
movsd  -0x330(%rbp,%rax,8),%xmm0
ff ff
lea    0xe4c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    119f <main+0x7f>
xor    %eax,%eax
add    $0x330,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x338,%rsp
lea    0xed7(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    $0x3,%eax
movsd  0xeac(%rip),%xmm1
movapd %xmm0,%xmm2
nopl   0x0(%rax,%rax,1)
mulsd  %xmm1,%xmm2
movsd  %xmm2,(%rsp,%rax,8)
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rsp,%rax,8)
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x10(%rsp,%rax,8)
add    $0x3,%rax
cmp    $0x66,%rax
jne    1160 <main+0x40>
lea    0xe7e(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    $0x1,%ebx
nopl   (%rax)
movsd  0x10(%rsp,%rbx,8),%xmm0
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    $0x64,%rbx
jne    11a0 <main+0x80>
xor    %eax,%eax
add    $0x338,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [14 x i8] c"N[%d] = %.4f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca [100 x double]
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%6 = load double, double* %3
%7 = getelementptr inbounds [100 x double], [100 x double]* %4, i64 0, i64 0
store double %6, double* %7
store i32 1, i32* %2
br label %8
8: ; preds = %21, %0
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 100
br i1 %10, label %11, label %24
11: ; preds = %8
%12 = load i32, i32* %2
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [100 x double], [100 x double]* %4, i64 0, i64 %14
%16 = load double, double* %15
%17 = fdiv double %16, 2.000000e+00
%18 = load i32, i32* %2
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [100 x double], [100 x double]* %4, i64 0, i64 %19
store double %17, double* %20
br label %21
21: ; preds = %11
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %8
24: ; preds = %8
store i32 0, i32* %2
br label %25
25: ; preds = %35, %24
%26 = load i32, i32* %2
%27 = icmp slt i32 %26, 100
br i1 %27, label %28, label %38
28: ; preds = %25
%29 = load i32, i32* %2
%30 = load i32, i32* %2
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [100 x double], [100 x double]* %4, i64 0, i64 %31
%33 = load double, double* %32
%34 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %29, double %33)
br label %35
35: ; preds = %28
%36 = load i32, i32* %2
%37 = add nsw i32 %36, 1
store i32 %37, i32* %2
br label %25
38: ; preds = %25
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [14 x i8] c"N[%d] = %.4f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca [100 x double]
%3 = bitcast double* %1 to i8*
%4 = bitcast [100 x double]* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%6 = load double, double* %1
%7 = getelementptr inbounds [100 x double], [100 x double]* %2, i64 0, i64 0
store double %6, double* %7
br label %8
8: ; preds = %8, %0
%9 = phi double [ %6, %0 ], [ %17, %8 ]
%10 = phi i64 [ 1, %0 ], [ %19, %8 ]
%11 = fmul double %9, 5.000000e-01
%12 = getelementptr inbounds [100 x double], [100 x double]* %2, i64 0, i64 %10
store double %11, double* %12
%13 = add nuw nsw i64 %10, 1
%14 = fmul double %11, 5.000000e-01
%15 = getelementptr inbounds [100 x double], [100 x double]* %2, i64 0, i64 %13
store double %14, double* %15
%16 = add nuw nsw i64 %10, 2
%17 = fmul double %14, 5.000000e-01
%18 = getelementptr inbounds [100 x double], [100 x double]* %2, i64 0, i64 %16
store double %17, double* %18
%19 = add nuw nsw i64 %10, 3
%20 = icmp eq i64 %19, 100
br i1 %20, label %21, label %8
21: ; preds = %8
%22 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 0, double %6)
br label %23
23: ; preds = %21, %23
%24 = phi i64 [ 1, %21 ], [ %29, %23 ]
%25 = getelementptr inbounds [100 x double], [100 x double]* %2, i64 0, i64 %24
%26 = load double, double* %25
%27 = trunc i64 %24 to i32
%28 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %27, double %26)
%29 = add nuw nsw i64 %24, 1
%30 = icmp eq i64 %29, 100
br i1 %30, label %31, label %23
31: ; preds = %23
ret i32 0
}