#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__ *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(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*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
void get_diff(double *neinaa, double *neincc, double *x, double *y, double *z,
              double *chg, int ncol, int nlns, int nrestart, double dr,
              double rstart, int rnum, double *cell) {
  int i, n;
  int nlns_tmp;
  int offcnt;
  double *xi, *yi, *zi;
  int offset = nlns / nrestart;
  double *tmp = (double *)malloc(nlns * sizeof(double));
  double *nrm = (double *)calloc(nlns, sizeof(double));
  nlns_tmp = nlns * rnum;
  for (i = 0; i < nlns; ++i) {
    neinaa[i] = 0.;
    neincc[i] = 0.;
  }
  for (n = 0; n < nrestart; ++n) {
    offcnt = n * offset;
    nlns_tmp = nlns - offcnt;
    add_array_number_inplace(nrm, 1., 1, nlns_tmp);
    for (i = 0; i < ncol; ++i) {
      xi = (&(x[(nlns) * (i) + (offcnt)]));
      yi = (&(y[(nlns) * (i) + (offcnt)]));
      zi = (&(z[(nlns) * (i) + (offcnt)]));
      calculate_msd_xyz(tmp, xi, yi, zi, nlns_tmp);
      if (chg[i] < 0)
        add_arrays_inplace(neinaa, tmp, 1, nlns_tmp);
      else if (chg[i] > 0)
        add_arrays_inplace(neincc, tmp, 1, nlns_tmp);
    }
    printf(" %i / %i \r", (n + 1), nrestart);
    fflush(stdout);
  }
  printf("\n");
  double *ptr_nrm_na;
  double *ptr_nrm_nc;
  ptr_nrm_na = nrm;
  ptr_nrm_nc = nrm;
  divide_array_array_inplace(neinaa, ptr_nrm_na, 1, nlns);
  divide_array_array_inplace(neincc, ptr_nrm_nc, 1, nlns);
  free(tmp);
  free(nrm);
}


x86 assembly (clang, -O0):
<get_diff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
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    %r9,-0x30(%rbp)
movsd  %xmm0,-0x38(%rbp)
movsd  %xmm1,-0x40(%rbp)
mov    0x18(%rbp),%eax
cltd
idivl  0x20(%rbp)
mov    %eax,-0x6c(%rbp)
movslq 0x18(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x78(%rbp)
mov    0x18(%rbp),%edi
mov    $0x8,%esi
call   1070 <calloc@plt>
mov    %rax,-0x80(%rbp)
mov    0x18(%rbp),%eax
imul   0x28(%rbp),%eax
mov    %eax,-0x4c(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    0x18(%rbp),%eax
jge    1246 <get_diff+0xb6>
mov    -0x8(%rbp),%rax
movslq -0x44(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    120c <get_diff+0x7c>
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    0x20(%rbp),%eax
jge    13a9 <get_diff+0x219>
mov    -0x48(%rbp),%eax
imul   -0x6c(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    0x18(%rbp),%eax
sub    -0x50(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x80(%rbp),%rdi
mov    -0x4c(%rbp),%ecx
mov    $0x1,%edx
mov    %edx,%esi
call   10a0 <add_array_number_inplace@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    1376 <get_diff+0x1e6>
mov    -0x18(%rbp),%rax
mov    0x18(%rbp),%ecx
imul   -0x44(%rbp),%ecx
add    -0x50(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x20(%rbp),%rax
mov    0x18(%rbp),%ecx
imul   -0x44(%rbp),%ecx
add    -0x50(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x28(%rbp),%rax
mov    0x18(%rbp),%ecx
imul   -0x44(%rbp),%ecx
add    -0x50(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x68(%rbp)
mov    -0x78(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x60(%rbp),%rdx
mov    -0x68(%rbp),%rcx
mov    -0x4c(%rbp),%r8d
call   10b0 <calculate_msd_xyz@plt>
mov    -0x30(%rbp),%rax
movslq -0x44(%rbp),%rcx
xorps  %xmm0,%xmm0
ucomisd (%rax,%rcx,8),%xmm0
jbe    132f <get_diff+0x19f>
mov    -0x8(%rbp),%rdi
mov    -0x78(%rbp),%rsi
mov    -0x4c(%rbp),%ecx
mov    $0x1,%edx
call   1040 <add_arrays_inplace@plt>
jmp    1363 <get_diff+0x1d3>
mov    -0x30(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    135e <get_diff+0x1ce>
mov    -0x10(%rbp),%rdi
mov    -0x78(%rbp),%rsi
mov    -0x4c(%rbp),%ecx
mov    $0x1,%edx
call   1040 <add_arrays_inplace@plt>
jmp    1363 <get_diff+0x1d3>
jmp    1368 <get_diff+0x1d8>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1286 <get_diff+0xf6>
mov    -0x48(%rbp),%esi
add    $0x1,%esi
mov    0x20(%rbp),%edx
lea    0xc7a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2c4c(%rip),%rax
mov    (%rax),%edi
call   1090 <fflush@plt>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    124d <get_diff+0xbd>
lea    0xc5b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x80(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x80(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x88(%rbp),%rsi
mov    0x18(%rbp),%ecx
mov    $0x1,%edx
call   1050 <divide_array_array_inplace@plt>
mov    -0x10(%rbp),%rdi
mov    -0x90(%rbp),%rsi
mov    0x18(%rbp),%ecx
mov    $0x1,%edx
call   1050 <divide_array_array_inplace@plt>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
mov    -0x80(%rbp),%rdi
call   1030 <free@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_diff>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %r9,0x70(%rsp)
mov    %r8,0x38(%rsp)
mov    %rcx,0x30(%rsp)
mov    %rdx,0x28(%rsp)
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0xc0(%rsp),%ecx
mov    0xb8(%rsp),%ebp
mov    0xb0(%rsp),%eax
mov    %eax,0xc(%rsp)
mov    %ebp,%eax
cltd
mov    %ecx,0x4(%rsp)
idiv   %ecx
mov    %eax,0x8(%rsp)
lea    0x0(,%rbp,8),%edi
call   1090 <malloc@plt>
mov    %rax,0x18(%rsp)
mov    %ebp,%edi
mov    $0x8,%esi
call   1080 <calloc@plt>
mov    %rax,0x20(%rsp)
mov    %rbp,0x10(%rsp)
test   %ebp,%ebp
jle    13d8 <get_diff+0x238>
mov    0x10(%rsp),%rcx
mov    %ecx,%eax
cmp    $0x4,%ecx
jb     1243 <get_diff+0xa3>
lea    (%r14,%rax,8),%rcx
cmp    %rbx,%rcx
jbe    12e4 <get_diff+0x144>
lea    (%rbx,%rax,8),%rcx
cmp    %r14,%rcx
jbe    12e4 <get_diff+0x144>
xor    %ecx,%ecx
mov    %rcx,%rdx
not    %rdx
add    %rax,%rdx
mov    %rax,%rsi
and    $0x3,%rsi
je     127a <get_diff+0xda>
nopw   0x0(%rax,%rax,1)
movq   $0x0,(%rbx,%rcx,8)
movq   $0x0,(%r14,%rcx,8)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rsi
jne    1260 <get_diff+0xc0>
cmp    $0x3,%rdx
jb     13d8 <get_diff+0x238>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movq   $0x0,(%rbx,%rcx,8)
movq   $0x0,(%r14,%rcx,8)
movq   $0x0,0x8(%rbx,%rcx,8)
movq   $0x0,0x8(%r14,%rcx,8)
movq   $0x0,0x10(%rbx,%rcx,8)
movq   $0x0,0x10(%r14,%rcx,8)
movq   $0x0,0x18(%rbx,%rcx,8)
movq   $0x0,0x18(%r14,%rcx,8)
add    $0x4,%rcx
cmp    %rcx,%rax
jne    1290 <get_diff+0xf0>
jmp    13d8 <get_diff+0x238>
mov    %eax,%ecx
and    $0xfffffffc,%ecx
lea    -0x4(%rcx),%rdi
mov    %rdi,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
mov    %esi,%edx
and    $0x3,%edx
cmp    $0xc,%rdi
jae    130a <get_diff+0x16a>
xor    %edi,%edi
jmp    1390 <get_diff+0x1f0>
and    $0xfffffffffffffffc,%rsi
xor    %edi,%edi
xorpd  %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movupd %xmm0,(%rbx,%rdi,8)
movupd %xmm0,0x10(%rbx,%rdi,8)
movupd %xmm0,(%r14,%rdi,8)
movupd %xmm0,0x10(%r14,%rdi,8)
movupd %xmm0,0x20(%rbx,%rdi,8)
movupd %xmm0,0x30(%rbx,%rdi,8)
movupd %xmm0,0x20(%r14,%rdi,8)
movupd %xmm0,0x30(%r14,%rdi,8)
movupd %xmm0,0x40(%rbx,%rdi,8)
movupd %xmm0,0x50(%rbx,%rdi,8)
movupd %xmm0,0x40(%r14,%rdi,8)
movupd %xmm0,0x50(%r14,%rdi,8)
movupd %xmm0,0x60(%rbx,%rdi,8)
movupd %xmm0,0x70(%rbx,%rdi,8)
movupd %xmm0,0x60(%r14,%rdi,8)
movupd %xmm0,0x70(%r14,%rdi,8)
add    $0x10,%rdi
add    $0xfffffffffffffffc,%rsi
jne    1320 <get_diff+0x180>
test   %rdx,%rdx
je     13cf <get_diff+0x22f>
lea    (%r14,%rdi,8),%rsi
add    $0x10,%rsi
lea    (%rbx,%rdi,8),%rdi
add    $0x10,%rdi
shl    $0x5,%rdx
xor    %ebp,%ebp
xorpd  %xmm0,%xmm0
nop
movupd %xmm0,-0x10(%rdi,%rbp,1)
movupd %xmm0,(%rdi,%rbp,1)
movupd %xmm0,-0x10(%rsi,%rbp,1)
movupd %xmm0,(%rsi,%rbp,1)
add    $0x20,%rbp
cmp    %rbp,%rdx
jne    13b0 <get_diff+0x210>
cmp    %rax,%rcx
jne    1245 <get_diff+0xa5>
mov    %rbx,0x48(%rsp)
mov    %r14,0x40(%rsp)
cmpl   $0x0,0x4(%rsp)
jle    1519 <get_diff+0x379>
movslq 0x10(%rsp),%r14
movslq 0x8(%rsp),%rax
mov    0x4(%rsp),%ecx
mov    %rcx,0x50(%rsp)
mov    0xc(%rsp),%ecx
mov    %rcx,0x68(%rsp)
shl    $0x3,%rax
mov    %rax,0x58(%rsp)
shl    $0x3,%r14
xor    %ebx,%ebx
jmp    146a <get_diff+0x2ca>
nopw   0x0(%rax,%rax,1)
mov    0x60(%rsp),%rbx
add    $0x1,%rbx
lea    0xbd8(%rip),%rdi
mov    %ebx,%esi
mov    0x4(%rsp),%edx
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x2b9c(%rip),%rax
mov    (%rax),%edi
call   10a0 <fflush@plt>
mov    0x58(%rsp),%rax
add    %rax,0x28(%rsp)
add    %rax,0x30(%rsp)
add    %rax,0x38(%rsp)
cmp    0x50(%rsp),%rbx
je     1519 <get_diff+0x379>
mov    %rbx,0x60(%rsp)
mov    %ebx,%eax
imul   0x8(%rsp),%eax
mov    0x10(%rsp),%rcx
mov    %ecx,%ebp
sub    %eax,%ebp
mov    0x20(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %ebp,%ecx
call   10b0 <add_array_number_inplace@plt>
cmpl   $0x0,0xc(%rsp)
jle    1420 <get_diff+0x280>
mov    0x38(%rsp),%r15
mov    0x30(%rsp),%r13
mov    0x28(%rsp),%r12
xor    %ebx,%ebx
jmp    14d9 <get_diff+0x339>
nop
mov    0x18(%rsp),%rsi
mov    $0x1,%edx
mov    %ebp,%ecx
call   1050 <add_arrays_inplace@plt>
add    $0x1,%rbx
add    %r14,%r12
add    %r14,%r13
add    %r14,%r15
cmp    %rbx,0x68(%rsp)
je     1420 <get_diff+0x280>
mov    0x18(%rsp),%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %r15,%rcx
mov    %ebp,%r8d
call   10c0 <calculate_msd_xyz@plt>
mov    0x70(%rsp),%rax
movsd  (%rax,%rbx,8),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
mov    0x48(%rsp),%rdi
ja     14b0 <get_diff+0x310>
ucomisd 0xaf0(%rip),%xmm0
mov    0x40(%rsp),%rdi
ja     14b0 <get_diff+0x310>
jmp    14c1 <get_diff+0x321>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    0x48(%rsp),%rdi
mov    0x20(%rsp),%rbp
mov    %rbp,%rsi
mov    $0x1,%edx
mov    0x10(%rsp),%rbx
mov    %ebx,%ecx
call   1060 <divide_array_array_inplace@plt>
mov    0x40(%rsp),%rdi
mov    %rbp,%rsi
mov    $0x1,%edx
mov    %ebx,%ecx
call   1060 <divide_array_array_inplace@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
add    $0x78,%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
@.str.1 = [2 x i8] c"\0A\00"
define void @get_diff(double* %0, double* %1, double* %2, double* %3, double* %4, double* %5, i32 %6, i32 %7, i32 %8, double %9, double %10, i32 %11, double* %12) {
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca double*
%18 = alloca double*
%19 = alloca double*
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca double
%24 = alloca double
%25 = alloca i32
%26 = alloca double*
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca double*
%32 = alloca double*
%33 = alloca double*
%34 = alloca i32
%35 = alloca double*
%36 = alloca double*
%37 = alloca double*
%38 = alloca double*
store double* %0, double** %14
store double* %1, double** %15
store double* %2, double** %16
store double* %3, double** %17
store double* %4, double** %18
store double* %5, double** %19
store i32 %6, i32* %20
store i32 %7, i32* %21
store i32 %8, i32* %22
store double %9, double* %23
store double %10, double* %24
store i32 %11, i32* %25
store double* %12, double** %26
%39 = load i32, i32* %21
%40 = load i32, i32* %22
%41 = sdiv i32 %39, %40
store i32 %41, i32* %34
%42 = load i32, i32* %21
%43 = sext i32 %42 to i64
%44 = mul i64 %43, 8
%45 = trunc i64 %44 to i32
%46 = call i64 @malloc(i32 %45)
%47 = inttoptr i64 %46 to double*
store double* %47, double** %35
%48 = load i32, i32* %21
%49 = call i64 @calloc(i32 %48, i32 8)
%50 = inttoptr i64 %49 to double*
store double* %50, double** %36
%51 = load i32, i32* %21
%52 = load i32, i32* %25
%53 = mul nsw i32 %51, %52
store i32 %53, i32* %29
store i32 0, i32* %27
br label %54
54: ; preds = %67, %13
%55 = load i32, i32* %27
%56 = load i32, i32* %21
%57 = icmp slt i32 %55, %56
br i1 %57, label %58, label %70
58: ; preds = %54
%59 = load double*, double** %14
%60 = load i32, i32* %27
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds double, double* %59, i64 %61
store double 0.000000e+00, double* %62
%63 = load double*, double** %15
%64 = load i32, i32* %27
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds double, double* %63, i64 %65
store double 0.000000e+00, double* %66
br label %67
67: ; preds = %58
%68 = load i32, i32* %27
%69 = add nsw i32 %68, 1
store i32 %69, i32* %27
br label %54
70: ; preds = %54
store i32 0, i32* %28
br label %71
71: ; preds = %155, %70
%72 = load i32, i32* %28
%73 = load i32, i32* %22
%74 = icmp slt i32 %72, %73
br i1 %74, label %75, label %158
75: ; preds = %71
%76 = load i32, i32* %28
%77 = load i32, i32* %34
%78 = mul nsw i32 %76, %77
store i32 %78, i32* %30
%79 = load i32, i32* %21
%80 = load i32, i32* %30
%81 = sub nsw i32 %79, %80
store i32 %81, i32* %29
%82 = load double*, double** %36
%83 = load i32, i32* %29
%84 = call i32 @add_array_number_inplace(double* %82, i32 1, i32 1, i32 %83)
store i32 0, i32* %27
br label %85
85: ; preds = %145, %75
%86 = load i32, i32* %27
%87 = load i32, i32* %20
%88 = icmp slt i32 %86, %87
br i1 %88, label %89, label %148
89: ; preds = %85
%90 = load double*, double** %16
%91 = load i32, i32* %21
%92 = load i32, i32* %27
%93 = mul nsw i32 %91, %92
%94 = load i32, i32* %30
%95 = add nsw i32 %93, %94
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds double, double* %90, i64 %96
store double* %97, double** %31
%98 = load double*, double** %17
%99 = load i32, i32* %21
%100 = load i32, i32* %27
%101 = mul nsw i32 %99, %100
%102 = load i32, i32* %30
%103 = add nsw i32 %101, %102
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds double, double* %98, i64 %104
store double* %105, double** %32
%106 = load double*, double** %18
%107 = load i32, i32* %21
%108 = load i32, i32* %27
%109 = mul nsw i32 %107, %108
%110 = load i32, i32* %30
%111 = add nsw i32 %109, %110
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds double, double* %106, i64 %112
store double* %113, double** %33
%114 = load double*, double** %35
%115 = load double*, double** %31
%116 = load double*, double** %32
%117 = load double*, double** %33
%118 = load i32, i32* %29
%119 = call i32 @calculate_msd_xyz(double* %114, double* %115, double* %116, double* %117, i32 %118)
%120 = load double*, double** %19
%121 = load i32, i32* %27
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds double, double* %120, i64 %122
%124 = load double, double* %123
%125 = fcmp olt double %124, 0.000000e+00
br i1 %125, label %126, label %131
126: ; preds = %89
%127 = load double*, double** %14
%128 = load double*, double** %35
%129 = load i32, i32* %29
%130 = call i32 @add_arrays_inplace(double* %127, double* %128, i32 1, i32 %129)
br label %144
131: ; preds = %89
%132 = load double*, double** %19
%133 = load i32, i32* %27
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds double, double* %132, i64 %134
%136 = load double, double* %135
%137 = fcmp ogt double %136, 0.000000e+00
br i1 %137, label %138, label %143
138: ; preds = %131
%139 = load double*, double** %15
%140 = load double*, double** %35
%141 = load i32, i32* %29
%142 = call i32 @add_arrays_inplace(double* %139, double* %140, i32 1, i32 %141)
br label %143
143: ; preds = %138, %131
br label %144
144: ; preds = %143, %126
br label %145
145: ; preds = %144
%146 = load i32, i32* %27
%147 = add nsw i32 %146, 1
store i32 %147, i32* %27
br label %85
148: ; preds = %85
%149 = load i32, i32* %28
%150 = add nsw i32 %149, 1
%151 = load i32, i32* %22
%152 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %150, i32 %151)
%153 = load i32, i32* @stdout
%154 = call i32 @fflush(i32 %153)
br label %155
155: ; preds = %148
%156 = load i32, i32* %28
%157 = add nsw i32 %156, 1
store i32 %157, i32* %28
br label %71
158: ; preds = %71
%159 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%160 = load double*, double** %36
store double* %160, double** %37
%161 = load double*, double** %36
store double* %161, double** %38
%162 = load double*, double** %14
%163 = load double*, double** %37
%164 = load i32, i32* %21
%165 = call i32 @divide_array_array_inplace(double* %162, double* %163, i32 1, i32 %164)
%166 = load double*, double** %15
%167 = load double*, double** %38
%168 = load i32, i32* %21
%169 = call i32 @divide_array_array_inplace(double* %166, double* %167, i32 1, i32 %168)
%170 = load double*, double** %35
%171 = call i32 @free(double* %170)
%172 = load double*, double** %36
%173 = call i32 @free(double* %172)
ret void
}

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