#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 */
typedef size_t nlns;
typedef scalar_t__ *j;
typedef scalar_t__ *i;

/* Variables and functions */
int /*<<< orphan*/ add_array_number_inplace(double *, int, int, int);
int /*<<< orphan*/ add_arrays_inplace(double *, double *, int, int);
int /*<<< orphan*/ calculate_msd_xyz_cross(double *, double *, double *,
                                           double *, double *, double *,
                                           double *, int);
scalar_t__ calloc(int, int);
int /*<<< orphan*/ divide_array_array_inplace(double *, double *, int, int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ multiply_array_number_inplace(double *, double, int, int);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ stdout;
void get_qflux(double *cnd, double *x, double *y, double *z, double *chg,
               int ncol, int nlns, int nrestart) {
  int i, j, r;
  int nlns_tmp;
  int offcnt;
  double scale;
  double *xi, *yi, *zi, *xj, *yj, *zj;
  int offset = nlns / nrestart;
  double *tmp = (double *)malloc(nlns * sizeof(double));
  double *nrm = (double *)calloc(nlns, sizeof(double));
  for (i = 0; i < nlns; ++i)
    cnd[i] = 0.;
  for (r = 0; r < nrestart; ++r) {
    offcnt = r * offset;
    nlns_tmp = nlns - offcnt;
    add_array_number_inplace(nrm, 1., 1, nlns_tmp);
    for (i = 0; i < ncol; ++i) {
      for (j = i; j < ncol; ++j) {
        if (i == j)
          scale = 1.;
        else
          scale = 2.;
        xi = (&(x[(nlns) * (i) + (offcnt)]));
        yi = (&(y[(nlns) * (i) + (offcnt)]));
        zi = (&(z[(nlns) * (i) + (offcnt)]));
        xj = (&(x[(nlns) * (j) + (offcnt)]));
        yj = (&(y[(nlns) * (j) + (offcnt)]));
        zj = (&(z[(nlns) * (j) + (offcnt)]));
        calculate_msd_xyz_cross(tmp, xi, yi, zi, xj, yj, zj, nlns_tmp);
        multiply_array_number_inplace(tmp, chg[i] * chg[j] * scale, 1,
                                      nlns_tmp);
        add_arrays_inplace(cnd, tmp, 1, nlns_tmp);
      }
    }
    printf(" %i / %i \r", r, nrestart);
    fflush(stdout);
  }
  divide_array_array_inplace(cnd, nrm, 1, nlns);
  free(tmp);
  free(nrm);
}


x86 assembly (clang, -O0):
<get_qflux>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    0x10(%rbp),%eax
cltd
idivl  0x18(%rbp)
mov    %eax,-0x7c(%rbp)
movslq 0x10(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x88(%rbp)
mov    0x10(%rbp),%edi
mov    $0x8,%esi
call   1080 <calloc@plt>
mov    %rax,-0x90(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    122e <get_qflux+0x8e>
mov    -0x8(%rbp),%rax
movslq -0x30(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1204 <get_qflux+0x64>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    0x18(%rbp),%eax
jge    142b <get_qflux+0x28b>
mov    -0x38(%rbp),%eax
imul   -0x7c(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    0x10(%rbp),%eax
sub    -0x40(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x90(%rbp),%rdi
mov    -0x3c(%rbp),%ecx
mov    $0x1,%edx
mov    %edx,%esi
call   10c0 <add_array_number_inplace@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    13fd <get_qflux+0x25d>
mov    -0x30(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    13ea <get_qflux+0x24a>
mov    -0x30(%rbp),%eax
cmp    -0x34(%rbp),%eax
jne    12ad <get_qflux+0x10d>
movsd  0xd65(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    12ba <get_qflux+0x11a>
movsd  0xd4b(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rbp),%ecx
imul   -0x30(%rbp),%ecx
add    -0x40(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x18(%rbp),%rax
mov    0x10(%rbp),%ecx
imul   -0x30(%rbp),%ecx
add    -0x40(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x20(%rbp),%rax
mov    0x10(%rbp),%ecx
imul   -0x30(%rbp),%ecx
add    -0x40(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rbp),%ecx
imul   -0x34(%rbp),%ecx
add    -0x40(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x68(%rbp)
mov    -0x18(%rbp),%rax
mov    0x10(%rbp),%ecx
imul   -0x34(%rbp),%ecx
add    -0x40(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x70(%rbp)
mov    -0x20(%rbp),%rax
mov    0x10(%rbp),%ecx
imul   -0x34(%rbp),%ecx
add    -0x40(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x78(%rbp)
mov    -0x88(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    -0x58(%rbp),%rdx
mov    -0x60(%rbp),%rcx
mov    -0x68(%rbp),%r8
mov    -0x70(%rbp),%r9
mov    -0x78(%rbp),%r10
mov    -0x3c(%rbp),%eax
mov    %r10,(%rsp)
mov    %eax,0x8(%rsp)
call   1070 <calculate_msd_xyz_cross@plt>
mov    -0x88(%rbp),%rdi
mov    -0x28(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  -0x48(%rbp),%xmm0
mov    -0x3c(%rbp),%edx
mov    $0x1,%esi
call   1090 <multiply_array_number_inplace@plt>
mov    -0x8(%rbp),%rdi
mov    -0x88(%rbp),%rsi
mov    -0x3c(%rbp),%ecx
mov    $0x1,%edx
call   1040 <add_arrays_inplace@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1283 <get_qflux+0xe3>
jmp    13ef <get_qflux+0x24f>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1271 <get_qflux+0xd1>
mov    -0x38(%rbp),%esi
mov    0x18(%rbp),%edx
lea    0xc06(%rip),%rdi
call   1060 <printf@plt>
mov    0x2bca(%rip),%rax
mov    (%rax),%edi
call   10b0 <fflush@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1235 <get_qflux+0x95>
mov    -0x8(%rbp),%rdi
mov    -0x90(%rbp),%rsi
mov    0x10(%rbp),%ecx
mov    $0x1,%edx
call   1050 <divide_array_array_inplace@plt>
mov    -0x88(%rbp),%rdi
call   1030 <free@plt>
mov    -0x90(%rbp),%rdi
call   1030 <free@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_qflux>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
mov    %r9d,0xc(%rsp)
mov    %r8,0x68(%rsp)
mov    %rcx,0x58(%rsp)
mov    %rdx,0x50(%rsp)
mov    %rsi,0x48(%rsp)
mov    %rdi,0x18(%rsp)
mov    0x138(%rsp),%ecx
mov    0x130(%rsp),%ebp
mov    %ebp,%eax
cltd
mov    %ecx,0x8(%rsp)
idiv   %ecx
mov    %eax,%ebx
lea    0x0(,%rbp,8),%edi
call   10b0 <malloc@plt>
mov    %rax,0x20(%rsp)
mov    %ebp,%edi
mov    $0x8,%esi
call   1090 <calloc@plt>
mov    %rax,0x28(%rsp)
test   %ebp,%ebp
jle    1230 <get_qflux+0x80>
mov    %ebp,%edx
shl    $0x3,%rdx
mov    0x18(%rsp),%rdi
xor    %esi,%esi
call   1070 <memset@plt>
cmpl   $0x0,0x8(%rsp)
jle    14ea <get_qflux+0x33a>
movslq %ebp,%rax
movslq %ebx,%rcx
mov    0x8(%rsp),%edx
mov    %rdx,0x80(%rsp)
mov    0xc(%rsp),%edx
mov    %rdx,0x60(%rsp)
mov    %rcx,0x88(%rsp)
lea    0x0(,%rcx,8),%rcx
mov    %rcx,0x78(%rsp)
mov    %rax,0xa0(%rsp)
lea    0x0(,%rax,8),%r14
xor    %ebx,%ebx
mov    0x58(%rsp),%rax
mov    %rax,0x40(%rsp)
mov    0x50(%rsp),%rax
mov    %rax,0x38(%rsp)
mov    0x48(%rsp),%rax
mov    %rax,0x30(%rsp)
mov    %rbp,0x90(%rsp)
mov    %r14,0xc8(%rsp)
jmp    1306 <get_qflux+0x156>
nopl   (%rax)
lea    0xd59(%rip),%rdi
mov    0x98(%rsp),%rbx
mov    %ebx,%esi
mov    0x8(%rsp),%edx
call   1060 <printf@plt>
mov    0x2d0f(%rip),%rax
mov    (%rax),%edi
call   10c0 <fflush@plt>
add    $0x1,%rbx
mov    0x78(%rsp),%rax
add    %rax,0x30(%rsp)
add    %rax,0x38(%rsp)
add    %rax,0x40(%rsp)
cmp    0x80(%rsp),%rbx
mov    0x90(%rsp),%rbp
je     14ea <get_qflux+0x33a>
mov    %rbx,0x98(%rsp)
imul   0x88(%rsp),%rbx
mov    %ebp,%ecx
mov    %rbx,0xa8(%rsp)
sub    %ebx,%ecx
mov    0x28(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rcx,0xd0(%rsp)
call   10d0 <add_array_number_inplace@plt>
cmpl   $0x0,0xc(%rsp)
jle    12b0 <get_qflux+0x100>
mov    0x60(%rsp),%rdx
mov    0x68(%rsp),%rax
mov    0x40(%rsp),%r15
mov    0x38(%rsp),%rbx
mov    0x30(%rsp),%r13
xor    %ecx,%ecx
mov    %rcx,0x10(%rsp)
nopw   0x0(%rax,%rax,1)
mov    %rax,0x70(%rsp)
mov    0x10(%rsp),%rax
imul   0xa0(%rsp),%rax
add    0xa8(%rsp),%rax
mov    0x48(%rsp),%rcx
lea    (%rcx,%rax,8),%rcx
mov    %rcx,0xe8(%rsp)
mov    0x50(%rsp),%rcx
lea    (%rcx,%rax,8),%rcx
mov    %rcx,0xe0(%rsp)
mov    0x58(%rsp),%rcx
lea    (%rcx,%rax,8),%rax
mov    %rax,0xd8(%rsp)
xor    %ebp,%ebp
mov    %r15,0xc0(%rsp)
mov    %rbx,0xb8(%rsp)
mov    %r13,0xb0(%rsp)
mov    %rdx,0xf0(%rsp)
xor    %r14d,%r14d
test   %rbp,%rbp
sete   %r14b
mov    0x20(%rsp),%rdi
mov    0xe8(%rsp),%rsi
mov    0xe0(%rsp),%rdx
mov    0xd8(%rsp),%rcx
mov    %r13,%r8
mov    %rbx,%r9
mov    0xd0(%rsp),%r12
push   %r12
push   %r15
call   1080 <calculate_msd_xyz_cross@plt>
add    $0x10,%rsp
mov    0x10(%rsp),%rax
mov    0x68(%rsp),%rcx
movsd  (%rcx,%rax,8),%xmm0
mov    0x70(%rsp),%rax
mulsd  (%rax,%rbp,8),%xmm0
lea    0xbbe(%rip),%rax
mulsd  (%rax,%r14,8),%xmm0
mov    0x20(%rsp),%r14
mov    %r14,%rdi
mov    $0x1,%esi
mov    %r12d,%edx
call   10a0 <multiply_array_number_inplace@plt>
mov    0x18(%rsp),%rdi
mov    %r14,%rsi
mov    0xc8(%rsp),%r14
mov    $0x1,%edx
mov    %r12d,%ecx
call   1040 <add_arrays_inplace@plt>
mov    0xf0(%rsp),%rdx
add    %r14,%r13
add    %r14,%rbx
add    %r14,%r15
add    $0x1,%rbp
cmp    %rbp,%rdx
jne    13e0 <get_qflux+0x230>
mov    0x10(%rsp),%rcx
add    $0x1,%rcx
mov    0xb0(%rsp),%r13
add    %r14,%r13
mov    0xb8(%rsp),%rbx
add    %r14,%rbx
mov    0xc0(%rsp),%r15
add    %r14,%r15
mov    0x70(%rsp),%rsi
add    $0x8,%rsi
add    $0xffffffffffffffff,%rdx
mov    %rcx,%rax
mov    %rcx,0x10(%rsp)
cmp    0x60(%rsp),%rcx
mov    %rsi,%rax
jne    1370 <get_qflux+0x1c0>
jmp    12b0 <get_qflux+0x100>
mov    0x18(%rsp),%rdi
mov    0x28(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x1,%edx
mov    %ebp,%ecx
call   1050 <divide_array_array_inplace@plt>
mov    0x20(%rsp),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [11 x i8] c" %i / %i \0D\00"
@stdout = global i32 0
define void @get_qflux(double* %0, double* %1, double* %2, double* %3, double* %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca double
%23 = alloca double*
%24 = alloca double*
%25 = alloca double*
%26 = alloca double*
%27 = alloca double*
%28 = alloca double*
%29 = alloca i32
%30 = alloca double*
%31 = alloca double*
store double* %0, double** %9
store double* %1, double** %10
store double* %2, double** %11
store double* %3, double** %12
store double* %4, double** %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%32 = load i32, i32* %15
%33 = load i32, i32* %16
%34 = sdiv i32 %32, %33
store i32 %34, i32* %29
%35 = load i32, i32* %15
%36 = sext i32 %35 to i64
%37 = mul i64 %36, 8
%38 = trunc i64 %37 to i32
%39 = call i64 @malloc(i32 %38)
%40 = inttoptr i64 %39 to double*
store double* %40, double** %30
%41 = load i32, i32* %15
%42 = call i64 @calloc(i32 %41, i32 8)
%43 = inttoptr i64 %42 to double*
store double* %43, double** %31
store i32 0, i32* %17
br label %44
44: ; preds = %53, %8
%45 = load i32, i32* %17
%46 = load i32, i32* %15
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %56
48: ; preds = %44
%49 = load double*, double** %9
%50 = load i32, i32* %17
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double, double* %49, i64 %51
store double 0.000000e+00, double* %52
br label %53
53: ; preds = %48
%54 = load i32, i32* %17
%55 = add nsw i32 %54, 1
store i32 %55, i32* %17
br label %44
56: ; preds = %44
store i32 0, i32* %19
br label %57
57: ; preds = %178, %56
%58 = load i32, i32* %19
%59 = load i32, i32* %16
%60 = icmp slt i32 %58, %59
br i1 %60, label %61, label %181
61: ; preds = %57
%62 = load i32, i32* %19
%63 = load i32, i32* %29
%64 = mul nsw i32 %62, %63
store i32 %64, i32* %21
%65 = load i32, i32* %15
%66 = load i32, i32* %21
%67 = sub nsw i32 %65, %66
store i32 %67, i32* %20
%68 = load double*, double** %31
%69 = load i32, i32* %20
%70 = call i32 @add_array_number_inplace(double* %68, i32 1, i32 1, i32 %69)
store i32 0, i32* %17
br label %71
71: ; preds = %169, %61
%72 = load i32, i32* %17
%73 = load i32, i32* %14
%74 = icmp slt i32 %72, %73
br i1 %74, label %75, label %172
75: ; preds = %71
%76 = load i32, i32* %17
store i32 %76, i32* %18
br label %77
77: ; preds = %165, %75
%78 = load i32, i32* %18
%79 = load i32, i32* %14
%80 = icmp slt i32 %78, %79
br i1 %80, label %81, label %168
81: ; preds = %77
%82 = load i32, i32* %17
%83 = load i32, i32* %18
%84 = icmp eq i32 %82, %83
br i1 %84, label %85, label %86
85: ; preds = %81
store double 1.000000e+00, double* %22
br label %87
86: ; preds = %81
store double 2.000000e+00, double* %22
br label %87
87: ; preds = %86, %85
%88 = load double*, double** %10
%89 = load i32, i32* %15
%90 = load i32, i32* %17
%91 = mul nsw i32 %89, %90
%92 = load i32, i32* %21
%93 = add nsw i32 %91, %92
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds double, double* %88, i64 %94
store double* %95, double** %23
%96 = load double*, double** %11
%97 = load i32, i32* %15
%98 = load i32, i32* %17
%99 = mul nsw i32 %97, %98
%100 = load i32, i32* %21
%101 = add nsw i32 %99, %100
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds double, double* %96, i64 %102
store double* %103, double** %24
%104 = load double*, double** %12
%105 = load i32, i32* %15
%106 = load i32, i32* %17
%107 = mul nsw i32 %105, %106
%108 = load i32, i32* %21
%109 = add nsw i32 %107, %108
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds double, double* %104, i64 %110
store double* %111, double** %25
%112 = load double*, double** %10
%113 = load i32, i32* %15
%114 = load i32, i32* %18
%115 = mul nsw i32 %113, %114
%116 = load i32, i32* %21
%117 = add nsw i32 %115, %116
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds double, double* %112, i64 %118
store double* %119, double** %26
%120 = load double*, double** %11
%121 = load i32, i32* %15
%122 = load i32, i32* %18
%123 = mul nsw i32 %121, %122
%124 = load i32, i32* %21
%125 = add nsw i32 %123, %124
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds double, double* %120, i64 %126
store double* %127, double** %27
%128 = load double*, double** %12
%129 = load i32, i32* %15
%130 = load i32, i32* %18
%131 = mul nsw i32 %129, %130
%132 = load i32, i32* %21
%133 = add nsw i32 %131, %132
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds double, double* %128, i64 %134
store double* %135, double** %28
%136 = load double*, double** %30
%137 = load double*, double** %23
%138 = load double*, double** %24
%139 = load double*, double** %25
%140 = load double*, double** %26
%141 = load double*, double** %27
%142 = load double*, double** %28
%143 = load i32, i32* %20
%144 = call i32 @calculate_msd_xyz_cross(double* %136, double* %137, double* %138, double* %139, double* %140, double* %141, double* %142, i32 %143)
%145 = load double*, double** %30
%146 = load double*, double** %13
%147 = load i32, i32* %17
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds double, double* %146, i64 %148
%150 = load double, double* %149
%151 = load double*, double** %13
%152 = load i32, i32* %18
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds double, double* %151, i64 %153
%155 = load double, double* %154
%156 = fmul double %150, %155
%157 = load double, double* %22
%158 = fmul double %156, %157
%159 = load i32, i32* %20
%160 = call i32 @multiply_array_number_inplace(double* %145, double %158, i32 1, i32 %159)
%161 = load double*, double** %9
%162 = load double*, double** %30
%163 = load i32, i32* %20
%164 = call i32 @add_arrays_inplace(double* %161, double* %162, i32 1, i32 %163)
br label %165
165: ; preds = %87
%166 = load i32, i32* %18
%167 = add nsw i32 %166, 1
store i32 %167, i32* %18
br label %77
168: ; preds = %77
br label %169
169: ; preds = %168
%170 = load i32, i32* %17
%171 = add nsw i32 %170, 1
store i32 %171, i32* %17
br label %71
172: ; preds = %71
%173 = load i32, i32* %19
%174 = load i32, i32* %16
%175 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %173, i32 %174)
%176 = load i32, i32* @stdout
%177 = call i32 @fflush(i32 %176)
br label %178
178: ; preds = %172
%179 = load i32, i32* %19
%180 = add nsw i32 %179, 1
store i32 %180, i32* %19
br label %57
181: ; preds = %57
%182 = load double*, double** %9
%183 = load double*, double** %31
%184 = load i32, i32* %15
%185 = call i32 @divide_array_array_inplace(double* %182, double* %183, i32 1, i32 %184)
%186 = load double*, double** %30
%187 = call i32 @free(double* %186)
%188 = load double*, double** %31
%189 = call i32 @free(double* %188)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c" %i / %i \0D\00"
@stdout = global i32 0
define void @get_qflux(double* %0, double* %1, double* %2, double* %3, double* nocapture %4, i32 %5, i32 %6, i32 %7) {
%9 = sdiv i32 %6, %7
%10 = shl i32 %6, 3
%11 = tail call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to double*
%13 = tail call i64 @calloc(i32 %6, i32 8)
%14 = inttoptr i64 %13 to double*
%15 = icmp sgt i32 %6, 0
br i1 %15, label %16, label %20
16: ; preds = %8
%17 = bitcast double* %0 to i8*
%18 = zext i32 %6 to i64
%19 = shl nuw nsw i64 %18, 3
br label %20
20: ; preds = %16, %8
%21 = icmp sgt i32 %7, 0
br i1 %21, label %22, label %71
22: ; preds = %20
%23 = icmp sgt i32 %5, 0
%24 = sext i32 %6 to i64
%25 = sext i32 %9 to i64
%26 = zext i32 %7 to i64
%27 = zext i32 %5 to i64
br label %28
28: ; preds = %22, %64
%29 = phi i64 [ 0, %22 ], [ %69, %64 ]
%30 = mul nsw i64 %29, %25
%31 = trunc i64 %30 to i32
%32 = sub i32 %6, %31
%33 = tail call i32 @add_array_number_inplace(double* %14, i32 1, i32 1, i32 %32)
br i1 %23, label %34, label %64
34: ; preds = %28, %61
%35 = phi i64 [ %62, %61 ], [ 0, %28 ]
%36 = mul nsw i64 %35, %24
%37 = add nsw i64 %36, %30
%38 = getelementptr inbounds double, double* %1, i64 %37
%39 = getelementptr inbounds double, double* %2, i64 %37
%40 = getelementptr inbounds double, double* %3, i64 %37
%41 = getelementptr inbounds double, double* %4, i64 %35
br label %42
42: ; preds = %34, %42
%43 = phi i64 [ %35, %34 ], [ %59, %42 ]
%44 = icmp eq i64 %35, %43
%45 = select i1 %44, double 1.000000e+00, double 2.000000e+00
%46 = mul nsw i64 %43, %24
%47 = add nsw i64 %46, %30
%48 = getelementptr inbounds double, double* %1, i64 %47
%49 = getelementptr inbounds double, double* %2, i64 %47
%50 = getelementptr inbounds double, double* %3, i64 %47
%51 = tail call i32 @calculate_msd_xyz_cross(double* %12, double* %38, double* %39, double* %40, double* %48, double* %49, double* %50, i32 %32)
%52 = load double, double* %41
%53 = getelementptr inbounds double, double* %4, i64 %43
%54 = load double, double* %53
%55 = fmul double %52, %54
%56 = fmul double %45, %55
%57 = tail call i32 @multiply_array_number_inplace(double* %12, double %56, i32 1, i32 %32)
%58 = tail call i32 @add_arrays_inplace(double* %0, double* %12, i32 1, i32 %32)
%59 = add nuw nsw i64 %43, 1
%60 = icmp eq i64 %59, %27
br i1 %60, label %61, label %42
61: ; preds = %42
%62 = add nuw nsw i64 %35, 1
%63 = icmp eq i64 %62, %27
br i1 %63, label %64, label %34
64: ; preds = %61, %28
%65 = trunc i64 %29 to i32
%66 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %65, i32 %7)
%67 = load i32, i32* @stdout
%68 = tail call i32 @fflush(i32 %67)
%69 = add nuw nsw i64 %29, 1
%70 = icmp eq i64 %69, %26
br i1 %70, label %71, label %28
71: ; preds = %64, %20
%72 = tail call i32 @divide_array_array_inplace(double* %0, double* %14, i32 1, i32 %6)
%73 = tail call i32 @free(double* %12)
%74 = tail call i32 @free(double* %14)
ret void
}