#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() {
  double n[100], x;
  int i;
  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[%i] = %.4lf\n", i, n[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecf(%rip),%rdi
lea    -0x338(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x338(%rbp),%xmm0
ff
movsd  %xmm0,-0x330(%rbp)
ff
movl   $0x1,-0x33c(%rbp)
cmpl   $0x64,-0x33c(%rbp)
jge    11b0 <main+0x90>
mov    -0x33c(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x330(%rbp,%rax,8),%xmm0
ff ff
movsd  0xe78(%rip),%xmm1
divsd  %xmm1,%xmm0
movslq -0x33c(%rbp),%rax
movsd  %xmm0,-0x330(%rbp,%rax,8)
ff ff
mov    -0x33c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x33c(%rbp)
jmp    115f <main+0x3f>
movl   $0x0,-0x33c(%rbp)
cmpl   $0x64,-0x33c(%rbp)
jge    11fd <main+0xdd>
mov    -0x33c(%rbp),%esi
movslq -0x33c(%rbp),%rax
movsd  -0x330(%rbp,%rax,8),%xmm0
ff ff
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
mov    -0x33c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x33c(%rbp)
jmp    11ba <main+0x9a>
xor    %eax,%eax
add    $0x340,%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 = [15 x i8] c"N[%i] = %.4lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x double]
%3 = alloca double
%4 = alloca i32
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]* %2, i64 0, i64 0
store double %6, double* %7
store i32 1, i32* %4
br label %8
8: ; preds = %21, %0
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 100
br i1 %10, label %11, label %24
11: ; preds = %8
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [100 x double], [100 x double]* %2, i64 0, i64 %14
%16 = load double, double* %15
%17 = fdiv double %16, 2.000000e+00
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [100 x double], [100 x double]* %2, i64 0, i64 %19
store double %17, double* %20
br label %21
21: ; preds = %11
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %8
24: ; preds = %8
store i32 0, i32* %4
br label %25
25: ; preds = %35, %24
%26 = load i32, i32* %4
%27 = icmp slt i32 %26, 100
br i1 %27, label %28, label %38
28: ; preds = %25
%29 = load i32, i32* %4
%30 = load i32, i32* %4
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [100 x double], [100 x double]* %2, i64 0, i64 %31
%33 = load double, double* %32
%34 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %29, double %33)
br label %35
35: ; preds = %28
%36 = load i32, i32* %4
%37 = add nsw i32 %36, 1
store i32 %37, i32* %4
br label %25
38: ; preds = %25
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [15 x i8] c"N[%i] = %.4lf\0A\00"
define i32 @main() {
%1 = alloca [100 x double]
%2 = alloca double
%3 = bitcast [100 x double]* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = getelementptr inbounds [100 x double], [100 x double]* %1, 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]* %1, 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]* %1, 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]* %1, 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 ([15 x i8], [15 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]* %1, i64 0, i64 %24
%26 = load double, double* %25
%27 = trunc i64 %24 to i32
%28 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 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
}