#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 *, double);
int /*<<< orphan*/ scanf(char *, double *);
main() {
  double new[1000];
  int i;
  for (i = 0; i < 1000; ++i) {
    new[i] = 0;
  }
  double r;
  scanf("%lf", &new[0]);
  scanf("%lf", &r);
  for (i = 0; i < 1000 - 1; ++i) {
    new[i + 1] = r *new[i] * (1 - new[i]);
  }
  for (i = 0; i < 1000 - 1; ++i) {
    printf("%lf ", new[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1f54(%rbp)
cmpl   $0x3e8,-0x1f54(%rbp)
jge    1173 <main+0x53>
movslq -0x1f54(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x1f50(%rbp,%rax,8)
ff ff
mov    -0x1f54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1f54(%rbp)
jmp    113c <main+0x1c>
lea    -0x1f50(%rbp),%rsi
lea    0xe87(%rip),%rdi
call   1040 <scanf@plt>
lea    0xe7b(%rip),%rdi
lea    -0x1f60(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x1f54(%rbp)
cmpl   $0x3e7,-0x1f54(%rbp)
jge    120f <main+0xef>
movsd  -0x1f60(%rbp),%xmm0
ff
movslq -0x1f54(%rbp),%rax
mulsd  -0x1f50(%rbp,%rax,8),%xmm0
ff ff
movslq -0x1f54(%rbp),%rax
movsd  0xe26(%rip),%xmm1
subsd  -0x1f50(%rbp,%rax,8),%xmm1
ff ff
mulsd  %xmm1,%xmm0
mov    -0x1f54(%rbp),%eax
add    $0x1,%eax
cltq
movsd  %xmm0,-0x1f50(%rbp,%rax,8)
ff ff
mov    -0x1f54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1f54(%rbp)
jmp    11a3 <main+0x83>
movl   $0x0,-0x1f54(%rbp)
cmpl   $0x3e7,-0x1f54(%rbp)
jge    1259 <main+0x139>
movslq -0x1f54(%rbp),%rax
movsd  -0x1f50(%rbp,%rax,8),%xmm0
ff ff
lea    0xdcc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1f54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1f54(%rbp)
jmp    1219 <main+0xf9>
mov    -0x4(%rbp),%eax
add    $0x1f60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x1f58,%rsp
lea    0x10(%rsp),%r14
mov    $0x1f40,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
lea    0xeb3(%rip),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movsd  0x8(%rsp),%xmm0
mov    $0x3,%eax
movsd  0x10(%rsp),%xmm2
movsd  0xe7a(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
movapd %xmm0,%xmm3
mulsd  %xmm2,%xmm3
movapd %xmm1,%xmm4
subsd  %xmm2,%xmm4
mulsd  %xmm3,%xmm4
movsd  %xmm4,(%rsp,%rax,8)
movapd %xmm0,%xmm2
mulsd  %xmm4,%xmm2
movapd %xmm1,%xmm3
subsd  %xmm4,%xmm3
mulsd  %xmm2,%xmm3
movsd  %xmm3,0x8(%rsp,%rax,8)
movapd %xmm0,%xmm4
mulsd  %xmm3,%xmm4
movapd %xmm1,%xmm2
subsd  %xmm3,%xmm2
mulsd  %xmm4,%xmm2
movsd  %xmm2,0x10(%rsp,%rax,8)
add    $0x3,%rax
cmp    $0x3ea,%rax
jne    1190 <main+0x60>
xor    %ebx,%ebx
lea    0xe1a(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  0x10(%rsp,%rbx,8),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    $0x3e7,%rbx
jne    1200 <main+0xd0>
xor    %eax,%eax
add    $0x1f58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [5 x i8] c"%lf \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x double]
%3 = alloca i32
%4 = alloca double
store i32 0, i32* %1
store i32 0, i32* %3
br label %5
5: ; preds = %12, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 1000
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [1000 x double], [1000 x double]* %2, i64 0, i64 %10
store double 0.000000e+00, double* %11
br label %12
12: ; preds = %8
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %5
15: ; preds = %5
%16 = getelementptr inbounds [1000 x double], [1000 x double]* %2, i64 0, i64 0
%17 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %16)
%18 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %4)
store i32 0, i32* %3
br label %19
19: ; preds = %39, %15
%20 = load i32, i32* %3
%21 = icmp slt i32 %20, 999
br i1 %21, label %22, label %42
22: ; preds = %19
%23 = load double, double* %4
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [1000 x double], [1000 x double]* %2, i64 0, i64 %25
%27 = load double, double* %26
%28 = fmul double %23, %27
%29 = load i32, i32* %3
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [1000 x double], [1000 x double]* %2, i64 0, i64 %30
%32 = load double, double* %31
%33 = fsub double 1.000000e+00, %32
%34 = fmul double %28, %33
%35 = load i32, i32* %3
%36 = add nsw i32 %35, 1
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [1000 x double], [1000 x double]* %2, i64 0, i64 %37
store double %34, double* %38
br label %39
39: ; preds = %22
%40 = load i32, i32* %3
%41 = add nsw i32 %40, 1
store i32 %41, i32* %3
br label %19
42: ; preds = %19
store i32 0, i32* %3
br label %43
43: ; preds = %52, %42
%44 = load i32, i32* %3
%45 = icmp slt i32 %44, 999
br i1 %45, label %46, label %55
46: ; preds = %43
%47 = load i32, i32* %3
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [1000 x double], [1000 x double]* %2, i64 0, i64 %48
%50 = load double, double* %49
%51 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %50)
br label %52
52: ; preds = %46
%53 = load i32, i32* %3
%54 = add nsw i32 %53, 1
store i32 %54, i32* %3
br label %43
55: ; preds = %43
%56 = load i32, i32* %1
ret i32 %56
}

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