#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 */
scalar_t__ floor(double);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
double sqrt(double);
void basicRDF(int na, int *aser, int nb, int *bser, int ntot, double *coord,
              double *latt, int nbins, double binsize, double *RDF) {
  int i, j;
  int nx, ny, nz;
  double vol = latt[0] * latt[4] * latt[8];
  double tmpVec1[3], tmpVec2[3];
  double d1;
  double dens = na / vol;
  memset((void *)RDF, 0, nbins * sizeof(double));
  for (i = 0; i < na; i++) {
    for (j = 0; j < nb; j++) {
      tmpVec1[0] = coord[3 * aser[i]] - coord[3 * bser[j]];
      tmpVec1[1] = coord[3 * aser[i] + 1] - coord[3 * bser[j] + 1];
      tmpVec1[2] = coord[3 * aser[i] + 2] - coord[3 * bser[j] + 2];
      for (nx = -3; nx < 3 + 1; nx++) {
        for (ny = -3; ny < 3 + 1; ny++) {
          for (nz = -3; nz < 3 + 1; nz++) {
            tmpVec2[0] =
                tmpVec1[0] + nx * latt[0] + ny * latt[1] + nz * latt[2];
            tmpVec2[1] =
                tmpVec1[1] + nx * latt[3] + ny * latt[4] + nz * latt[5];
            tmpVec2[2] =
                tmpVec1[2] + nx * latt[6] + ny * latt[7] + nz * latt[8];
            d1 = sqrt((tmpVec2[0] * tmpVec2[0] + tmpVec2[1] * tmpVec2[1] +
                       tmpVec2[2] * tmpVec2[2]));
            if (d1 < nbins * binsize && d1 > 0.1) {
              RDF[(int)floor(d1 / binsize)] +=
                  1.00 / (4 * 3.1415926 * (d1 * d1) * binsize * dens * na);
            }
          }
        }
      }
    }
  }
  return;
}


x86 assembly (clang, -O0):
<basicRDF>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
movsd  %xmm0,-0x38(%rbp)
mov    0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    0x10(%rbp),%rax
mulsd  0x20(%rax),%xmm0
mov    0x10(%rbp),%rax
mulsd  0x40(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
divsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    0x20(%rbp),%rdi
movslq 0x18(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    14f2 <basicRDF+0x3c2>
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    14df <basicRDF+0x3af>
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
imul   $0x3,(%rcx,%rdx,4),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq -0x40(%rbp),%rdx
imul   $0x3,(%rcx,%rdx,4),%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
imul   $0x3,(%rcx,%rdx,4),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq -0x40(%rbp),%rdx
imul   $0x3,(%rcx,%rdx,4),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
imul   $0x3,(%rcx,%rdx,4),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq -0x40(%rbp),%rdx
imul   $0x3,(%rcx,%rdx,4),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
movl   $0xfffffffd,-0x44(%rbp)
cmpl   $0x4,-0x44(%rbp)
jge    14cc <basicRDF+0x39c>
movl   $0xfffffffd,-0x48(%rbp)
cmpl   $0x4,-0x48(%rbp)
jge    14b9 <basicRDF+0x389>
movl   $0xfffffffd,-0x4c(%rbp)
cmpl   $0x4,-0x4c(%rbp)
jge    14a6 <basicRDF+0x376>
movsd  -0x70(%rbp),%xmm1
cvtsi2sdl -0x44(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsi2sdl -0x48(%rbp),%xmm1
mov    0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
cvtsi2sdl -0x4c(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x68(%rbp),%xmm1
cvtsi2sdl -0x44(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  0x18(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsi2sdl -0x48(%rbp),%xmm1
mov    0x10(%rbp),%rax
movsd  0x20(%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
cvtsi2sdl -0x4c(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  0x28(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x60(%rbp),%xmm1
cvtsi2sdl -0x44(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  0x30(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsi2sdl -0x48(%rbp),%xmm1
mov    0x10(%rbp),%rax
movsd  0x38(%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
cvtsi2sdl -0x4c(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  0x40(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x90(%rbp),%xmm1
ff
movsd  -0x90(%rbp),%xmm2
ff
movsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x88(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm1
ff
cvtsi2sdl 0x18(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1493 <basicRDF+0x363>
movsd  -0x98(%rbp),%xmm0
ff
movsd  0xbf9(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1493 <basicRDF+0x363>
movsd  -0x98(%rbp),%xmm0
ff
mulsd  -0x98(%rbp),%xmm0
ff
movsd  0xbe7(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  -0x38(%rbp),%xmm1
mulsd  -0xa0(%rbp),%xmm1
ff
cvtsi2sdl -0x4(%rbp),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xbbd(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
mov    0x20(%rbp),%rax
mov    %rax,-0xa8(%rbp)
movsd  -0x98(%rbp),%xmm0
ff
divsd  -0x38(%rbp),%xmm0
call   1050 <floor@plt>
movsd  -0xb0(%rbp),%xmm0
ff
mov    %rax,%rcx
mov    -0xa8(%rbp),%rax
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    1498 <basicRDF+0x368>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    12a1 <basicRDF+0x171>
jmp    14ab <basicRDF+0x37b>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1290 <basicRDF+0x160>
jmp    14be <basicRDF+0x38e>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    127f <basicRDF+0x14f>
jmp    14d1 <basicRDF+0x3a1>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    11c1 <basicRDF+0x91>
jmp    14e4 <basicRDF+0x3b4>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11ae <basicRDF+0x7e>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basicRDF>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
movsd  %xmm0,0x30(%rsp)
mov    %r9,0x58(%rsp)
mov    %rcx,0x50(%rsp)
mov    %edx,0xc(%rsp)
mov    %rsi,0x48(%rsp)
mov    %edi,%ebx
mov    0xe0(%rsp),%rbp
mov    0xd0(%rsp),%r13
movsd  0x0(%r13),%xmm0
mulsd  0x20(%r13),%xmm0
mov    0xd8(%rsp),%r14d
mulsd  0x40(%r13),%xmm0
movsd  %xmm0,0x10(%rsp)
lea    0x0(,%r14,8),%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
test   %ebx,%ebx
jle    1479 <basicRDF+0x349>
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movsd  %xmm0,0x68(%rsp)
divsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x60(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %r14d,%xmm0
mulsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x78(%rsp)
mov    %ebx,%eax
mov    %rax,0x38(%rsp)
mov    0xc(%rsp),%eax
mov    %rax,0x40(%rsp)
xor    %eax,%eax
mov    %rax,0x18(%rsp)
jmp    120c <basicRDF+0xdc>
nopl   0x0(%rax)
mov    0x18(%rsp),%rcx
add    $0x1,%rcx
mov    %rcx,%rax
mov    %rcx,0x18(%rsp)
cmp    0x38(%rsp),%rcx
je     1479 <basicRDF+0x349>
cmpl   $0x0,0xc(%rsp)
jle    11f0 <basicRDF+0xc0>
xor    %r12d,%r12d
jmp    122b <basicRDF+0xfb>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r12
cmp    0x40(%rsp),%r12
je     11f0 <basicRDF+0xc0>
mov    0x48(%rsp),%rax
mov    0x18(%rsp),%rcx
movslq (%rax,%rcx,4),%rax
lea    (%rax,%rax,2),%rax
mov    0x58(%rsp),%rdx
movsd  (%rdx,%rax,8),%xmm0
mov    0x50(%rsp),%rcx
movslq (%rcx,%r12,4),%rcx
lea    (%rcx,%rcx,2),%rcx
subsd  (%rdx,%rcx,8),%xmm0
movsd  %xmm0,0x90(%rsp)
cltq
movsd  0x8(%rdx,%rax,8),%xmm0
movslq %ecx,%rcx
subsd  0x8(%rdx,%rcx,8),%xmm0
movsd  %xmm0,0x88(%rsp)
movsd  0x10(%rdx,%rax,8),%xmm0
subsd  0x10(%rdx,%rcx,8),%xmm0
movsd  %xmm0,0x80(%rsp)
mov    $0xfffffffd,%r15d
movsd  0xd61(%rip),%xmm0
movsd  %xmm0,0x20(%rsp)
jmp    12d2 <basicRDF+0x1a2>
nopw   0x0(%rax,%rax,1)
movsd  0x20(%rsp),%xmm0
addsd  0xd5a(%rip),%xmm0
movsd  %xmm0,0x20(%rsp)
add    $0x1,%r15d
cmp    $0x4,%r15d
je     1220 <basicRDF+0xf0>
movsd  0xd26(%rip),%xmm0
movsd  %xmm0,0x28(%rsp)
mov    $0xfffffffd,%r14d
jmp    130e <basicRDF+0x1de>
nopl   0x0(%rax,%rax,1)
movsd  0x28(%rsp),%xmm0
addsd  0xd1a(%rip),%xmm0
movsd  %xmm0,0x28(%rsp)
add    $0x1,%r14d
cmp    $0x4,%r14d
je     12b0 <basicRDF+0x180>
mov    $0x7,%ebx
movsd  0xce5(%rip),%xmm6
jmp    132d <basicRDF+0x1fd>
nopl   (%rax)
addsd  0xcf0(%rip),%xmm6
add    $0xffffffff,%ebx
je     12f0 <basicRDF+0x1c0>
movsd  0x0(%r13),%xmm0
movsd  0x20(%rsp),%xmm4
mulsd  %xmm4,%xmm0
addsd  0x90(%rsp),%xmm0
movsd  0x8(%r13),%xmm2
movsd  0x28(%rsp),%xmm5
mulsd  %xmm5,%xmm2
addsd  %xmm0,%xmm2
movsd  0x10(%r13),%xmm1
mulsd  %xmm6,%xmm1
addsd  %xmm2,%xmm1
movsd  0x18(%r13),%xmm0
mulsd  %xmm4,%xmm0
addsd  0x88(%rsp),%xmm0
movsd  0x20(%r13),%xmm2
mulsd  %xmm5,%xmm2
addsd  %xmm0,%xmm2
movsd  0x28(%r13),%xmm3
mulsd  %xmm6,%xmm3
addsd  %xmm2,%xmm3
movsd  0x30(%r13),%xmm0
mulsd  %xmm4,%xmm0
addsd  0x80(%rsp),%xmm0
movsd  0x38(%r13),%xmm2
mulsd  %xmm5,%xmm2
addsd  %xmm0,%xmm2
movsd  0x40(%r13),%xmm0
mulsd  %xmm6,%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm3,%xmm3
mulsd  %xmm1,%xmm1
addsd  %xmm3,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ucomisd 0xc3e(%rip),%xmm0
movsd  %xmm6,0x10(%rsp)
jb     13f0 <basicRDF+0x2c0>
sqrtsd %xmm0,%xmm0
jmp    13fb <basicRDF+0x2cb>
call   1040 <sqrt@plt>
movsd  0x10(%rsp),%xmm6
movsd  0x78(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jbe    1320 <basicRDF+0x1f0>
ucomisd 0xbf5(%rip),%xmm0
jbe    1320 <basicRDF+0x1f0>
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  0xbe7(%rip),%xmm1
movsd  0x30(%rsp),%xmm2
mulsd  %xmm2,%xmm1
mulsd  0x60(%rsp),%xmm1
mulsd  0x68(%rsp),%xmm1
movsd  0xbd1(%rip),%xmm3
divsd  %xmm1,%xmm3
movsd  %xmm3,0x70(%rsp)
divsd  %xmm2,%xmm0
call   1050 <floor@plt>
movsd  0x10(%rsp),%xmm6
cltq
movsd  0x70(%rsp),%xmm0
addsd  0x0(%rbp,%rax,8),%xmm0
movsd  %xmm0,0x0(%rbp,%rax,8)
jmp    1320 <basicRDF+0x1f0>
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @basicRDF(i32 %0, i32* %1, i32 %2, i32* %3, i32 %4, double* %5, double* %6, i32 %7, double %8, double* %9) {
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32*
%15 = alloca i32
%16 = alloca double*
%17 = alloca double*
%18 = alloca i32
%19 = alloca double
%20 = alloca double*
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca double
%27 = alloca [3 x double]
%28 = alloca [3 x double]
%29 = alloca double
%30 = alloca double
store i32 %0, i32* %11
store i32* %1, i32** %12
store i32 %2, i32* %13
store i32* %3, i32** %14
store i32 %4, i32* %15
store double* %5, double** %16
store double* %6, double** %17
store i32 %7, i32* %18
store double %8, double* %19
store double* %9, double** %20
%31 = load double*, double** %17
%32 = getelementptr inbounds double, double* %31, i64 0
%33 = load double, double* %32
%34 = load double*, double** %17
%35 = getelementptr inbounds double, double* %34, i64 4
%36 = load double, double* %35
%37 = fmul double %33, %36
%38 = load double*, double** %17
%39 = getelementptr inbounds double, double* %38, i64 8
%40 = load double, double* %39
%41 = fmul double %37, %40
store double %41, double* %26
%42 = load i32, i32* %11
%43 = sitofp i32 %42 to double
%44 = load double, double* %26
%45 = fdiv double %43, %44
store double %45, double* %30
%46 = load double*, double** %20
%47 = bitcast double* %46 to i8*
%48 = load i32, i32* %18
%49 = sext i32 %48 to i64
%50 = mul i64 %49, 8
%51 = trunc i64 %50 to i32
%52 = call i32 @memset(i8* %47, i32 0, i32 %51)
store i32 0, i32* %21
br label %53
53: ; preds = %273, %10
%54 = load i32, i32* %21
%55 = load i32, i32* %11
%56 = icmp slt i32 %54, %55
br i1 %56, label %57, label %276
57: ; preds = %53
store i32 0, i32* %22
br label %58
58: ; preds = %269, %57
%59 = load i32, i32* %22
%60 = load i32, i32* %13
%61 = icmp slt i32 %59, %60
br i1 %61, label %62, label %272
62: ; preds = %58
%63 = load double*, double** %16
%64 = load i32*, i32** %12
%65 = load i32, i32* %21
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i32, i32* %64, i64 %66
%68 = load i32, i32* %67
%69 = mul nsw i32 3, %68
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds double, double* %63, i64 %70
%72 = load double, double* %71
%73 = load double*, double** %16
%74 = load i32*, i32** %14
%75 = load i32, i32* %22
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i32, i32* %74, i64 %76
%78 = load i32, i32* %77
%79 = mul nsw i32 3, %78
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds double, double* %73, i64 %80
%82 = load double, double* %81
%83 = fsub double %72, %82
%84 = getelementptr inbounds [3 x double], [3 x double]* %27, i64 0, i64 0
store double %83, double* %84
%85 = load double*, double** %16
%86 = load i32*, i32** %12
%87 = load i32, i32* %21
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i32, i32* %86, i64 %88
%90 = load i32, i32* %89
%91 = mul nsw i32 3, %90
%92 = add nsw i32 %91, 1
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds double, double* %85, i64 %93
%95 = load double, double* %94
%96 = load double*, double** %16
%97 = load i32*, i32** %14
%98 = load i32, i32* %22
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds i32, i32* %97, i64 %99
%101 = load i32, i32* %100
%102 = mul nsw i32 3, %101
%103 = add nsw i32 %102, 1
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds double, double* %96, i64 %104
%106 = load double, double* %105
%107 = fsub double %95, %106
%108 = getelementptr inbounds [3 x double], [3 x double]* %27, i64 0, i64 1
store double %107, double* %108
%109 = load double*, double** %16
%110 = load i32*, i32** %12
%111 = load i32, i32* %21
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds i32, i32* %110, i64 %112
%114 = load i32, i32* %113
%115 = mul nsw i32 3, %114
%116 = add nsw i32 %115, 2
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds double, double* %109, i64 %117
%119 = load double, double* %118
%120 = load double*, double** %16
%121 = load i32*, i32** %14
%122 = load i32, i32* %22
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds i32, i32* %121, i64 %123
%125 = load i32, i32* %124
%126 = mul nsw i32 3, %125
%127 = add nsw i32 %126, 2
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds double, double* %120, i64 %128
%130 = load double, double* %129
%131 = fsub double %119, %130
%132 = getelementptr inbounds [3 x double], [3 x double]* %27, i64 0, i64 2
store double %131, double* %132
store i32 -3, i32* %23
br label %133
133: ; preds = %265, %62
%134 = load i32, i32* %23
%135 = icmp slt i32 %134, 4
br i1 %135, label %136, label %268
136: ; preds = %133
store i32 -3, i32* %24
br label %137
137: ; preds = %261, %136
%138 = load i32, i32* %24
%139 = icmp slt i32 %138, 4
br i1 %139, label %140, label %264
140: ; preds = %137
store i32 -3, i32* %25
br label %141
141: ; preds = %257, %140
%142 = load i32, i32* %25
%143 = icmp slt i32 %142, 4
br i1 %143, label %144, label %260
144: ; preds = %141
%145 = getelementptr inbounds [3 x double], [3 x double]* %27, i64 0, i64 0
%146 = load double, double* %145
%147 = load i32, i32* %23
%148 = sitofp i32 %147 to double
%149 = load double*, double** %17
%150 = getelementptr inbounds double, double* %149, i64 0
%151 = load double, double* %150
%152 = call double @llvm.fmuladd.f64(double %148, double %151, double %146)
%153 = load i32, i32* %24
%154 = sitofp i32 %153 to double
%155 = load double*, double** %17
%156 = getelementptr inbounds double, double* %155, i64 1
%157 = load double, double* %156
%158 = call double @llvm.fmuladd.f64(double %154, double %157, double %152)
%159 = load i32, i32* %25
%160 = sitofp i32 %159 to double
%161 = load double*, double** %17
%162 = getelementptr inbounds double, double* %161, i64 2
%163 = load double, double* %162
%164 = call double @llvm.fmuladd.f64(double %160, double %163, double %158)
%165 = getelementptr inbounds [3 x double], [3 x double]* %28, i64 0, i64 0
store double %164, double* %165
%166 = getelementptr inbounds [3 x double], [3 x double]* %27, i64 0, i64 1
%167 = load double, double* %166
%168 = load i32, i32* %23
%169 = sitofp i32 %168 to double
%170 = load double*, double** %17
%171 = getelementptr inbounds double, double* %170, i64 3
%172 = load double, double* %171
%173 = call double @llvm.fmuladd.f64(double %169, double %172, double %167)
%174 = load i32, i32* %24
%175 = sitofp i32 %174 to double
%176 = load double*, double** %17
%177 = getelementptr inbounds double, double* %176, i64 4
%178 = load double, double* %177
%179 = call double @llvm.fmuladd.f64(double %175, double %178, double %173)
%180 = load i32, i32* %25
%181 = sitofp i32 %180 to double
%182 = load double*, double** %17
%183 = getelementptr inbounds double, double* %182, i64 5
%184 = load double, double* %183
%185 = call double @llvm.fmuladd.f64(double %181, double %184, double %179)
%186 = getelementptr inbounds [3 x double], [3 x double]* %28, i64 0, i64 1
store double %185, double* %186
%187 = getelementptr inbounds [3 x double], [3 x double]* %27, i64 0, i64 2
%188 = load double, double* %187
%189 = load i32, i32* %23
%190 = sitofp i32 %189 to double
%191 = load double*, double** %17
%192 = getelementptr inbounds double, double* %191, i64 6
%193 = load double, double* %192
%194 = call double @llvm.fmuladd.f64(double %190, double %193, double %188)
%195 = load i32, i32* %24
%196 = sitofp i32 %195 to double
%197 = load double*, double** %17
%198 = getelementptr inbounds double, double* %197, i64 7
%199 = load double, double* %198
%200 = call double @llvm.fmuladd.f64(double %196, double %199, double %194)
%201 = load i32, i32* %25
%202 = sitofp i32 %201 to double
%203 = load double*, double** %17
%204 = getelementptr inbounds double, double* %203, i64 8
%205 = load double, double* %204
%206 = call double @llvm.fmuladd.f64(double %202, double %205, double %200)
%207 = getelementptr inbounds [3 x double], [3 x double]* %28, i64 0, i64 2
store double %206, double* %207
%208 = getelementptr inbounds [3 x double], [3 x double]* %28, i64 0, i64 0
%209 = load double, double* %208
%210 = getelementptr inbounds [3 x double], [3 x double]* %28, i64 0, i64 0
%211 = load double, double* %210
%212 = getelementptr inbounds [3 x double], [3 x double]* %28, i64 0, i64 1
%213 = load double, double* %212
%214 = getelementptr inbounds [3 x double], [3 x double]* %28, i64 0, i64 1
%215 = load double, double* %214
%216 = fmul double %213, %215
%217 = call double @llvm.fmuladd.f64(double %209, double %211, double %216)
%218 = getelementptr inbounds [3 x double], [3 x double]* %28, i64 0, i64 2
%219 = load double, double* %218
%220 = getelementptr inbounds [3 x double], [3 x double]* %28, i64 0, i64 2
%221 = load double, double* %220
%222 = call double @llvm.fmuladd.f64(double %219, double %221, double %217)
%223 = call double @sqrt(double %222)
store double %223, double* %29
%224 = load double, double* %29
%225 = load i32, i32* %18
%226 = sitofp i32 %225 to double
%227 = load double, double* %19
%228 = fmul double %226, %227
%229 = fcmp olt double %224, %228
br i1 %229, label %230, label %256
230: ; preds = %144
%231 = load double, double* %29
%232 = fcmp ogt double %231, 1.000000e-01
br i1 %232, label %233, label %256
233: ; preds = %230
%234 = load double, double* %29
%235 = load double, double* %29
%236 = fmul double %234, %235
%237 = fmul double 0x402921FB4D12D84A, %236
%238 = load double, double* %19
%239 = fmul double %237, %238
%240 = load double, double* %30
%241 = fmul double %239, %240
%242 = load i32, i32* %11
%243 = sitofp i32 %242 to double
%244 = fmul double %241, %243
%245 = fdiv double 1.000000e+00, %244
%246 = load double*, double** %20
%247 = load double, double* %29
%248 = load double, double* %19
%249 = fdiv double %247, %248
%250 = call i64 @floor(double %249)
%251 = trunc i64 %250 to i32
%252 = sext i32 %251 to i64
%253 = getelementptr inbounds double, double* %246, i64 %252
%254 = load double, double* %253
%255 = fadd double %254, %245
store double %255, double* %253
br label %256
256: ; preds = %233, %230, %144
br label %257
257: ; preds = %256
%258 = load i32, i32* %25
%259 = add nsw i32 %258, 1
store i32 %259, i32* %25
br label %141
260: ; preds = %141
br label %261
261: ; preds = %260
%262 = load i32, i32* %24
%263 = add nsw i32 %262, 1
store i32 %263, i32* %24
br label %137
264: ; preds = %137
br label %265
265: ; preds = %264
%266 = load i32, i32* %23
%267 = add nsw i32 %266, 1
store i32 %267, i32* %23
br label %133
268: ; preds = %133
br label %269
269: ; preds = %268
%270 = load i32, i32* %22
%271 = add nsw i32 %270, 1
store i32 %271, i32* %22
br label %58
272: ; preds = %58
br label %273
273: ; preds = %272
%274 = load i32, i32* %21
%275 = add nsw i32 %274, 1
store i32 %275, i32* %21
br label %53
276: ; preds = %53
ret void
}

LLVM IR (-O2):
define void @basicRDF(i32 %0, i32* nocapture %1, i32 %2, i32* nocapture %3, i32 %4, double* nocapture %5, double* nocapture %6, i32 %7, double %8, double* %9) {
%11 = load double, double* %6
%12 = getelementptr inbounds double, double* %6, i64 4
%13 = load double, double* %12
%14 = fmul double %11, %13
%15 = getelementptr inbounds double, double* %6, i64 8
%16 = load double, double* %15
%17 = fmul double %14, %16
%18 = sitofp i32 %0 to double
%19 = fdiv double %18, %17
%20 = bitcast double* %9 to i8*
%21 = shl i32 %7, 3
%22 = tail call i32 @memset(i8* %20, i32 0, i32 %21)
%23 = icmp sgt i32 %0, 0
br i1 %23, label %24, label %135
24: ; preds = %10
%25 = icmp sgt i32 %2, 0
%26 = getelementptr inbounds double, double* %6, i64 1
%27 = getelementptr inbounds double, double* %6, i64 2
%28 = getelementptr inbounds double, double* %6, i64 3
%29 = getelementptr inbounds double, double* %6, i64 5
%30 = getelementptr inbounds double, double* %6, i64 6
%31 = getelementptr inbounds double, double* %6, i64 7
%32 = sitofp i32 %7 to double
%33 = fmul double %32, %8
%34 = zext i32 %0 to i64
%35 = zext i32 %2 to i64
br label %36
36: ; preds = %24, %132
%37 = phi i64 [ 0, %24 ], [ %133, %132 ]
br i1 %25, label %38, label %132
38: ; preds = %36
%39 = getelementptr inbounds i32, i32* %1, i64 %37
br label %40
40: ; preds = %38, %129
%41 = phi i64 [ 0, %38 ], [ %130, %129 ]
%42 = load i32, i32* %39
%43 = mul nsw i32 %42, 3
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds double, double* %5, i64 %44
%46 = load double, double* %45
%47 = getelementptr inbounds i32, i32* %3, i64 %41
%48 = load i32, i32* %47
%49 = mul nsw i32 %48, 3
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds double, double* %5, i64 %50
%52 = load double, double* %51
%53 = fsub double %46, %52
%54 = add nsw i32 %43, 1
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds double, double* %5, i64 %55
%57 = load double, double* %56
%58 = add nsw i32 %49, 1
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds double, double* %5, i64 %59
%61 = load double, double* %60
%62 = fsub double %57, %61
%63 = add nsw i32 %43, 2
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds double, double* %5, i64 %64
%66 = load double, double* %65
%67 = add nsw i32 %49, 2
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double, double* %5, i64 %68
%70 = load double, double* %69
%71 = fsub double %66, %70
br label %72
72: ; preds = %40, %126
%73 = phi i32 [ -3, %40 ], [ %127, %126 ]
%74 = sitofp i32 %73 to double
br label %75
75: ; preds = %72, %123
%76 = phi i32 [ -3, %72 ], [ %124, %123 ]
%77 = sitofp i32 %76 to double
br label %78
78: ; preds = %75, %120
%79 = phi i32 [ -3, %75 ], [ %121, %120 ]
%80 = load double, double* %6
%81 = tail call double @llvm.fmuladd.f64(double %74, double %80, double %53)
%82 = load double, double* %26
%83 = tail call double @llvm.fmuladd.f64(double %77, double %82, double %81)
%84 = sitofp i32 %79 to double
%85 = load double, double* %27
%86 = tail call double @llvm.fmuladd.f64(double %84, double %85, double %83)
%87 = load double, double* %28
%88 = tail call double @llvm.fmuladd.f64(double %74, double %87, double %62)
%89 = load double, double* %12
%90 = tail call double @llvm.fmuladd.f64(double %77, double %89, double %88)
%91 = load double, double* %29
%92 = tail call double @llvm.fmuladd.f64(double %84, double %91, double %90)
%93 = load double, double* %30
%94 = tail call double @llvm.fmuladd.f64(double %74, double %93, double %71)
%95 = load double, double* %31
%96 = tail call double @llvm.fmuladd.f64(double %77, double %95, double %94)
%97 = load double, double* %15
%98 = tail call double @llvm.fmuladd.f64(double %84, double %97, double %96)
%99 = fmul double %92, %92
%100 = tail call double @llvm.fmuladd.f64(double %86, double %86, double %99)
%101 = tail call double @llvm.fmuladd.f64(double %98, double %98, double %100)
%102 = tail call double @sqrt(double %101)
%103 = fcmp olt double %102, %33
%104 = fcmp ogt double %102, 1.000000e-01
%105 = and i1 %103, %104
br i1 %105, label %106, label %120
106: ; preds = %78
%107 = fmul double %102, %102
%108 = fmul double %107, 0x402921FB4D12D84A
%109 = fmul double %108, %8
%110 = fmul double %19, %109
%111 = fmul double %110, %18
%112 = fdiv double 1.000000e+00, %111
%113 = fdiv double %102, %8
%114 = tail call i64 @floor(double %113)
%115 = shl i64 %114, 32
%116 = ashr exact i64 %115, 32
%117 = getelementptr inbounds double, double* %9, i64 %116
%118 = load double, double* %117
%119 = fadd double %112, %118
store double %119, double* %117
br label %120
120: ; preds = %78, %106
%121 = add nsw i32 %79, 1
%122 = icmp eq i32 %121, 4
br i1 %122, label %123, label %78
123: ; preds = %120
%124 = add nsw i32 %76, 1
%125 = icmp eq i32 %124, 4
br i1 %125, label %126, label %75
126: ; preds = %123
%127 = add nsw i32 %73, 1
%128 = icmp eq i32 %127, 4
br i1 %128, label %129, label %72
129: ; preds = %126
%130 = add nuw nsw i64 %41, 1
%131 = icmp eq i64 %130, %35
br i1 %131, label %132, label %40
132: ; preds = %129, %36
%133 = add nuw nsw i64 %37, 1
%134 = icmp eq i64 %133, %34
br i1 %134, label %135, label %36
135: ; preds = %132, %10
ret void
}