#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 */
int /*<<< orphan*/ exit(int);
double fabs(double);
double polint(double *, double *, double);
int /*<<< orphan*/ printf(char *);
void inter_motion(double *times, double xyz[][3], int npts, double seek_time,
                  double *retxyz) {
  int ind;
  double interp_vec[3];
  double interp_time[3];
  int use[3];
  double bck, fwd;
  int i, j;
  ind = 0;
  do {
    ind++;
  } while (times[ind] < seek_time);
  bck = fabs(seek_time - times[ind]);
  fwd = fabs(seek_time - times[ind + 1]);
  if (bck <= fwd && ind + 1 < npts && ind - 1 >= 1) {
    interp_time[0] = times[ind - 1];
    interp_time[1] = times[ind];
    interp_time[2] = times[ind + 1];
    use[0] = ind - 1;
    use[1] = ind;
    use[2] = ind + 1;
  } else if (bck <= fwd && ind + 2 <= npts && ind - 1 <= 0) {
    interp_time[0] = times[ind];
    interp_time[1] = times[ind + 1];
    interp_time[2] = times[ind + 2];
    use[0] = ind;
    use[1] = ind + 1;
    use[2] = ind + 2;
  } else if (bck > fwd && ind + 2 <= npts) {
    interp_time[0] = times[ind];
    interp_time[1] = times[ind + 1];
    interp_time[2] = times[ind + 2];
    use[0] = ind;
    use[1] = ind + 1;
    use[2] = ind + 2;
  } else if (bck > fwd && ind + 1 <= npts && ind - 1 >= 1) {
    interp_time[0] = times[ind - 1];
    interp_time[1] = times[ind];
    interp_time[2] = times[ind + 1];
    use[0] = ind - 1;
    use[1] = ind;
    use[2] = ind + 1;
  } else {
    printf("Problem with motion data...\n");
    exit(1);
  }
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      interp_vec[j] = xyz[use[j]][i];
    }
    retxyz[i] = polint(interp_time, interp_vec, seek_time);
  }
}


x86 assembly (clang, -O0):
<inter_motion>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     1156 <inter_motion+0x26>
movsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movaps 0xe6c(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movaps 0xe42(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0x90(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jb     125f <inter_motion+0x12f>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
cmp    -0x14(%rbp),%eax
jge    125f <inter_motion+0x12f>
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
cmp    $0x1,%eax
jl     125f <inter_motion+0x12f>
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x7c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x78(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    142c <inter_motion+0x2fc>
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0x90(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jb     12f4 <inter_motion+0x1c4>
mov    -0x2c(%rbp),%eax
add    $0x2,%eax
cmp    -0x14(%rbp),%eax
jg     12f4 <inter_motion+0x1c4>
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
cmp    $0x0,%eax
jg     12f4 <inter_motion+0x1c4>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x74(%rbp)
jmp    1427 <inter_motion+0x2f7>
movsd  -0x88(%rbp),%xmm0
ff
ucomisd -0x90(%rbp),%xmm0
ff
jbe    1376 <inter_motion+0x246>
mov    -0x2c(%rbp),%eax
add    $0x2,%eax
cmp    -0x14(%rbp),%eax
jg     1376 <inter_motion+0x246>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x74(%rbp)
jmp    1422 <inter_motion+0x2f2>
movsd  -0x88(%rbp),%xmm0
ff
ucomisd -0x90(%rbp),%xmm0
ff
jbe    1407 <inter_motion+0x2d7>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
cmp    -0x14(%rbp),%eax
jg     1407 <inter_motion+0x2d7>
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
cmp    $0x1,%eax
jl     1407 <inter_motion+0x2d7>
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x7c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x78(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    141d <inter_motion+0x2ed>
lea    0xc02(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    1422 <inter_motion+0x2f2>
jmp    1427 <inter_motion+0x2f7>
jmp    142c <inter_motion+0x2fc>
movl   $0x0,-0x94(%rbp)
cmpl   $0x3,-0x94(%rbp)
jge    14d4 <inter_motion+0x3a4>
movl   $0x0,-0x98(%rbp)
cmpl   $0x3,-0x98(%rbp)
jge    149e <inter_motion+0x36e>
mov    -0x10(%rbp),%rax
movslq -0x98(%rbp),%rcx
movslq -0x7c(%rbp,%rcx,4),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x94(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x98(%rbp),%rax
movsd  %xmm0,-0x50(%rbp,%rax,8)
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    144d <inter_motion+0x31d>
lea    -0x70(%rbp),%rdi
lea    -0x50(%rbp),%rsi
movsd  -0x20(%rbp),%xmm0
call   1040 <polint@plt>
mov    -0x28(%rbp),%rax
movslq -0x94(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1436 <inter_motion+0x306>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inter_motion>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rsi,%r13
mov    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsd  0x10(%rdi,%rbx,8),%xmm1
add    $0x1,%rbx
ucomisd %xmm1,%xmm0
ja     1150 <inter_motion+0x20>
lea    0x2(%rbx),%rax
mov    %eax,%esi
movsd  (%rdi,%rsi,8),%xmm4
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
movapd %xmm1,%xmm3
unpcklpd %xmm4,%xmm3
subpd  %xmm3,%xmm2
andpd  0xe79(%rip),%xmm2
lea    0x1(%rbx),%rsi
pshufd $0xee,%xmm2,%xmm3
ucomisd %xmm2,%xmm3
mov    %rcx,0x38(%rsp)
jb     11a3 <inter_motion+0x73>
cmp    %edx,%eax
jge    11a3 <inter_motion+0x73>
test   %ebx,%ebx
jne    11f6 <inter_motion+0xc6>
ucomisd %xmm2,%xmm3
jb     11d4 <inter_motion+0xa4>
test   %ebx,%ebx
jne    11d4 <inter_motion+0xa4>
lea    0x3(%rbx),%rbp
cmp    %edx,%ebp
jg     11d4 <inter_motion+0xa4>
movsd  %xmm1,0x20(%rsp)
movsd  %xmm4,0x28(%rsp)
mov    %ebp,%eax
movsd  (%rdi,%rax,8),%xmm4
mov    $0x2,%edx
mov    $0x3,%eax
jmp    1224 <inter_motion+0xf4>
ucomisd %xmm3,%xmm2
jbe    130e <inter_motion+0x1de>
lea    0x3(%rbx),%rbp
cmp    %edx,%ebp
jle    120d <inter_motion+0xdd>
test   %ebx,%ebx
je     130e <inter_motion+0x1de>
cmp    %edx,%eax
jg     130e <inter_motion+0x1de>
mov    %ebx,%edx
movsd  (%rdi,%rdx,8),%xmm2
movsd  %xmm2,0x20(%rsp)
movsd  %xmm1,0x28(%rsp)
mov    %esi,%edx
jmp    1227 <inter_motion+0xf7>
movsd  %xmm1,0x20(%rsp)
movsd  %xmm4,0x28(%rsp)
mov    %ebp,%ecx
movsd  (%rdi,%rcx,8),%xmm4
mov    %eax,%edx
mov    %ebp,%eax
mov    %rsi,%rbx
movsd  %xmm4,0x30(%rsp)
movslq %ebx,%rcx
lea    (%rcx,%rcx,2),%rbx
movsd  0x0(%r13,%rbx,8),%xmm1
movsd  %xmm1,(%rsp)
movslq %edx,%rcx
lea    (%rcx,%rcx,2),%rbp
movsd  0x0(%r13,%rbp,8),%xmm1
movsd  %xmm1,0x8(%rsp)
cltq
lea    (%rax,%rax,2),%r14
movsd  0x0(%r13,%r14,8),%xmm1
movsd  %xmm1,0x10(%rsp)
lea    0x20(%rsp),%r12
mov    %rsp,%rsi
mov    %r12,%rdi
movapd %xmm0,0x40(%rsp)
call   1040 <polint@plt>
mov    0x38(%rsp),%r15
movsd  %xmm0,(%r15)
movsd  0x8(%r13,%rbx,8),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%r13,%rbp,8),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%r13,%r14,8),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    %r12,%rdi
mov    %rsp,%rsi
movaps 0x40(%rsp),%xmm0
call   1040 <polint@plt>
movsd  %xmm0,0x8(%r15)
movsd  0x10(%r13,%rbx,8),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%r13,%rbp,8),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%r13,%r14,8),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    %r12,%rdi
mov    %rsp,%rsi
movaps 0x40(%rsp),%xmm0
call   1040 <polint@plt>
movsd  %xmm0,0x10(%r15)
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcfb(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@str = [28 x i8] c"Problem with motion data...\00"
define void @inter_motion(double* nocapture %0, [3 x double]* nocapture %1, i32 %2, double %3, double* nocapture writeonly %4) {
%6 = alloca [3 x double]
%7 = alloca [3 x double]
%8 = bitcast [3 x double]* %6 to i8*
%9 = bitcast [3 x double]* %7 to i8*
br label %10
10: ; preds = %10, %5
%11 = phi i64 [ %12, %10 ], [ 0, %5 ]
%12 = add nuw nsw i64 %11, 1
%13 = getelementptr inbounds double, double* %0, i64 %12
%14 = load double, double* %13
%15 = fcmp olt double %14, %3
br i1 %15, label %10, label %16
16: ; preds = %10
%17 = trunc i64 %11 to i32
%18 = trunc i64 %12 to i32
%19 = add nuw nsw i32 %17, 2
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds double, double* %0, i64 %20
%22 = load double, double* %21
%23 = insertelement <2 x double> poison, double %3, i64 0
%24 = shufflevector <2 x double> %23, <2 x double> poison, <2 x i32> zeroinitializer
%25 = insertelement <2 x double> poison, double %14, i64 0
%26 = insertelement <2 x double> %25, double %22, i64 1
%27 = fsub <2 x double> %24, %26
%28 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %27)
%29 = extractelement <2 x double> %28, i64 0
%30 = extractelement <2 x double> %28, i64 1
%31 = fcmp ole double %29, %30
%32 = icmp sge i32 %19, %2
%33 = xor i1 %31, true
%34 = select i1 %33, i1 true, i1 %32
%35 = icmp eq i32 %17, 0
%36 = select i1 %34, i1 true, i1 %35
br i1 %36, label %43, label %37
37: ; preds = %16
%38 = and i64 %11, 4294967295
%39 = getelementptr inbounds double, double* %0, i64 %38
%40 = load double, double* %39
%41 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
store double %40, double* %41
%42 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
store double %14, double* %42
br label %77
43: ; preds = %16
br i1 %31, label %44, label %54
44: ; preds = %43
%45 = add nuw nsw i32 %17, 3
%46 = icmp sle i32 %45, %2
%47 = and i1 %35, %46
br i1 %47, label %48, label %54
48: ; preds = %44
%49 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
store double %14, double* %49
%50 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
store double %22, double* %50
%51 = zext i32 %45 to i64
%52 = getelementptr inbounds double, double* %0, i64 %51
%53 = load double, double* %52
br label %77
54: ; preds = %44, %43
%55 = fcmp ogt double %29, %30
br i1 %55, label %56, label %74
56: ; preds = %54
%57 = add nuw nsw i32 %17, 3
%58 = icmp sgt i32 %57, %2
br i1 %58, label %65, label %59
59: ; preds = %56
%60 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
store double %14, double* %60
%61 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
store double %22, double* %61
%62 = zext i32 %57 to i64
%63 = getelementptr inbounds double, double* %0, i64 %62
%64 = load double, double* %63
br label %77
65: ; preds = %56
%66 = icmp sgt i32 %19, %2
%67 = or i1 %35, %66
br i1 %67, label %74, label %68
68: ; preds = %65
%69 = and i64 %11, 4294967295
%70 = getelementptr inbounds double, double* %0, i64 %69
%71 = load double, double* %70
%72 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
store double %71, double* %72
%73 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
store double %14, double* %73
br label %77
74: ; preds = %54, %65
%75 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%76 = tail call i32 @exit(i32 1)
unreachable
77: ; preds = %48, %68, %59, %37
%78 = phi double [ %53, %48 ], [ %22, %68 ], [ %64, %59 ], [ %22, %37 ]
%79 = phi i32 [ 3, %48 ], [ %19, %68 ], [ %57, %59 ], [ %19, %37 ]
%80 = phi i32 [ 2, %48 ], [ %18, %68 ], [ %19, %59 ], [ %18, %37 ]
%81 = phi i64 [ %12, %48 ], [ %11, %68 ], [ %12, %59 ], [ %11, %37 ]
%82 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
store double %78, double* %82
%83 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%84 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%85 = shl i64 %81, 32
%86 = ashr exact i64 %85, 32
%87 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 %86, i64 0
%88 = load double, double* %87
store double %88, double* %84
%89 = sext i32 %80 to i64
%90 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 %89, i64 0
%91 = load double, double* %90
%92 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 1
store double %91, double* %92
%93 = sext i32 %79 to i64
%94 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 %93, i64 0
%95 = load double, double* %94
%96 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 2
store double %95, double* %96
%97 = call double @polint(double* %83, double* %84, double %3)
store double %97, double* %4
%98 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 %86, i64 1
%99 = load double, double* %98
store double %99, double* %84
%100 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 %89, i64 1
%101 = load double, double* %100
store double %101, double* %92
%102 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 %93, i64 1
%103 = load double, double* %102
store double %103, double* %96
%104 = call double @polint(double* %83, double* %84, double %3)
%105 = getelementptr inbounds double, double* %4, i64 1
store double %104, double* %105
%106 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 %86, i64 2
%107 = load double, double* %106
store double %107, double* %84
%108 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 %89, i64 2
%109 = load double, double* %108
store double %109, double* %92
%110 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 %93, i64 2
%111 = load double, double* %110
store double %111, double* %96
%112 = call double @polint(double* %83, double* %84, double %3)
%113 = getelementptr inbounds double, double* %4, i64 2
store double %112, double* %113
ret void
}