void GloballyCoupledMap_logistic_evolve(int dim, double x0[restrict dim],
                                        double x1[restrict dim], double mean,
                                        double epsilon, double r) {
  int i;
  for (i = 0; i < dim; ++i) {
    x1[i] = logistic(r, (1 - epsilon) * x0[i] + epsilon * mean);
  }
}


x86 assembly (clang, -O0):
<GloballyCoupledMap_logistic_evolve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    119c <GloballyCoupledMap_logistic_evolve+0x8c>
movsd  -0x30(%rbp),%xmm0
movsd  0xeae(%rip),%xmm1
subsd  -0x28(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  -0x28(%rbp),%xmm2
mulsd  -0x20(%rbp),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mov    $0x2,%al
call   1030 <logistic@plt>
cvtsi2sd %eax,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1139 <GloballyCoupledMap_logistic_evolve+0x29>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GloballyCoupledMap_logistic_evolve>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
movsd  %xmm0,(%rsp)
test   %edi,%edi
jle    1197 <GloballyCoupledMap_logistic_evolve+0x87>
mov    %rdx,%r14
mov    %rsi,%r15
movsd  0xece(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
mov    %edi,%r12d
xor    %ebx,%ebx
movsd  %xmm2,0x10(%rsp)
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%r15,%rbx,8),%xmm1
mulsd  0x8(%rsp),%xmm1
addsd  (%rsp),%xmm1
movaps %xmm2,%xmm0
mov    $0x2,%al
call   1030 <logistic@plt>
movsd  0x10(%rsp),%xmm2
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1160 <GloballyCoupledMap_logistic_evolve+0x50>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @GloballyCoupledMap_logistic_evolve(i32 %0, double* noalias %1, double* noalias %2, double %3, double %4, double %5) {
%7 = alloca i32
%8 = alloca double*
%9 = alloca double*
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca i32
store i32 %0, i32* %7
store double* %1, double** %8
store double* %2, double** %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%14 = load i32, i32* %7
%15 = zext i32 %14 to i64
%16 = load i32, i32* %7
%17 = zext i32 %16 to i64
store i32 0, i32* %13
br label %18
18: ; preds = %41, %6
%19 = load i32, i32* %13
%20 = load i32, i32* %7
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %44
22: ; preds = %18
%23 = load double, double* %12
%24 = load double, double* %11
%25 = fsub double 1.000000e+00, %24
%26 = load double*, double** %8
%27 = load i32, i32* %13
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds double, double* %26, i64 %28
%30 = load double, double* %29
%31 = load double, double* %11
%32 = load double, double* %10
%33 = fmul double %31, %32
%34 = call double @llvm.fmuladd.f64(double %25, double %30, double %33)
%35 = call i32 (double, double, ...) bitcast (i32 (...)* @logistic to i32 (double, double, ...)*)(double %23, double %34)
%36 = sitofp i32 %35 to double
%37 = load double*, double** %9
%38 = load i32, i32* %13
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %37, i64 %39
store double %36, double* %40
br label %41
41: ; preds = %22
%42 = load i32, i32* %13
%43 = add nsw i32 %42, 1
store i32 %43, i32* %13
br label %18
44: ; preds = %18
ret void
}

LLVM IR (-O2):
define void @GloballyCoupledMap_logistic_evolve(i32 %0, double* noalias nocapture %1, double* noalias nocapture writeonly %2, double %3, double %4, double %5) {
%7 = icmp sgt i32 %0, 0
br i1 %7, label %8, label %22
8: ; preds = %6
%9 = fsub double 1.000000e+00, %4
%10 = fmul double %3, %4
%11 = zext i32 %0 to i64
br label %12
12: ; preds = %8, %12
%13 = phi i64 [ 0, %8 ], [ %20, %12 ]
%14 = getelementptr inbounds double, double* %1, i64 %13
%15 = load double, double* %14
%16 = tail call double @llvm.fmuladd.f64(double %9, double %15, double %10)
%17 = tail call i32 (double, double, ...) bitcast (i32 (...)* @logistic to i32 (double, double, ...)*)(double %5, double %16)
%18 = sitofp i32 %17 to double
%19 = getelementptr inbounds double, double* %2, i64 %13
store double %18, double* %19
%20 = add nuw nsw i64 %13, 1
%21 = icmp eq i64 %20, %11
br i1 %21, label %22, label %12
22: ; preds = %12, %6
ret void
}