#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__ fabs(double);
double const sqrt(double);
void scriptedSphereMotionSignedDistance(const int nPoints, const double t,
                                        const int nSpace, const int nSpheres,
                                        const double *radii,
                                        const double *centers, const double *x,
                                        double *phi, double *n) {
  int i, j, k;
  double minDistance, distance, tmp;
  for (k = 0; k < nPoints; k++) {
    for (j = 0; j < nSpheres; j++) {
      tmp = 0.0;
      for (i = 0; i < nSpace; i++) {
        tmp += (x[3 * k + i] - centers[3 * j + i]) *
               (x[3 * k + i] - centers[3 * j + i]);
      }
      distance = sqrt(tmp) - radii[j];
      if (j == 0) {
        minDistance = distance;
        for (i = 0; i < nSpace; i++) {
          n[k * nSpace + i] =
              (x[3 * k + i] - centers[3 * j + i]) / (distance + 1.0e-12);
        }
      } else if (fabs(distance) < fabs(minDistance)) {
        minDistance = distance;
        for (i = 0; i < nSpace; i++) {
          n[k * nSpace + i] =
              (x[3 * k + i] - centers[3 * j + i]) / (distance + 1.0e-12);
        }
      }
    }
    phi[k] = minDistance;
  }
}


x86 assembly (clang, -O0):
<scriptedSphereMotionSignedDistance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1377 <scriptedSphereMotionSignedDistance+0x257>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1357 <scriptedSphereMotionSignedDistance+0x237>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11f7 <scriptedSphereMotionSignedDistance+0xd7>
mov    -0x30(%rbp),%rax
imul   $0x3,-0x3c(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
imul   $0x3,-0x38(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
imul   $0x3,-0x3c(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x28(%rbp),%rax
imul   $0x3,-0x38(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    117f <scriptedSphereMotionSignedDistance+0x5f>
movsd  -0x58(%rbp),%xmm0
call   1040 <sqrt@plt>
mov    -0x20(%rbp),%rax
movslq -0x38(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
cmpl   $0x0,-0x38(%rbp)
jne    129a <scriptedSphereMotionSignedDistance+0x17a>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1295 <scriptedSphereMotionSignedDistance+0x175>
mov    -0x30(%rbp),%rax
imul   $0x3,-0x3c(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
imul   $0x3,-0x38(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  0xd98(%rip),%xmm1
addsd  -0x50(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    122e <scriptedSphereMotionSignedDistance+0x10e>
jmp    1344 <scriptedSphereMotionSignedDistance+0x224>
movsd  -0x50(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %rax,-0x60(%rbp)
movsd  -0x48(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %rax,%rcx
mov    -0x60(%rbp),%rax
cmp    %rcx,%rax
jge    133f <scriptedSphereMotionSignedDistance+0x21f>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    133a <scriptedSphereMotionSignedDistance+0x21a>
mov    -0x30(%rbp),%rax
imul   $0x3,-0x3c(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
imul   $0x3,-0x38(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  0xcf3(%rip),%xmm1
addsd  -0x50(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    12d3 <scriptedSphereMotionSignedDistance+0x1b3>
jmp    133f <scriptedSphereMotionSignedDistance+0x21f>
jmp    1344 <scriptedSphereMotionSignedDistance+0x224>
jmp    1349 <scriptedSphereMotionSignedDistance+0x229>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1164 <scriptedSphereMotionSignedDistance+0x44>
movsd  -0x48(%rbp),%xmm0
mov    0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1151 <scriptedSphereMotionSignedDistance+0x31>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scriptedSphereMotionSignedDistance>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
mov    %rcx,0xf0(%rsp)
mov    %edx,0x28(%rsp)
test   %edi,%edi
jle    1790 <scriptedSphereMotionSignedDistance+0x670>
mov    %r9,%r14
mov    %r8,%rbx
mov    0x138(%rsp),%r12
movslq %esi,%rax
mov    %edi,%ecx
mov    %rcx,0x98(%rsp)
mov    0x28(%rsp),%ecx
mov    %rcx,0xe8(%rsp)
mov    %eax,%ebp
lea    -0x1(%rbp),%rdx
lea    (%r8,%rbp,8),%rcx
mov    %rcx,0x40(%rsp)
lea    (%r9,%rbp,8),%rcx
mov    %rcx,0x80(%rsp)
mov    %ebp,%r11d
and    $0xfffffffe,%r11d
lea    -0x2(%r11),%rcx
mov    %rcx,0xc8(%rsp)
mov    %rcx,%rdi
shr    %rdi
add    $0x1,%rdi
mov    %rdi,%rcx
mov    %rdi,0xc0(%rsp)
and    $0xfffffffffffffffe,%rdi
mov    %rdi,0xa0(%rsp)
mov    %rbp,%rcx
neg    %rcx
mov    %rcx,0xd0(%rsp)
mov    %rdx,%rcx
mov    %rdx,0x60(%rsp)
shr    $0x20,%rdx
mov    %rdx,0x58(%rsp)
lea    0x8(%r9),%rcx
mov    %rcx,0x78(%rsp)
lea    0x8(%r8),%rcx
mov    %rcx,0xd8(%rsp)
mov    %rax,0x88(%rsp)
lea    0x0(,%rax,8),%rax
mov    %rax,0x90(%rsp)
mov    $0x2,%r8d
xor    %edi,%edi
xor    %r9d,%r9d
mov    %rbp,0x70(%rsp)
mov    %r11,0x68(%rsp)
mov    %esi,0x2c(%rsp)
jmp    126e <scriptedSphereMotionSignedDistance+0x14e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x130(%rsp),%rax
mov    0xa8(%rsp),%r9
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%rax,%r9,8)
add    $0x1,%r9
add    $0x3,%rdi
add    0x90(%rsp),%r12
add    $0x3,%r8
cmp    0x98(%rsp),%r9
je     1790 <scriptedSphereMotionSignedDistance+0x670>
cmpl   $0x0,0x28(%rsp)
mov    %r9,0xa8(%rsp)
jle    1230 <scriptedSphereMotionSignedDistance+0x110>
mov    %r9,%r10
imul   0x88(%rsp),%r10
lea    (%r10,%rbp,1),%rax
mov    %edi,%ecx
mov    0x78(%rsp),%rdx
lea    (%rdx,%rcx,8),%r15
mov    0x138(%rsp),%rcx
mov    %r10,0x50(%rsp)
lea    (%rcx,%r10,8),%r10
lea    (%rcx,%rax,8),%r13
lea    (%r9,%r9,2),%ecx
mov    %rdi,0x38(%rsp)
lea    (%r14,%rcx,8),%rax
mov    %rax,0x30(%rsp)
mov    0x80(%rsp),%rax
lea    (%rax,%rcx,8),%rax
mov    %rax,0x18(%rsp)
cmpq   $0x0,0x58(%rsp)
setne  %sil
lea    (%r9,%r9,2),%r9
mov    %r8,0x20(%rsp)
mov    %ecx,%edi
mov    0x60(%rsp),%rax
add    %eax,%edi
setb   %dl
or     %sil,%dl
mov    %dl,0xd(%rsp)
cmp    0x18(%rsp),%r10
setb   %r8b
mov    0x30(%rsp),%rdi
cmp    %r13,%rdi
setb   %dl
and    %r8b,%dl
mov    %dl,0xc(%rsp)
add    %eax,%ecx
setb   %al
or     %sil,%al
mov    %al,0xf(%rsp)
cmp    0x40(%rsp),%r10
setb   %al
cmp    %rbx,%r13
seta   %cl
and    %al,%cl
mov    %r9,%rax
mov    %r9,0x48(%rsp)
mov    %r9d,%eax
mov    %rax,0xe0(%rsp)
mov    %r10,0xb8(%rsp)
cmp    0x18(%rsp),%r10
mov    0x2c(%rsp),%esi
setb   %al
mov    %r13,0xb0(%rsp)
cmp    %r13,%rdi
mov    0x38(%rsp),%rdi
setb   %dl
and    %al,%dl
or     %cl,%dl
mov    %dl,0xe(%rsp)
xor    %r13d,%r13d
xor    %r9d,%r9d
jmp    139c <scriptedSphereMotionSignedDistance+0x27c>
nopw   0x0(%rax,%rax,1)
movsd  %xmm0,0x10(%rsp)
add    $0x1,%r9
add    $0x3,%r13
cmp    0xe8(%rsp),%r9
je     1230 <scriptedSphereMotionSignedDistance+0x110>
test   %esi,%esi
jle    13b0 <scriptedSphereMotionSignedDistance+0x290>
cmp    $0x1,%esi
jne    13c0 <scriptedSphereMotionSignedDistance+0x2a0>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
jmp    1415 <scriptedSphereMotionSignedDistance+0x2f5>
nopl   (%rax)
xorpd  %xmm0,%xmm0
jmp    1440 <scriptedSphereMotionSignedDistance+0x320>
nopl   0x0(%rax)
mov    %r13d,%eax
mov    0xd8(%rsp),%rcx
lea    (%rcx,%rax,8),%rcx
xorpd  %xmm1,%xmm1
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movsd  -0x8(%r15,%rax,8),%xmm2
movsd  (%r15,%rax,8),%xmm0
subsd  -0x8(%rcx,%rax,8),%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm1,%xmm2
subsd  (%rcx,%rax,8),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
add    $0x2,%rax
movapd %xmm0,%xmm1
cmp    %rax,%r11
jne    13e0 <scriptedSphereMotionSignedDistance+0x2c0>
test   $0x1,%bpl
je     1440 <scriptedSphereMotionSignedDistance+0x320>
lea    (%r9,%r9,2),%ecx
mov    0xe0(%rsp),%rdx
add    %rax,%rdx
movsd  (%r14,%rdx,8),%xmm1
add    %rax,%rcx
subsd  (%rbx,%rcx,8),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
ucomisd 0xbc0(%rip),%xmm0
mov    %r9,0x18(%rsp)
jb     1460 <scriptedSphereMotionSignedDistance+0x340>
sqrtsd %xmm0,%xmm0
jmp    147d <scriptedSphereMotionSignedDistance+0x35d>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %esi,%ebp
call   1040 <sqrt@plt>
mov    0x18(%rsp),%r9
mov    0x38(%rsp),%rdi
mov    %ebp,%esi
mov    0x68(%rsp),%r11
mov    0x70(%rsp),%rbp
mov    0xf0(%rsp),%rax
subsd  (%rax,%r9,8),%xmm0
test   %r9,%r9
je     1500 <scriptedSphereMotionSignedDistance+0x3e0>
movsd  %xmm0,0x30(%rsp)
call   1030 <fabs@plt>
mov    %rax,%rbp
movsd  0x10(%rsp),%xmm0
call   1030 <fabs@plt>
cmp    %rax,%rbp
jge    14ba <scriptedSphereMotionSignedDistance+0x39a>
movsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    0x2c(%rsp),%esi
mov    0x70(%rsp),%rbp
mov    0x68(%rsp),%r11
mov    0x20(%rsp),%r8
mov    0x38(%rsp),%rdi
jge    152c <scriptedSphereMotionSignedDistance+0x40c>
test   %esi,%esi
mov    0x18(%rsp),%r9
jle    1386 <scriptedSphereMotionSignedDistance+0x266>
movsd  0x30(%rsp),%xmm4
movapd %xmm4,%xmm0
addsd  0xb0d(%rip),%xmm0
cmp    $0x2,%esi
jae    1536 <scriptedSphereMotionSignedDistance+0x416>
xor    %eax,%eax
jmp    1760 <scriptedSphereMotionSignedDistance+0x640>
nop
test   %esi,%esi
jle    155f <scriptedSphereMotionSignedDistance+0x43f>
cmp    $0x1,%esi
sete   %al
movapd %xmm0,%xmm4
addsd  0xaea(%rip),%xmm4
or     0xf(%rsp),%al
or     0xe(%rsp),%al
je     156f <scriptedSphereMotionSignedDistance+0x44f>
xor    %ecx,%ecx
mov    0x20(%rsp),%r8
jmp    1627 <scriptedSphereMotionSignedDistance+0x507>
mov    0x18(%rsp),%r9
jmp    1386 <scriptedSphereMotionSignedDistance+0x266>
lea    (%r9,%r9,2),%eax
cmpq   $0x0,0x58(%rsp)
setne  %cl
mov    %eax,%edx
add    0x60(%rsp),%edx
setb   %dl
or     %cl,%dl
or     0xd(%rsp),%dl
je     16c3 <scriptedSphereMotionSignedDistance+0x5a3>
xor    %eax,%eax
jmp    1760 <scriptedSphereMotionSignedDistance+0x640>
movsd  %xmm0,0x10(%rsp)
mov    0x20(%rsp),%r8
jmp    1386 <scriptedSphereMotionSignedDistance+0x266>
movapd %xmm4,%xmm1
unpcklpd %xmm4,%xmm1
cmpq   $0x0,0xc8(%rsp)
je     16f2 <scriptedSphereMotionSignedDistance+0x5d2>
mov    0xa0(%rsp),%rcx
xor    %eax,%eax
mov    0x20(%rsp),%r8
cs nopw 0x0(%rax,%rax,1)
nop
lea    (%rdi,%rax,1),%edx
movupd (%r14,%rdx,8),%xmm2
movupd (%rbx,%rax,8),%xmm3
subpd  %xmm3,%xmm2
divpd  %xmm1,%xmm2
movupd %xmm2,(%r12,%rax,8)
lea    (%r8,%rax,1),%edx
movupd (%r14,%rdx,8),%xmm2
movupd 0x10(%rbx,%rax,8),%xmm3
subpd  %xmm3,%xmm2
divpd  %xmm1,%xmm2
movupd %xmm2,0x10(%r12,%rax,8)
add    $0x4,%rax
add    $0xfffffffffffffffe,%rcx
jne    15a0 <scriptedSphereMotionSignedDistance+0x480>
testb  $0x1,0xc0(%rsp)
01
je     161b <scriptedSphereMotionSignedDistance+0x4fb>
mov    0x48(%rsp),%rcx
add    %eax,%ecx
movupd (%r14,%rcx,8),%xmm2
movupd (%rbx,%rax,8),%xmm3
subpd  %xmm3,%xmm2
divpd  %xmm1,%xmm2
add    0x50(%rsp),%rax
mov    0x138(%rsp),%rcx
movupd %xmm2,(%rcx,%rax,8)
mov    %r11,%rcx
cmp    %rbp,%r11
je     1380 <scriptedSphereMotionSignedDistance+0x260>
mov    %rcx,%rax
test   $0x1,%bpl
je     1662 <scriptedSphereMotionSignedDistance+0x542>
mov    0x48(%rsp),%rax
add    %ecx,%eax
movsd  (%r14,%rax,8),%xmm1
subsd  (%rbx,%rcx,8),%xmm1
divsd  %xmm4,%xmm1
mov    0x50(%rsp),%rax
add    %rcx,%rax
mov    0x138(%rsp),%rdx
movsd  %xmm1,(%rdx,%rax,8)
mov    %rcx,%rax
or     $0x1,%rax
not    %rcx
cmp    0xd0(%rsp),%rcx
je     1380 <scriptedSphereMotionSignedDistance+0x260>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    (%rdi,%rax,1),%rcx
mov    %ecx,%edx
movsd  (%r14,%rdx,8),%xmm1
subsd  (%rbx,%rax,8),%xmm1
divsd  %xmm4,%xmm1
movsd  %xmm1,(%r12,%rax,8)
add    $0x1,%ecx
movsd  (%r14,%rcx,8),%xmm1
subsd  0x8(%rbx,%rax,8),%xmm1
divsd  %xmm4,%xmm1
movsd  %xmm1,0x8(%r12,%rax,8)
add    $0x2,%rax
cmp    %rax,%rbp
jne    1680 <scriptedSphereMotionSignedDistance+0x560>
jmp    1380 <scriptedSphereMotionSignedDistance+0x260>
lea    (%rbx,%rax,8),%rcx
mov    0x40(%rsp),%rdx
lea    (%rdx,%rax,8),%rax
cmp    %rax,0xb8(%rsp)
setb   %al
cmp    0xb0(%rsp),%rcx
setb   %cl
and    %al,%cl
or     0xc(%rsp),%cl
je     170c <scriptedSphereMotionSignedDistance+0x5ec>
xor    %eax,%eax
jmp    1760 <scriptedSphereMotionSignedDistance+0x640>
xor    %eax,%eax
mov    0x20(%rsp),%r8
testb  $0x1,0xc0(%rsp)
jne    15ef <scriptedSphereMotionSignedDistance+0x4cf>
jmp    161b <scriptedSphereMotionSignedDistance+0x4fb>
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
lea    (%rdi,%rax,1),%ecx
movupd (%r14,%rcx,8),%xmm2
lea    (%rax,%r13,1),%ecx
movupd (%rbx,%rcx,8),%xmm3
subpd  %xmm3,%xmm2
divpd  %xmm1,%xmm2
movupd %xmm2,(%r12,%rax,8)
add    $0x2,%rax
cmp    %rax,%r11
jne    1720 <scriptedSphereMotionSignedDistance+0x600>
mov    %r11,%rax
cmp    %rbp,%r11
je     1785 <scriptedSphereMotionSignedDistance+0x665>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    (%rdi,%rax,1),%ecx
movsd  (%r14,%rcx,8),%xmm1
lea    (%rax,%r13,1),%ecx
subsd  (%rbx,%rcx,8),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r12,%rax,8)
add    $0x1,%rax
cmp    %rax,%rbp
jne    1760 <scriptedSphereMotionSignedDistance+0x640>
movsd  %xmm4,0x10(%rsp)
jmp    1386 <scriptedSphereMotionSignedDistance+0x266>
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @scriptedSphereMotionSignedDistance(i32 %0, double %1, i32 %2, i32 %3, double* nocapture %4, double* nocapture %5, double* nocapture %6, double* nocapture writeonly %7, double* nocapture writeonly %8) {
%10 = icmp sgt i32 %0, 0
br i1 %10, label %11, label %323
11: ; preds = %9
%12 = icmp sgt i32 %3, 0
%13 = icmp sgt i32 %2, 0
%14 = icmp slt i32 %2, 1
%15 = sext i32 %2 to i64
%16 = zext i32 %0 to i64
%17 = zext i32 %3 to i64
%18 = zext i32 %2 to i64
%19 = zext i32 %2 to i64
%20 = zext i32 %2 to i64
%21 = add nsw i64 %18, -1
%22 = getelementptr double, double* %5, i64 %18
%23 = getelementptr double, double* %6, i64 %18
%24 = add nsw i64 %18, -1
%25 = getelementptr double, double* %6, i64 %18
%26 = getelementptr double, double* %5, i64 %18
%27 = and i64 %18, 4294967294
%28 = add nsw i64 %27, -2
%29 = lshr exact i64 %28, 1
%30 = add nuw i64 %29, 1
%31 = and i64 %18, 1
%32 = icmp eq i32 %2, 1
%33 = and i64 %18, 4294967294
%34 = icmp eq i64 %31, 0
%35 = icmp ult i32 %2, 2
%36 = trunc i64 %24 to i32
%37 = icmp ugt i64 %24, 4294967295
%38 = trunc i64 %24 to i32
%39 = icmp ugt i64 %24, 4294967295
%40 = and i64 %18, 4294967294
%41 = icmp eq i64 %40, %18
%42 = icmp eq i32 %2, 1
%43 = trunc i64 %21 to i32
%44 = icmp ugt i64 %21, 4294967295
%45 = and i64 %18, 4294967294
%46 = and i64 %30, 1
%47 = icmp eq i64 %28, 0
%48 = and i64 %30, -2
%49 = icmp eq i64 %46, 0
%50 = icmp eq i64 %45, %18
%51 = and i64 %18, 1
%52 = icmp eq i64 %51, 0
%53 = sub nsw i64 0, %18
br label %54
54: ; preds = %11, %318
%55 = phi i64 [ 0, %11 ], [ %321, %318 ]
%56 = phi double [ undef, %11 ], [ %319, %318 ]
%57 = mul i64 %55, %15
%58 = getelementptr double, double* %8, i64 %57
%59 = add i64 %57, %18
%60 = getelementptr double, double* %8, i64 %59
%61 = mul i64 %55, 3
%62 = and i64 %61, 4294967295
%63 = getelementptr double, double* %6, i64 %62
%64 = getelementptr double, double* %25, i64 %62
%65 = trunc i64 %55 to i32
%66 = mul i32 %65, 3
%67 = mul i64 %55, %15
%68 = getelementptr double, double* %8, i64 %67
%69 = add i64 %67, %18
%70 = getelementptr double, double* %8, i64 %69
%71 = mul i64 %55, 3
%72 = and i64 %71, 4294967295
%73 = getelementptr double, double* %6, i64 %72
%74 = getelementptr double, double* %23, i64 %72
%75 = trunc i64 %55 to i32
%76 = mul i32 %75, 3
br i1 %12, label %77, label %318
77: ; preds = %54
%78 = mul nuw nsw i64 %55, 3
%79 = mul nsw i64 %55, %15
%80 = and i64 %78, 4294967295
%81 = xor i32 %66, -1
%82 = icmp ult i32 %81, %36
%83 = or i1 %82, %37
%84 = icmp ult double* %58, %64
%85 = icmp ult double* %63, %60
%86 = and i1 %84, %85
%87 = xor i32 %76, -1
%88 = icmp ult i32 %87, %43
%89 = or i1 %88, %44
%90 = icmp ult double* %68, %22
%91 = icmp ugt double* %70, %5
%92 = and i1 %90, %91
%93 = icmp ult double* %68, %74
%94 = icmp ult double* %73, %70
%95 = and i1 %93, %94
%96 = or i1 %92, %95
br label %97
97: ; preds = %77, %314
%98 = phi i64 [ 0, %77 ], [ %316, %314 ]
%99 = phi double [ %56, %77 ], [ %315, %314 ]
%100 = mul i64 %98, 3
%101 = and i64 %100, 4294967295
%102 = getelementptr double, double* %5, i64 %101
%103 = getelementptr double, double* %26, i64 %101
%104 = trunc i64 %98 to i32
%105 = mul i32 %104, 3
br i1 %13, label %106, label %146
106: ; preds = %97
%107 = mul i64 %98, 3
%108 = and i64 %107, 4294967295
br i1 %32, label %133, label %109
109: ; preds = %106, %109
%110 = phi i64 [ %130, %109 ], [ 0, %106 ]
%111 = phi double [ %129, %109 ], [ 0.000000e+00, %106 ]
%112 = phi i64 [ %131, %109 ], [ 0, %106 ]
%113 = add nuw nsw i64 %110, %80
%114 = getelementptr inbounds double, double* %6, i64 %113
%115 = load double, double* %114
%116 = add nuw nsw i64 %110, %108
%117 = getelementptr inbounds double, double* %5, i64 %116
%118 = load double, double* %117
%119 = fsub double %115, %118
%120 = tail call double @llvm.fmuladd.f64(double %119, double %119, double %111)
%121 = or i64 %110, 1
%122 = add nuw nsw i64 %121, %80
%123 = getelementptr inbounds double, double* %6, i64 %122
%124 = load double, double* %123
%125 = add nuw nsw i64 %121, %108
%126 = getelementptr inbounds double, double* %5, i64 %125
%127 = load double, double* %126
%128 = fsub double %124, %127
%129 = tail call double @llvm.fmuladd.f64(double %128, double %128, double %120)
%130 = add nuw nsw i64 %110, 2
%131 = add i64 %112, 2
%132 = icmp eq i64 %131, %33
br i1 %132, label %133, label %109
133: ; preds = %109, %106
%134 = phi double [ undef, %106 ], [ %129, %109 ]
%135 = phi i64 [ 0, %106 ], [ %130, %109 ]
%136 = phi double [ 0.000000e+00, %106 ], [ %129, %109 ]
br i1 %34, label %146, label %137
137: ; preds = %133
%138 = add nuw nsw i64 %135, %80
%139 = getelementptr inbounds double, double* %6, i64 %138
%140 = load double, double* %139
%141 = add nuw nsw i64 %135, %108
%142 = getelementptr inbounds double, double* %5, i64 %141
%143 = load double, double* %142
%144 = fsub double %140, %143
%145 = tail call double @llvm.fmuladd.f64(double %144, double %144, double %136)
br label %146
146: ; preds = %137, %133, %97
%147 = phi double [ 0.000000e+00, %97 ], [ %134, %133 ], [ %145, %137 ]
%148 = tail call double @sqrt(double %147)
%149 = getelementptr inbounds double, double* %4, i64 %98
%150 = load double, double* %149
%151 = fsub double %148, %150
%152 = icmp eq i64 %98, 0
br i1 %152, label %153, label %254
153: ; preds = %146
br i1 %13, label %154, label %314
154: ; preds = %153
%155 = fadd double %151, 0x3D719799812DEA11
%156 = select i1 %42, i1 true, i1 %89
%157 = select i1 %156, i1 true, i1 %96
br i1 %157, label %211, label %158
158: ; preds = %154
%159 = insertelement <2 x double> poison, double %155, i64 0
%160 = shufflevector <2 x double> %159, <2 x double> poison, <2 x i32> zeroinitializer
br i1 %47, label %194, label %161
161: ; preds = %158, %161
%162 = phi i64 [ %191, %161 ], [ 0, %158 ]
%163 = phi i64 [ %192, %161 ], [ 0, %158 ]
%164 = add nuw nsw i64 %162, %78
%165 = and i64 %164, 4294967295
%166 = getelementptr inbounds double, double* %6, i64 %165
%167 = bitcast double* %166 to <2 x double>*
%168 = load <2 x double>, <2 x double>* %167
%169 = getelementptr inbounds double, double* %5, i64 %162
%170 = bitcast double* %169 to <2 x double>*
%171 = load <2 x double>, <2 x double>* %170
%172 = fsub <2 x double> %168, %171
%173 = fdiv <2 x double> %172, %160
%174 = add nsw i64 %162, %79
%175 = getelementptr inbounds double, double* %8, i64 %174
%176 = bitcast double* %175 to <2 x double>*
store <2 x double> %173, <2 x double>* %176
%177 = or i64 %162, 2
%178 = add nuw nsw i64 %177, %78
%179 = and i64 %178, 4294967295
%180 = getelementptr inbounds double, double* %6, i64 %179
%181 = bitcast double* %180 to <2 x double>*
%182 = load <2 x double>, <2 x double>* %181
%183 = getelementptr inbounds double, double* %5, i64 %177
%184 = bitcast double* %183 to <2 x double>*
%185 = load <2 x double>, <2 x double>* %184
%186 = fsub <2 x double> %182, %185
%187 = fdiv <2 x double> %186, %160
%188 = add nsw i64 %177, %79
%189 = getelementptr inbounds double, double* %8, i64 %188
%190 = bitcast double* %189 to <2 x double>*
store <2 x double> %187, <2 x double>* %190
%191 = add nuw i64 %162, 4
%192 = add nuw i64 %163, 2
%193 = icmp eq i64 %192, %48
br i1 %193, label %194, label %161
194: ; preds = %161, %158
%195 = phi i64 [ 0, %158 ], [ %191, %161 ]
br i1 %49, label %210, label %196
196: ; preds = %194
%197 = add nuw nsw i64 %195, %78
%198 = and i64 %197, 4294967295
%199 = getelementptr inbounds double, double* %6, i64 %198
%200 = bitcast double* %199 to <2 x double>*
%201 = load <2 x double>, <2 x double>* %200
%202 = getelementptr inbounds double, double* %5, i64 %195
%203 = bitcast double* %202 to <2 x double>*
%204 = load <2 x double>, <2 x double>* %203
%205 = fsub <2 x double> %201, %204
%206 = fdiv <2 x double> %205, %160
%207 = add nsw i64 %195, %79
%208 = getelementptr inbounds double, double* %8, i64 %207
%209 = bitcast double* %208 to <2 x double>*
store <2 x double> %206, <2 x double>* %209
br label %210
210: ; preds = %194, %196
br i1 %50, label %314, label %211
211: ; preds = %154, %210
%212 = phi i64 [ 0, %154 ], [ %45, %210 ]
%213 = xor i64 %212, -1
br i1 %52, label %226, label %214
214: ; preds = %211
%215 = add nuw nsw i64 %212, %78
%216 = and i64 %215, 4294967295
%217 = getelementptr inbounds double, double* %6, i64 %216
%218 = load double, double* %217
%219 = getelementptr inbounds double, double* %5, i64 %212
%220 = load double, double* %219
%221 = fsub double %218, %220
%222 = fdiv double %221, %155
%223 = add nsw i64 %212, %79
%224 = getelementptr inbounds double, double* %8, i64 %223
store double %222, double* %224
%225 = or i64 %212, 1
br label %226
226: ; preds = %214, %211
%227 = phi i64 [ %212, %211 ], [ %225, %214 ]
%228 = icmp eq i64 %213, %53
br i1 %228, label %314, label %229
229: ; preds = %226, %229
%230 = phi i64 [ %252, %229 ], [ %227, %226 ]
%231 = add nuw nsw i64 %230, %78
%232 = and i64 %231, 4294967295
%233 = getelementptr inbounds double, double* %6, i64 %232
%234 = load double, double* %233
%235 = getelementptr inbounds double, double* %5, i64 %230
%236 = load double, double* %235
%237 = fsub double %234, %236
%238 = fdiv double %237, %155
%239 = add nsw i64 %230, %79
%240 = getelementptr inbounds double, double* %8, i64 %239
store double %238, double* %240
%241 = add nuw nsw i64 %230, 1
%242 = add nuw nsw i64 %241, %78
%243 = and i64 %242, 4294967295
%244 = getelementptr inbounds double, double* %6, i64 %243
%245 = load double, double* %244
%246 = getelementptr inbounds double, double* %5, i64 %241
%247 = load double, double* %246
%248 = fsub double %245, %247
%249 = fdiv double %248, %155
%250 = add nsw i64 %241, %79
%251 = getelementptr inbounds double, double* %8, i64 %250
store double %249, double* %251
%252 = add nuw nsw i64 %230, 2
%253 = icmp eq i64 %252, %20
br i1 %253, label %314, label %229
254: ; preds = %146
%255 = tail call i64 @fabs(double %151)
%256 = tail call i64 @fabs(double %99)
%257 = icmp sge i64 %255, %256
%258 = or i1 %257, %14
%259 = select i1 %257, double %99, double %151
br i1 %258, label %314, label %260
260: ; preds = %254
%261 = mul nuw nsw i64 %98, 3
%262 = fadd double %151, 0x3D719799812DEA11
br i1 %35, label %296, label %263
263: ; preds = %260
%264 = xor i32 %105, -1
%265 = icmp ult i32 %264, %38
%266 = or i1 %265, %39
%267 = or i1 %83, %266
br i1 %267, label %296, label %268
268: ; preds = %263
%269 = icmp ult double* %58, %103
%270 = icmp ult double* %102, %60
%271 = and i1 %269, %270
%272 = or i1 %86, %271
br i1 %272, label %296, label %273
273: ; preds = %268
%274 = insertelement <2 x double> poison, double %262, i64 0
%275 = shufflevector <2 x double> %274, <2 x double> poison, <2 x i32> zeroinitializer
br label %276
276: ; preds = %276, %273
%277 = phi i64 [ 0, %273 ], [ %293, %276 ]
%278 = add nuw nsw i64 %277, %78
%279 = and i64 %278, 4294967295
%280 = getelementptr inbounds double, double* %6, i64 %279
%281 = bitcast double* %280 to <2 x double>*
%282 = load <2 x double>, <2 x double>* %281
%283 = add nuw nsw i64 %277, %261
%284 = and i64 %283, 4294967295
%285 = getelementptr inbounds double, double* %5, i64 %284
%286 = bitcast double* %285 to <2 x double>*
%287 = load <2 x double>, <2 x double>* %286
%288 = fsub <2 x double> %282, %287
%289 = fdiv <2 x double> %288, %275
%290 = add nsw i64 %277, %79
%291 = getelementptr inbounds double, double* %8, i64 %290
%292 = bitcast double* %291 to <2 x double>*
store <2 x double> %289, <2 x double>* %292
%293 = add nuw i64 %277, 2
%294 = icmp eq i64 %293, %40
br i1 %294, label %295, label %276
295: ; preds = %276
br i1 %41, label %314, label %296
296: ; preds = %268, %263, %260, %295
%297 = phi i64 [ 0, %268 ], [ 0, %263 ], [ 0, %260 ], [ %40, %295 ]
br label %298
298: ; preds = %296, %298
%299 = phi i64 [ %312, %298 ], [ %297, %296 ]
%300 = add nuw nsw i64 %299, %78
%301 = and i64 %300, 4294967295
%302 = getelementptr inbounds double, double* %6, i64 %301
%303 = load double, double* %302
%304 = add nuw nsw i64 %299, %261
%305 = and i64 %304, 4294967295
%306 = getelementptr inbounds double, double* %5, i64 %305
%307 = load double, double* %306
%308 = fsub double %303, %307
%309 = fdiv double %308, %262
%310 = add nsw i64 %299, %79
%311 = getelementptr inbounds double, double* %8, i64 %310
store double %309, double* %311
%312 = add nuw nsw i64 %299, 1
%313 = icmp eq i64 %312, %19
br i1 %313, label %314, label %298
314: ; preds = %298, %226, %229, %295, %210, %254, %153
%315 = phi double [ %259, %254 ], [ %151, %153 ], [ %151, %210 ], [ %151, %295 ], [ %151, %229 ], [ %151, %226 ], [ %151, %298 ]
%316 = add nuw nsw i64 %98, 1
%317 = icmp eq i64 %316, %17
br i1 %317, label %318, label %97
318: ; preds = %314, %54
%319 = phi double [ %56, %54 ], [ %315, %314 ]
%320 = getelementptr inbounds double, double* %7, i64 %55
store double %319, double* %320
%321 = add nuw nsw i64 %55, 1
%322 = icmp eq i64 %321, %16
br i1 %322, label %323, label %54
323: ; preds = %318, %9
ret void
}