#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 */
double dc_dmu(double, double);
void calculate_Ddcdmu(double *phi, double *mu, double (*Ddcdmu)[2]) {
  long i, j, index, index_right, index_front;
  for (i = 0; i < (100 - 1); i++) {
    for (j = 0; j < (50 - 1); j++) {
      index = i * 50 + j;
      index_right = index + 1;
      index_front = index + 50;
      Ddcdmu[index][0] = (1.0) * (0.5 / (1.0)) *
                         (phi[index_front] * (1.0 - phi[index_front]) *
                              dc_dmu(phi[index_front], mu[index_front]) +
                          phi[index] * (1.0 - phi[index]) *
                              dc_dmu(phi[index_front], mu[index_front]));
      Ddcdmu[index][1] = (1.0) * (0.5 / (1.0)) *
                         (phi[index_right] * (1.0 - phi[index_right]) *
                              dc_dmu(phi[index_right], mu[index_right]) +
                          phi[index] * (1.0 - phi[index]) *
                              dc_dmu(phi[index_right], mu[index_right]));
    }
  }
}


x86 assembly (clang, -O0):
<calculate_Ddcdmu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x63,-0x20(%rbp)
jge    1343 <calculate_Ddcdmu+0x233>
movq   $0x0,-0x28(%rbp)
cmpq   $0x31,-0x28(%rbp)
jge    132d <calculate_Ddcdmu+0x21d>
imul   $0x32,-0x20(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
add    $0x32,%rax
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsd  0xe7c(%rip),%xmm1
subsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
call   1030 <dc_dmu@plt>
movsd  %xmm0,-0x68(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  0xe2d(%rip),%xmm1
subsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
call   1030 <dc_dmu@plt>
movsd  -0x70(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xdd2(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsd  0xda6(%rip),%xmm1
subsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
call   1030 <dc_dmu@plt>
movsd  %xmm0,-0x50(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  0xd57(%rip),%xmm1
subsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
call   1030 <dc_dmu@plt>
movsd  -0x58(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xcfc(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movsd  %xmm0,0x8(%rax)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    113f <calculate_Ddcdmu+0x2f>
jmp    1332 <calculate_Ddcdmu+0x222>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <calculate_Ddcdmu+0x1c>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_Ddcdmu>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r13
add    $0x8,%r14
add    $0x8,%r15
xor    %r12d,%r12d
movsd  0xec7(%rip),%xmm1
nopl   0x0(%rax)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  0x190(%r13,%rbx,1),%xmm0
subsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  0x188(%r15,%rbx,1),%xmm1
call   1030 <dc_dmu@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x0(%r13,%rbx,1),%xmm1
movsd  0x190(%r13,%rbx,1),%xmm0
movsd  0xe6a(%rip),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rsp)
movsd  0x188(%r15,%rbx,1),%xmm1
call   1030 <dc_dmu@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  0x18(%rsp),%xmm1
addsd  %xmm0,%xmm1
mulsd  0xe37(%rip),%xmm1
movsd  %xmm1,-0x8(%r14,%rbx,2)
movsd  0x8(%r13,%rbx,1),%xmm0
movsd  0xe19(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  (%r15,%rbx,1),%xmm1
call   1030 <dc_dmu@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x0(%r13,%rbx,1),%xmm1
movsd  0x8(%r13,%rbx,1),%xmm0
movsd  0xde4(%rip),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rsp)
movsd  (%r15,%rbx,1),%xmm1
call   1030 <dc_dmu@plt>
movsd  0xdc3(%rip),%xmm1
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm2
mulsd  0x18(%rsp),%xmm2
addsd  %xmm0,%xmm2
movsd  0xdad(%rip),%xmm0
mulsd  %xmm0,%xmm2
movsd  %xmm2,(%r14,%rbx,2)
add    $0x8,%rbx
cmp    $0x188,%rbx
jne    1150 <calculate_Ddcdmu+0x40>
add    $0x1,%r12
add    $0x320,%r14
add    $0x190,%r13
add    $0x190,%r15
cmp    $0x63,%r12
jne    1140 <calculate_Ddcdmu+0x30>
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @calculate_Ddcdmu(double* %0, double* %1, [2 x double]* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca [2 x double]*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store double* %0, double** %4
store double* %1, double** %5
store [2 x double]* %2, [2 x double]** %6
store i64 0, i64* %7
br label %12
12: ; preds = %122, %3
%13 = load i64, i64* %7
%14 = icmp slt i64 %13, 99
br i1 %14, label %15, label %125
15: ; preds = %12
store i64 0, i64* %8
br label %16
16: ; preds = %118, %15
%17 = load i64, i64* %8
%18 = icmp slt i64 %17, 49
br i1 %18, label %19, label %121
19: ; preds = %16
%20 = load i64, i64* %7
%21 = mul nsw i64 %20, 50
%22 = load i64, i64* %8
%23 = add nsw i64 %21, %22
store i64 %23, i64* %9
%24 = load i64, i64* %9
%25 = add nsw i64 %24, 1
store i64 %25, i64* %10
%26 = load i64, i64* %9
%27 = add nsw i64 %26, 50
store i64 %27, i64* %11
%28 = load double*, double** %4
%29 = load i64, i64* %11
%30 = getelementptr inbounds double, double* %28, i64 %29
%31 = load double, double* %30
%32 = load double*, double** %4
%33 = load i64, i64* %11
%34 = getelementptr inbounds double, double* %32, i64 %33
%35 = load double, double* %34
%36 = fsub double 1.000000e+00, %35
%37 = fmul double %31, %36
%38 = load double*, double** %4
%39 = load i64, i64* %11
%40 = getelementptr inbounds double, double* %38, i64 %39
%41 = load double, double* %40
%42 = load double*, double** %5
%43 = load i64, i64* %11
%44 = getelementptr inbounds double, double* %42, i64 %43
%45 = load double, double* %44
%46 = call double @dc_dmu(double %41, double %45)
%47 = load double*, double** %4
%48 = load i64, i64* %9
%49 = getelementptr inbounds double, double* %47, i64 %48
%50 = load double, double* %49
%51 = load double*, double** %4
%52 = load i64, i64* %9
%53 = getelementptr inbounds double, double* %51, i64 %52
%54 = load double, double* %53
%55 = fsub double 1.000000e+00, %54
%56 = fmul double %50, %55
%57 = load double*, double** %4
%58 = load i64, i64* %11
%59 = getelementptr inbounds double, double* %57, i64 %58
%60 = load double, double* %59
%61 = load double*, double** %5
%62 = load i64, i64* %11
%63 = getelementptr inbounds double, double* %61, i64 %62
%64 = load double, double* %63
%65 = call double @dc_dmu(double %60, double %64)
%66 = fmul double %56, %65
%67 = call double @llvm.fmuladd.f64(double %37, double %46, double %66)
%68 = fmul double 5.000000e-01, %67
%69 = load [2 x double]*, [2 x double]** %6
%70 = load i64, i64* %9
%71 = getelementptr inbounds [2 x double], [2 x double]* %69, i64 %70
%72 = getelementptr inbounds [2 x double], [2 x double]* %71, i64 0, i64 0
store double %68, double* %72
%73 = load double*, double** %4
%74 = load i64, i64* %10
%75 = getelementptr inbounds double, double* %73, i64 %74
%76 = load double, double* %75
%77 = load double*, double** %4
%78 = load i64, i64* %10
%79 = getelementptr inbounds double, double* %77, i64 %78
%80 = load double, double* %79
%81 = fsub double 1.000000e+00, %80
%82 = fmul double %76, %81
%83 = load double*, double** %4
%84 = load i64, i64* %10
%85 = getelementptr inbounds double, double* %83, i64 %84
%86 = load double, double* %85
%87 = load double*, double** %5
%88 = load i64, i64* %10
%89 = getelementptr inbounds double, double* %87, i64 %88
%90 = load double, double* %89
%91 = call double @dc_dmu(double %86, double %90)
%92 = load double*, double** %4
%93 = load i64, i64* %9
%94 = getelementptr inbounds double, double* %92, i64 %93
%95 = load double, double* %94
%96 = load double*, double** %4
%97 = load i64, i64* %9
%98 = getelementptr inbounds double, double* %96, i64 %97
%99 = load double, double* %98
%100 = fsub double 1.000000e+00, %99
%101 = fmul double %95, %100
%102 = load double*, double** %4
%103 = load i64, i64* %10
%104 = getelementptr inbounds double, double* %102, i64 %103
%105 = load double, double* %104
%106 = load double*, double** %5
%107 = load i64, i64* %10
%108 = getelementptr inbounds double, double* %106, i64 %107
%109 = load double, double* %108
%110 = call double @dc_dmu(double %105, double %109)
%111 = fmul double %101, %110
%112 = call double @llvm.fmuladd.f64(double %82, double %91, double %111)
%113 = fmul double 5.000000e-01, %112
%114 = load [2 x double]*, [2 x double]** %6
%115 = load i64, i64* %9
%116 = getelementptr inbounds [2 x double], [2 x double]* %114, i64 %115
%117 = getelementptr inbounds [2 x double], [2 x double]* %116, i64 0, i64 1
store double %113, double* %117
br label %118
118: ; preds = %19
%119 = load i64, i64* %8
%120 = add nsw i64 %119, 1
store i64 %120, i64* %8
br label %16
121: ; preds = %16
br label %122
122: ; preds = %121
%123 = load i64, i64* %7
%124 = add nsw i64 %123, 1
store i64 %124, i64* %7
br label %12
125: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @calculate_Ddcdmu(double* nocapture %0, double* nocapture %1, [2 x double]* nocapture writeonly %2) {
br label %4
4: ; preds = %3, %49
%5 = phi i64 [ 0, %3 ], [ %50, %49 ]
%6 = mul nuw nsw i64 %5, 50
br label %7
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %47, %7 ]
%9 = add nuw nsw i64 %8, %6
%10 = add nuw nsw i64 %9, 1
%11 = add nuw nsw i64 %9, 50
%12 = getelementptr inbounds double, double* %0, i64 %11
%13 = load double, double* %12
%14 = fsub double 1.000000e+00, %13
%15 = fmul double %13, %14
%16 = getelementptr inbounds double, double* %1, i64 %11
%17 = load double, double* %16
%18 = tail call double @dc_dmu(double %13, double %17)
%19 = getelementptr inbounds double, double* %0, i64 %9
%20 = load double, double* %19
%21 = fsub double 1.000000e+00, %20
%22 = fmul double %20, %21
%23 = load double, double* %12
%24 = load double, double* %16
%25 = tail call double @dc_dmu(double %23, double %24)
%26 = fmul double %22, %25
%27 = tail call double @llvm.fmuladd.f64(double %15, double %18, double %26)
%28 = fmul double %27, 5.000000e-01
%29 = getelementptr inbounds [2 x double], [2 x double]* %2, i64 %9, i64 0
store double %28, double* %29
%30 = getelementptr inbounds double, double* %0, i64 %10
%31 = load double, double* %30
%32 = fsub double 1.000000e+00, %31
%33 = fmul double %31, %32
%34 = getelementptr inbounds double, double* %1, i64 %10
%35 = load double, double* %34
%36 = tail call double @dc_dmu(double %31, double %35)
%37 = load double, double* %19
%38 = fsub double 1.000000e+00, %37
%39 = fmul double %37, %38
%40 = load double, double* %30
%41 = load double, double* %34
%42 = tail call double @dc_dmu(double %40, double %41)
%43 = fmul double %39, %42
%44 = tail call double @llvm.fmuladd.f64(double %33, double %36, double %43)
%45 = fmul double %44, 5.000000e-01
%46 = getelementptr inbounds [2 x double], [2 x double]* %2, i64 %9, i64 1
store double %45, double* %46
%47 = add nuw nsw i64 %8, 1
%48 = icmp eq i64 %47, 49
br i1 %48, label %49, label %7
49: ; preds = %7
%50 = add nuw nsw i64 %5, 1
%51 = icmp eq i64 %50, 99
br i1 %51, label %52, label %4
52: ; preds = %49
ret void
}