#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 */
double M_PI;
double atan2(double, double);
int /*<<< orphan*/ computeFractionalPixel(double *, int, double, int, int,
                                          double *);
size_t ind(int, int);
void c_circCurvature(double *points, int numberOfPoints, double edgeLength,
                     double *chainCodeLengths, double *angles) {
  int lastArrayIndex = (numberOfPoints - 1);
  int p1I = lastArrayIndex;
  int pvI = 0;
  double pvLength = chainCodeLengths[p1I] + chainCodeLengths[pvI];
  double e1 = pvLength - chainCodeLengths[p1I];
  while ((p1I > 0) && (e1 < edgeLength)) {
    p1I = p1I - 1;
    e1 = pvLength - chainCodeLengths[p1I];
  }
  int p2I = pvI;
  double e2;
  int nextP1I, prevP2I;
  double de1, de2, nextE1;
  double p1[2], p2[2];
  double a1, a2;
  while (pvI < numberOfPoints) {
    if (p2I >= pvI)
      e2 = chainCodeLengths[p2I] - chainCodeLengths[pvI];
    else
      e2 = chainCodeLengths[numberOfPoints - 1] + chainCodeLengths[p2I] -
           chainCodeLengths[pvI];
    while (e2 < edgeLength) {
      p2I = p2I + 1;
      if (p2I > lastArrayIndex)
        p2I = p2I - numberOfPoints;
      if (p2I >= pvI)
        e2 = chainCodeLengths[p2I] - chainCodeLengths[pvI];
      else
        e2 = chainCodeLengths[numberOfPoints - 1] + chainCodeLengths[p2I] -
             chainCodeLengths[pvI];
    }
    de1 = e1 - edgeLength;
    nextP1I = (p1I < lastArrayIndex) ? p1I + 1 : p1I - lastArrayIndex;
    computeFractionalPixel(points, numberOfPoints, de1, nextP1I, p1I, p1);
    de2 = e2 - edgeLength;
    prevP2I = (p2I > 0) ? p2I - 1 : p2I + lastArrayIndex;
    computeFractionalPixel(points, numberOfPoints, de2, prevP2I, p2I, p2);
    a2 = atan2(points[ind(pvI, 0)] - p2[0], points[ind(pvI, 1)] - p2[1]);
    a1 = atan2(p1[0] - points[ind(pvI, 0)], p1[1] - points[ind(pvI, 1)]);
    angles[pvI] = a2 - a1;
    if (angles[pvI] > M_PI)
      angles[pvI] = angles[pvI] - 2 * M_PI;
    else if (angles[pvI] < -1 * M_PI)
      angles[pvI] = angles[pvI] + 2 * M_PI;
    angles[pvI] = angles[pvI] * 180 / M_PI;
    pvI = pvI + 1;
    if (pvI <= lastArrayIndex) {
      if (p1I <= pvI)
        e1 = chainCodeLengths[pvI] - chainCodeLengths[p1I];
      else
        e1 = chainCodeLengths[lastArrayIndex] + chainCodeLengths[pvI] -
             chainCodeLengths[p1I];
      nextE1 = e1;
      nextP1I = p1I;
      while (nextE1 > edgeLength) {
        e1 = nextE1;
        p1I = nextP1I;
        nextP1I = p1I + 1;
        if (nextP1I > lastArrayIndex)
          nextP1I = nextP1I - numberOfPoints;
        if (nextP1I <= pvI)
          nextE1 = chainCodeLengths[pvI] - chainCodeLengths[nextP1I];
        else
          nextE1 = chainCodeLengths[lastArrayIndex] + chainCodeLengths[pvI] -
                   chainCodeLengths[nextP1I];
      }
    }
  }
}


x86 assembly (clang, -O0):
<c_circCurvature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x30(%rbp)
mov    %al,-0xb1(%rbp)
jle    11c4 <c_circCurvature+0x94>
movsd  -0x48(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0xb1(%rbp)
mov    -0xb1(%rbp),%al
test   $0x1,%al
jne    11d7 <c_circCurvature+0xa7>
jmp    11fc <c_circCurvature+0xcc>
mov    -0x30(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x30(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    119b <c_circCurvature+0x6b>
mov    -0x34(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    16f8 <c_circCurvature+0x5c8>
mov    -0x4c(%rbp),%eax
cmp    -0x34(%rbp),%eax
jl     123e <c_circCurvature+0x10e>
mov    -0x20(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    126f <c_circCurvature+0x13f>
mov    -0x20(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x4c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    1274 <c_circCurvature+0x144>
movsd  -0x58(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    130c <c_circCurvature+0x1dc>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jle    12a6 <c_circCurvature+0x176>
mov    -0x4c(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x34(%rbp),%eax
jl     12d6 <c_circCurvature+0x1a6>
mov    -0x20(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    1307 <c_circCurvature+0x1d7>
mov    -0x20(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x4c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    1274 <c_circCurvature+0x144>
movsd  -0x48(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1338 <c_circCurvature+0x208>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
jmp    1344 <c_circCurvature+0x214>
mov    -0x30(%rbp),%eax
sub    -0x2c(%rbp),%eax
mov    %eax,-0xb8(%rbp)
mov    -0xb8(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
movsd  -0x68(%rbp),%xmm0
mov    -0x5c(%rbp),%edx
mov    -0x30(%rbp),%ecx
lea    -0x90(%rbp),%r8
call   1050 <computeFractionalPixel@plt>
movsd  -0x58(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
cmpl   $0x0,-0x4c(%rbp)
jle    1395 <c_circCurvature+0x265>
mov    -0x4c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xbc(%rbp)
jmp    13a1 <c_circCurvature+0x271>
mov    -0x4c(%rbp),%eax
add    -0x2c(%rbp),%eax
mov    %eax,-0xbc(%rbp)
mov    -0xbc(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
movsd  -0x70(%rbp),%xmm0
mov    -0x60(%rbp),%edx
mov    -0x4c(%rbp),%ecx
lea    -0xa0(%rbp),%r8
call   1050 <computeFractionalPixel@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x100(%rbp)
mov    -0x34(%rbp),%edi
xor    %esi,%esi
call   1040 <ind@plt>
mov    %rax,%rcx
mov    -0x100(%rbp),%rax
movsd  (%rax,%rcx,8),%xmm0
subsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xf8(%rbp)
ff
mov    -0x8(%rbp),%rax
mov    %rax,-0xf0(%rbp)
mov    -0x34(%rbp),%edi
mov    $0x1,%esi
call   1040 <ind@plt>
movsd  -0xf8(%rbp),%xmm0
ff
mov    %rax,%rcx
mov    -0xf0(%rbp),%rax
movsd  (%rax,%rcx,8),%xmm1
subsd  -0x98(%rbp),%xmm1
ff
call   1030 <atan2@plt>
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xe8(%rbp)
ff
mov    -0x8(%rbp),%rax
mov    %rax,-0xe0(%rbp)
mov    -0x34(%rbp),%edi
xor    %esi,%esi
call   1040 <ind@plt>
movsd  -0xe8(%rbp),%xmm0
ff
mov    %rax,%rcx
mov    -0xe0(%rbp),%rax
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xd8(%rbp)
ff
mov    -0x8(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    -0x34(%rbp),%edi
mov    $0x1,%esi
call   1040 <ind@plt>
movsd  -0xd8(%rbp),%xmm1
ff
movsd  -0xd0(%rbp),%xmm0
ff
mov    %rax,%rcx
mov    -0xc8(%rbp),%rax
subsd  (%rax,%rcx,8),%xmm1
call   1030 <atan2@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
subsd  -0xa8(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x2adf(%rip),%rax
ucomisd (%rax),%xmm0
jbe    1545 <c_circCurvature+0x415>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x2ac1(%rip),%rax
movsd  (%rax),%xmm1
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    15a1 <c_circCurvature+0x471>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xaa6(%rip),%xmm0
mov    0x2a87(%rip),%rax
mulsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    159c <c_circCurvature+0x46c>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    0x2a65(%rip),%rax
movsd  (%rax),%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    15a1 <c_circCurvature+0x471>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  0xa57(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    0x2a2b(%rip),%rax
divsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jg     16f3 <c_circCurvature+0x5c3>
mov    -0x30(%rbp),%eax
cmp    -0x34(%rbp),%eax
jg     1613 <c_circCurvature+0x4e3>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    163f <c_circCurvature+0x50f>
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x5c(%rbp)
movsd  -0x78(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    16ee <c_circCurvature+0x5be>
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x5c(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jle    168d <c_circCurvature+0x55d>
mov    -0x5c(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x34(%rbp),%eax
jg     16bd <c_circCurvature+0x58d>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x5c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    16e9 <c_circCurvature+0x5b9>
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x5c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    164f <c_circCurvature+0x51f>
jmp    16f3 <c_circCurvature+0x5c3>
jmp    1202 <c_circCurvature+0xd2>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_circCurvature>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %rdx,%r12
movapd %xmm0,%xmm3
mov    %esi,%ebx
mov    %rdi,0x40(%rsp)
lea    -0x1(%rbx),%r15d
movslq %esi,%r8
movsd  -0x8(%rdx,%r8,8),%xmm1
movsd  (%rdx),%xmm0
addsd  %xmm1,%xmm0
movapd %xmm0,%xmm4
subsd  %xmm1,%xmm4
cmp    $0x2,%r8d
jl     14d5 <c_circCurvature+0x3a5>
ucomisd %xmm4,%xmm3
mov    %r15d,%r13d
jbe    11b0 <c_circCurvature+0x80>
mov    %r15d,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r13,%rax
add    $0xffffffffffffffff,%r13
mov    %r13d,%edx
movapd %xmm0,%xmm4
subsd  (%r12,%rdx,8),%xmm4
cmp    $0x2,%rax
jb     11b0 <c_circCurvature+0x80>
ucomisd %xmm4,%xmm3
ja     1190 <c_circCurvature+0x60>
test   %ebx,%ebx
jle    14e0 <c_circCurvature+0x3b0>
add    $0xffffffffffffffff,%r8
mov    $0x1,%eax
sub    %ebx,%eax
mov    %eax,0x34(%rsp)
mov    %ebx,%eax
mov    %rax,0x48(%rsp)
xor    %eax,%eax
xor    %ebp,%ebp
mov    %rcx,0x50(%rsp)
movsd  %xmm3,0x18(%rsp)
mov    %rbx,0x20(%rsp)
mov    %r15d,0x14(%rsp)
mov    %r8,0x38(%rsp)
jmp    1205 <c_circCurvature+0xd5>
xchg   %ax,%ax
movapd %xmm2,%xmm4
mov    %r13d,%ecx
mov    %ecx,%r13d
cmp    0x48(%rsp),%rax
je     14e0 <c_circCurvature+0x3b0>
mov    %rax,%r14
movslq %ebp,%rax
cmp    %rax,%r14
jle    1220 <c_circCurvature+0xf0>
movsd  (%r12,%r8,8),%xmm1
addsd  (%r12,%rax,8),%xmm1
jmp    1226 <c_circCurvature+0xf6>
xchg   %ax,%ax
movsd  (%r12,%rax,8),%xmm1
movsd  (%r12,%r14,8),%xmm0
jmp    123c <c_circCurvature+0x10c>
xchg   %ax,%ax
movsd  (%r12,%r8,8),%xmm1
addsd  (%r12,%rax,8),%xmm1
subsd  %xmm0,%xmm1
ucomisd %xmm1,%xmm3
jbe    1270 <c_circCurvature+0x140>
xor    %eax,%eax
cmp    %r15d,%ebp
jl     124f <c_circCurvature+0x11f>
mov    %ebx,%eax
neg    %eax
add    %eax,%ebp
add    $0x1,%ebp
movslq %ebp,%rax
cmp    %rax,%r14
jg     1230 <c_circCurvature+0x100>
movsd  (%r12,%rax,8),%xmm1
jmp    123c <c_circCurvature+0x10c>
cs nopw 0x0(%rax,%rax,1)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm4,0x28(%rsp)
movapd %xmm4,%xmm0
subsd  %xmm3,%xmm0
cmp    %r15d,%r13d
mov    0x34(%rsp),%edx
mov    $0x1,%eax
cmovl  %eax,%edx
add    %r13d,%edx
mov    0x40(%rsp),%rdi
mov    %ebx,%esi
mov    %r13d,%ecx
lea    0x70(%rsp),%r8
call   1050 <computeFractionalPixel@plt>
movsd  0x8(%rsp),%xmm0
subsd  0x18(%rsp),%xmm0
test   %ebp,%ebp
mov    %r15d,%edx
mov    $0xffffffff,%eax
cmovg  %eax,%edx
add    %ebp,%edx
mov    0x40(%rsp),%r15
mov    %r15,%rdi
mov    %ebx,%esi
mov    %ebp,%ecx
lea    0x60(%rsp),%r8
call   1050 <computeFractionalPixel@plt>
mov    %r14d,%edi
xor    %esi,%esi
call   1040 <ind@plt>
movsd  (%r15,%rax,8),%xmm0
subsd  0x60(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r14d,%edi
mov    $0x1,%esi
call   1040 <ind@plt>
movsd  (%r15,%rax,8),%xmm1
subsd  0x68(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
call   1030 <atan2@plt>
movaps %xmm0,0x80(%rsp)
movsd  0x70(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r14d,%edi
xor    %esi,%esi
call   1040 <ind@plt>
movsd  0x8(%rsp),%xmm0
subsd  (%r15,%rax,8),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x78(%rsp),%xmm0
movsd  %xmm0,0x58(%rsp)
mov    %r14d,%edi
mov    $0x1,%esi
call   1040 <ind@plt>
movsd  0x58(%rsp),%xmm1
subsd  (%r15,%rax,8),%xmm1
movsd  0x8(%rsp),%xmm0
call   1030 <atan2@plt>
movapd 0x80(%rsp),%xmm2
subsd  %xmm0,%xmm2
mov    0x50(%rsp),%rax
movsd  %xmm2,(%rax,%r14,8)
mov    0x2c4e(%rip),%rcx
movsd  (%rcx),%xmm0
ucomisd %xmm0,%xmm2
jbe    13d0 <c_circCurvature+0x2a0>
addsd  %xmm0,%xmm0
subsd  %xmm0,%xmm2
movsd  0x18(%rsp),%xmm3
mov    0x20(%rsp),%rbx
mov    0x14(%rsp),%r15d
mov    0x38(%rsp),%r8
jmp    13ff <c_circCurvature+0x2cf>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movapd %xmm0,%xmm1
xorpd  0xc24(%rip),%xmm1
ucomisd %xmm2,%xmm1
mov    0x38(%rsp),%r8
jbe    1410 <c_circCurvature+0x2e0>
addsd  %xmm0,%xmm0
addsd  %xmm0,%xmm2
movsd  0x18(%rsp),%xmm3
mov    0x20(%rsp),%rbx
mov    0x14(%rsp),%r15d
movsd  0x28(%rsp),%xmm4
xor    %edi,%edi
movsd  %xmm2,(%rax,%r14,8)
jmp    1428 <c_circCurvature+0x2f8>
nop
movsd  0x18(%rsp),%xmm3
mov    0x20(%rsp),%rbx
mov    0x14(%rsp),%r15d
movsd  0x28(%rsp),%xmm4
xor    %edi,%edi
mulsd  0xbe0(%rip),%xmm2
divsd  (%rcx),%xmm2
movsd  %xmm2,(%rax,%r14,8)
lea    0x1(%r14),%rax
cmp    %r8,%r14
jge    11f4 <c_circCurvature+0xc4>
movslq %r13d,%rcx
cmp    %rcx,%rax
jge    1470 <c_circCurvature+0x340>
movsd  (%r12,%rax,8),%xmm0
movsd  (%r12,%r8,8),%xmm2
addsd  %xmm0,%xmm2
jmp    147a <c_circCurvature+0x34a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%r12,%rax,8),%xmm2
movapd %xmm2,%xmm0
subsd  (%r12,%rcx,8),%xmm2
ucomisd %xmm3,%xmm2
jbe    11f0 <c_circCurvature+0xc0>
movapd %xmm0,%xmm1
jmp    14a8 <c_circCurvature+0x378>
movapd %xmm1,%xmm2
subsd  (%r12,%rdx,8),%xmm2
ucomisd %xmm3,%xmm2
movapd %xmm0,%xmm1
jbe    11f7 <c_circCurvature+0xc7>
mov    %r13d,%ecx
movapd %xmm2,%xmm4
cmp    %r15d,%r13d
mov    %ebx,%edx
cmovl  %edi,%edx
neg    %edx
lea    (%rcx,%rdx,1),%r13d
add    $0x1,%r13d
movslq %r13d,%rdx
cmp    %rdx,%rax
jge    1490 <c_circCurvature+0x360>
movsd  (%r12,%r8,8),%xmm1
addsd  %xmm0,%xmm1
jmp    1490 <c_circCurvature+0x360>
mov    %r15d,%r13d
test   %ebx,%ebx
jg     11b8 <c_circCurvature+0x88>
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define void @c_circCurvature(double* %0, i32 %1, double %2, double* %3, double* %4) {
%6 = alloca double*
%7 = alloca i32
%8 = alloca double
%9 = alloca double*
%10 = alloca double*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca double
%15 = alloca double
%16 = alloca i32
%17 = alloca double
%18 = alloca i32
%19 = alloca i32
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca [2 x double]
%24 = alloca [2 x double]
%25 = alloca double
%26 = alloca double
store double* %0, double** %6
store i32 %1, i32* %7
store double %2, double* %8
store double* %3, double** %9
store double* %4, double** %10
%27 = load i32, i32* %7
%28 = sub nsw i32 %27, 1
store i32 %28, i32* %11
%29 = load i32, i32* %11
store i32 %29, i32* %12
store i32 0, i32* %13
%30 = load double*, double** %9
%31 = load i32, i32* %12
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds double, double* %30, i64 %32
%34 = load double, double* %33
%35 = load double*, double** %9
%36 = load i32, i32* %13
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double, double* %35, i64 %37
%39 = load double, double* %38
%40 = fadd double %34, %39
store double %40, double* %14
%41 = load double, double* %14
%42 = load double*, double** %9
%43 = load i32, i32* %12
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds double, double* %42, i64 %44
%46 = load double, double* %45
%47 = fsub double %41, %46
store double %47, double* %15
br label %48
48: ; preds = %57, %5
%49 = load i32, i32* %12
%50 = icmp sgt i32 %49, 0
br i1 %50, label %51, label %55
51: ; preds = %48
%52 = load double, double* %15
%53 = load double, double* %8
%54 = fcmp olt double %52, %53
br label %55
55: ; preds = %51, %48
%56 = phi i1 [ false, %48 ], [ %54, %51 ]
br i1 %56, label %57, label %67
57: ; preds = %55
%58 = load i32, i32* %12
%59 = sub nsw i32 %58, 1
store i32 %59, i32* %12
%60 = load double, double* %14
%61 = load double*, double** %9
%62 = load i32, i32* %12
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds double, double* %61, i64 %63
%65 = load double, double* %64
%66 = fsub double %60, %65
store double %66, double* %15
br label %48
67: ; preds = %55
%68 = load i32, i32* %13
store i32 %68, i32* %16
br label %69
69: ; preds = %392, %67
%70 = load i32, i32* %13
%71 = load i32, i32* %7
%72 = icmp slt i32 %70, %71
br i1 %72, label %73, label %393
73: ; preds = %69
%74 = load i32, i32* %16
%75 = load i32, i32* %13
%76 = icmp sge i32 %74, %75
br i1 %76, label %77, label %89
77: ; preds = %73
%78 = load double*, double** %9
%79 = load i32, i32* %16
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds double, double* %78, i64 %80
%82 = load double, double* %81
%83 = load double*, double** %9
%84 = load i32, i32* %13
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds double, double* %83, i64 %85
%87 = load double, double* %86
%88 = fsub double %82, %87
store double %88, double* %17
br label %108
89: ; preds = %73
%90 = load double*, double** %9
%91 = load i32, i32* %7
%92 = sub nsw i32 %91, 1
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds double, double* %90, i64 %93
%95 = load double, double* %94
%96 = load double*, double** %9
%97 = load i32, i32* %16
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds double, double* %96, i64 %98
%100 = load double, double* %99
%101 = fadd double %95, %100
%102 = load double*, double** %9
%103 = load i32, i32* %13
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds double, double* %102, i64 %104
%106 = load double, double* %105
%107 = fsub double %101, %106
store double %107, double* %17
br label %108
108: ; preds = %89, %77
br label %109
109: ; preds = %158, %108
%110 = load double, double* %17
%111 = load double, double* %8
%112 = fcmp olt double %110, %111
br i1 %112, label %113, label %159
113: ; preds = %109
%114 = load i32, i32* %16
%115 = add nsw i32 %114, 1
store i32 %115, i32* %16
%116 = load i32, i32* %16
%117 = load i32, i32* %11
%118 = icmp sgt i32 %116, %117
br i1 %118, label %119, label %123
119: ; preds = %113
%120 = load i32, i32* %16
%121 = load i32, i32* %7
%122 = sub nsw i32 %120, %121
store i32 %122, i32* %16
br label %123
123: ; preds = %119, %113
%124 = load i32, i32* %16
%125 = load i32, i32* %13
%126 = icmp sge i32 %124, %125
br i1 %126, label %127, label %139
127: ; preds = %123
%128 = load double*, double** %9
%129 = load i32, i32* %16
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds double, double* %128, i64 %130
%132 = load double, double* %131
%133 = load double*, double** %9
%134 = load i32, i32* %13
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds double, double* %133, i64 %135
%137 = load double, double* %136
%138 = fsub double %132, %137
store double %138, double* %17
br label %158
139: ; preds = %123
%140 = load double*, double** %9
%141 = load i32, i32* %7
%142 = sub nsw i32 %141, 1
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds double, double* %140, i64 %143
%145 = load double, double* %144
%146 = load double*, double** %9
%147 = load i32, i32* %16
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds double, double* %146, i64 %148
%150 = load double, double* %149
%151 = fadd double %145, %150
%152 = load double*, double** %9
%153 = load i32, i32* %13
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds double, double* %152, i64 %154
%156 = load double, double* %155
%157 = fsub double %151, %156
store double %157, double* %17
br label %158
158: ; preds = %139, %127
br label %109
159: ; preds = %109
%160 = load double, double* %15
%161 = load double, double* %8
%162 = fsub double %160, %161
store double %162, double* %20
%163 = load i32, i32* %12
%164 = load i32, i32* %11
%165 = icmp slt i32 %163, %164
br i1 %165, label %166, label %169
166: ; preds = %159
%167 = load i32, i32* %12
%168 = add nsw i32 %167, 1
br label %173
169: ; preds = %159
%170 = load i32, i32* %12
%171 = load i32, i32* %11
%172 = sub nsw i32 %170, %171
br label %173
173: ; preds = %169, %166
%174 = phi i32 [ %168, %166 ], [ %172, %169 ]
store i32 %174, i32* %18
%175 = load double*, double** %6
%176 = load i32, i32* %7
%177 = load double, double* %20
%178 = load i32, i32* %18
%179 = load i32, i32* %12
%180 = getelementptr inbounds [2 x double], [2 x double]* %23, i64 0, i64 0
%181 = call i32 @computeFractionalPixel(double* %175, i32 %176, double %177, i32 %178, i32 %179, double* %180)
%182 = load double, double* %17
%183 = load double, double* %8
%184 = fsub double %182, %183
store double %184, double* %21
%185 = load i32, i32* %16
%186 = icmp sgt i32 %185, 0
br i1 %186, label %187, label %190
187: ; preds = %173
%188 = load i32, i32* %16
%189 = sub nsw i32 %188, 1
br label %194
190: ; preds = %173
%191 = load i32, i32* %16
%192 = load i32, i32* %11
%193 = add nsw i32 %191, %192
br label %194
194: ; preds = %190, %187
%195 = phi i32 [ %189, %187 ], [ %193, %190 ]
store i32 %195, i32* %19
%196 = load double*, double** %6
%197 = load i32, i32* %7
%198 = load double, double* %21
%199 = load i32, i32* %19
%200 = load i32, i32* %16
%201 = getelementptr inbounds [2 x double], [2 x double]* %24, i64 0, i64 0
%202 = call i32 @computeFractionalPixel(double* %196, i32 %197, double %198, i32 %199, i32 %200, double* %201)
%203 = load double*, double** %6
%204 = load i32, i32* %13
%205 = call i64 @ind(i32 %204, i32 0)
%206 = getelementptr inbounds double, double* %203, i64 %205
%207 = load double, double* %206
%208 = getelementptr inbounds [2 x double], [2 x double]* %24, i64 0, i64 0
%209 = load double, double* %208
%210 = fsub double %207, %209
%211 = load double*, double** %6
%212 = load i32, i32* %13
%213 = call i64 @ind(i32 %212, i32 1)
%214 = getelementptr inbounds double, double* %211, i64 %213
%215 = load double, double* %214
%216 = getelementptr inbounds [2 x double], [2 x double]* %24, i64 0, i64 1
%217 = load double, double* %216
%218 = fsub double %215, %217
%219 = call double @atan2(double %210, double %218)
store double %219, double* %26
%220 = getelementptr inbounds [2 x double], [2 x double]* %23, i64 0, i64 0
%221 = load double, double* %220
%222 = load double*, double** %6
%223 = load i32, i32* %13
%224 = call i64 @ind(i32 %223, i32 0)
%225 = getelementptr inbounds double, double* %222, i64 %224
%226 = load double, double* %225
%227 = fsub double %221, %226
%228 = getelementptr inbounds [2 x double], [2 x double]* %23, i64 0, i64 1
%229 = load double, double* %228
%230 = load double*, double** %6
%231 = load i32, i32* %13
%232 = call i64 @ind(i32 %231, i32 1)
%233 = getelementptr inbounds double, double* %230, i64 %232
%234 = load double, double* %233
%235 = fsub double %229, %234
%236 = call double @atan2(double %227, double %235)
store double %236, double* %25
%237 = load double, double* %26
%238 = load double, double* %25
%239 = fsub double %237, %238
%240 = load double*, double** %10
%241 = load i32, i32* %13
%242 = sext i32 %241 to i64
%243 = getelementptr inbounds double, double* %240, i64 %242
store double %239, double* %243
%244 = load double*, double** %10
%245 = load i32, i32* %13
%246 = sext i32 %245 to i64
%247 = getelementptr inbounds double, double* %244, i64 %246
%248 = load double, double* %247
%249 = load double, double* @M_PI
%250 = fcmp ogt double %248, %249
br i1 %250, label %251, label %263
251: ; preds = %194
%252 = load double*, double** %10
%253 = load i32, i32* %13
%254 = sext i32 %253 to i64
%255 = getelementptr inbounds double, double* %252, i64 %254
%256 = load double, double* %255
%257 = load double, double* @M_PI
%258 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %257, double %256)
%259 = load double*, double** %10
%260 = load i32, i32* %13
%261 = sext i32 %260 to i64
%262 = getelementptr inbounds double, double* %259, i64 %261
store double %258, double* %262
br label %285
263: ; preds = %194
%264 = load double*, double** %10
%265 = load i32, i32* %13
%266 = sext i32 %265 to i64
%267 = getelementptr inbounds double, double* %264, i64 %266
%268 = load double, double* %267
%269 = load double, double* @M_PI
%270 = fmul double -1.000000e+00, %269
%271 = fcmp olt double %268, %270
br i1 %271, label %272, label %284
272: ; preds = %263
%273 = load double*, double** %10
%274 = load i32, i32* %13
%275 = sext i32 %274 to i64
%276 = getelementptr inbounds double, double* %273, i64 %275
%277 = load double, double* %276
%278 = load double, double* @M_PI
%279 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %278, double %277)
%280 = load double*, double** %10
%281 = load i32, i32* %13
%282 = sext i32 %281 to i64
%283 = getelementptr inbounds double, double* %280, i64 %282
store double %279, double* %283
br label %284
284: ; preds = %272, %263
br label %285
285: ; preds = %284, %251
%286 = load double*, double** %10
%287 = load i32, i32* %13
%288 = sext i32 %287 to i64
%289 = getelementptr inbounds double, double* %286, i64 %288
%290 = load double, double* %289
%291 = fmul double %290, 1.800000e+02
%292 = load double, double* @M_PI
%293 = fdiv double %291, %292
%294 = load double*, double** %10
%295 = load i32, i32* %13
%296 = sext i32 %295 to i64
%297 = getelementptr inbounds double, double* %294, i64 %296
store double %293, double* %297
%298 = load i32, i32* %13
%299 = add nsw i32 %298, 1
store i32 %299, i32* %13
%300 = load i32, i32* %13
%301 = load i32, i32* %11
%302 = icmp sle i32 %300, %301
br i1 %302, label %303, label %392
303: ; preds = %285
%304 = load i32, i32* %12
%305 = load i32, i32* %13
%306 = icmp sle i32 %304, %305
br i1 %306, label %307, label %319
307: ; preds = %303
%308 = load double*, double** %9
%309 = load i32, i32* %13
%310 = sext i32 %309 to i64
%311 = getelementptr inbounds double, double* %308, i64 %310
%312 = load double, double* %311
%313 = load double*, double** %9
%314 = load i32, i32* %12
%315 = sext i32 %314 to i64
%316 = getelementptr inbounds double, double* %313, i64 %315
%317 = load double, double* %316
%318 = fsub double %312, %317
store double %318, double* %15
br label %337
319: ; preds = %303
%320 = load double*, double** %9
%321 = load i32, i32* %11
%322 = sext i32 %321 to i64
%323 = getelementptr inbounds double, double* %320, i64 %322
%324 = load double, double* %323
%325 = load double*, double** %9
%326 = load i32, i32* %13
%327 = sext i32 %326 to i64
%328 = getelementptr inbounds double, double* %325, i64 %327
%329 = load double, double* %328
%330 = fadd double %324, %329
%331 = load double*, double** %9
%332 = load i32, i32* %12
%333 = sext i32 %332 to i64
%334 = getelementptr inbounds double, double* %331, i64 %333
%335 = load double, double* %334
%336 = fsub double %330, %335
store double %336, double* %15
br label %337
337: ; preds = %319, %307
%338 = load double, double* %15
store double %338, double* %22
%339 = load i32, i32* %12
store i32 %339, i32* %18
br label %340
340: ; preds = %390, %337
%341 = load double, double* %22
%342 = load double, double* %8
%343 = fcmp ogt double %341, %342
br i1 %343, label %344, label %391
344: ; preds = %340
%345 = load double, double* %22
store double %345, double* %15
%346 = load i32, i32* %18
store i32 %346, i32* %12
%347 = load i32, i32* %12
%348 = add nsw i32 %347, 1
store i32 %348, i32* %18
%349 = load i32, i32* %18
%350 = load i32, i32* %11
%351 = icmp sgt i32 %349, %350
br i1 %351, label %352, label %356
352: ; preds = %344
%353 = load i32, i32* %18
%354 = load i32, i32* %7
%355 = sub nsw i32 %353, %354
store i32 %355, i32* %18
br label %356
356: ; preds = %352, %344
%357 = load i32, i32* %18
%358 = load i32, i32* %13
%359 = icmp sle i32 %357, %358
br i1 %359, label %360, label %372
360: ; preds = %356
%361 = load double*, double** %9
%362 = load i32, i32* %13
%363 = sext i32 %362 to i64
%364 = getelementptr inbounds double, double* %361, i64 %363
%365 = load double, double* %364
%366 = load double*, double** %9
%367 = load i32, i32* %18
%368 = sext i32 %367 to i64
%369 = getelementptr inbounds double, double* %366, i64 %368
%370 = load double, double* %369
%371 = fsub double %365, %370
store double %371, double* %22
br label %390
372: ; preds = %356
%373 = load double*, double** %9
%374 = load i32, i32* %11
%375 = sext i32 %374 to i64
%376 = getelementptr inbounds double, double* %373, i64 %375
%377 = load double, double* %376
%378 = load double*, double** %9
%379 = load i32, i32* %13
%380 = sext i32 %379 to i64
%381 = getelementptr inbounds double, double* %378, i64 %380
%382 = load double, double* %381
%383 = fadd double %377, %382
%384 = load double*, double** %9
%385 = load i32, i32* %18
%386 = sext i32 %385 to i64
%387 = getelementptr inbounds double, double* %384, i64 %386
%388 = load double, double* %387
%389 = fsub double %383, %388
store double %389, double* %22
br label %390
390: ; preds = %372, %360
br label %340
391: ; preds = %340
br label %392
392: ; preds = %391, %285
br label %69
393: ; preds = %69
ret void
}

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