#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 asin(double);
int ceil(double);
double cos(double);
double sin(double);
double sqrt(double);
int thickenPoly(double *inX, double *inY, int inN, double *outX, double *outY,
                int outN, double tol, short units, short keepOrig,
                short close) {
  const short LL = 0;
  double accDist = 0.0;
  int allocatedSpace = outN;
  int i;
  int ptLast;
  outN = 0;
  if ((close) && ((inX[0] != inX[inN - 1]) || (inY[0] != inY[inN - 1])))
    ptLast = inN;
  else
    ptLast = inN - 1;
  if (!keepOrig && (inN > 0)) {
    if (outN == allocatedSpace)
      return -1;
    outX[outN] = inX[0];
    outY[outN] = inY[0];
    outN++;
  }
  for (i = 0; i < ptLast; i++) {
    int ptCurr = i;
    int ptNext = ((i + 1) == inN) ? 0 : (i + 1);
    double dX = inX[ptNext] - inX[ptCurr];
    double dY = inY[ptNext] - inY[ptCurr];
    double dist;
    if (units == LL) {
      double dlon = (inX[ptNext] - inX[ptCurr]) * 3.14159265358979323846 / 180;
      double dlat = (inY[ptNext] - inY[ptCurr]) * 3.14159265358979323846 / 180;
      double a = (sin(dlat / 2)) * (sin(dlat / 2)) +
                 cos(inY[ptCurr] * 3.14159265358979323846 / 180) *
                     cos(inY[ptNext] * 3.14159265358979323846 / 180) *
                     (sin(dlon / 2)) * (sin(dlon / 2));
      a = sqrt(a);
      if (a > 1)
        a = 1;
      dist = 6371.3 * (2.0 * asin(a));
    } else {
      dist = sqrt((dX * dX) + (dY * dY));
    }
    if (keepOrig) {
      if (outN == allocatedSpace)
        return -1;
      outX[outN] = inX[ptCurr];
      outY[outN] = inY[ptCurr];
      outN++;
      if (dist > tol) {
        int segments = ceil(dist / tol);
        int j;
        for (j = 1; j < segments; j++) {
          if (outN == allocatedSpace)
            return -1;
          outX[outN] = inX[ptCurr] + (dX * ((double)j / segments));
          outY[outN] = inY[ptCurr] + (dY * ((double)j / segments));
          outN++;
        }
      }
    } else {
      accDist += dist;
      while (accDist >= tol) {
        double frac;
        accDist -= tol;
        frac = ((dist - accDist) / dist);
        if (outN == allocatedSpace)
          return -1;
        outX[outN] = inX[ptCurr] + (dX * frac);
        outY[outN] = inY[ptCurr] + (dY * frac);
        outN++;
      }
    }
  }
  return outN;
}


x86 assembly (clang, -O0):
<thickenPoly>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    0x20(%rbp),%ax
mov    0x18(%rbp),%ax
mov    0x10(%rbp),%ax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9d,-0x34(%rbp)
movsd  %xmm0,-0x40(%rbp)
movw   $0x0,-0x42(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x54(%rbp)
movl   $0x0,-0x34(%rbp)
movswl 0x20(%rbp),%eax
cmp    $0x0,%eax
je     1207 <thickenPoly+0xb7>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
ucomisd (%rax,%rcx,8),%xmm0
jne    11fc <thickenPoly+0xac>
jp     11fc <thickenPoly+0xac>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
ucomisd (%rax,%rcx,8),%xmm0
jne    11fc <thickenPoly+0xac>
jp     11fc <thickenPoly+0xac>
jmp    1207 <thickenPoly+0xb7>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x5c(%rbp)
jmp    1210 <thickenPoly+0xc0>
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x5c(%rbp)
cmpw   $0x0,0x18(%rbp)
jne    1270 <thickenPoly+0x120>
cmpl   $0x0,-0x1c(%rbp)
jle    1270 <thickenPoly+0x120>
mov    -0x34(%rbp),%eax
cmp    -0x54(%rbp),%eax
jne    123d <thickenPoly+0xed>
movl   $0xffffffff,-0x4(%rbp)
jmp    1773 <thickenPoly+0x623>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
movl   $0x0,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0x5c(%rbp),%eax
jge    176d <thickenPoly+0x61d>
mov    -0x58(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x58(%rbp),%eax
add    $0x1,%eax
cmp    -0x1c(%rbp),%eax
jne    12a5 <thickenPoly+0x155>
xor    %eax,%eax
mov    %eax,-0xac(%rbp)
jmp    12b1 <thickenPoly+0x161>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xac(%rbp)
mov    -0xac(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x60(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x60(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x78(%rbp)
movswl 0x10(%rbp),%eax
cmp    $0x0,%eax
jne    150c <thickenPoly+0x3bc>
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x60(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  0xcf1(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcdd(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x18(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x60(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  0xcb7(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xca3(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  0xc7f(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  0xc5e(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0xc0(%rbp)
ff
mov    -0x18(%rbp),%rax
movslq -0x60(%rbp),%rcx
movsd  0xc4d(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  0xc38(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0xd8(%rbp)
ff
mov    -0x18(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  0xc1f(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  0xc0a(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xd8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  0xbd2(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xd0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  0xba2(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <sin@plt>
movsd  -0xc8(%rbp),%xmm1
ff
movsd  -0xc0(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0xb8(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
call   1070 <sqrt@plt>
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  0xb3d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    14dd <thickenPoly+0x38d>
movsd  0xb2b(%rip),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
call   1050 <asin@plt>
movsd  0xb16(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xb22(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    1532 <thickenPoly+0x3e2>
movsd  -0x70(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm1
mulsd  -0x78(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0x80(%rbp)
cmpw   $0x0,0x18(%rbp)
je     1688 <thickenPoly+0x538>
mov    -0x34(%rbp),%eax
cmp    -0x54(%rbp),%eax
jne    1555 <thickenPoly+0x405>
movl   $0xffffffff,-0x4(%rbp)
jmp    1773 <thickenPoly+0x623>
mov    -0x10(%rbp),%rax
movslq -0x60(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x60(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
movsd  -0x80(%rbp),%xmm0
ucomisd -0x40(%rbp),%xmm0
jbe    1683 <thickenPoly+0x533>
movsd  -0x80(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
call   1030 <ceil@plt>
mov    %eax,-0x9c(%rbp)
movl   $0x1,-0xa0(%rbp)
mov    -0xa0(%rbp),%eax
cmp    -0x9c(%rbp),%eax
jge    167e <thickenPoly+0x52e>
mov    -0x34(%rbp),%eax
cmp    -0x54(%rbp),%eax
jne    15eb <thickenPoly+0x49b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1773 <thickenPoly+0x623>
mov    -0x10(%rbp),%rax
movslq -0x60(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x70(%rbp),%xmm0
cvtsi2sdl -0xa0(%rbp),%xmm2
ff
cvtsi2sdl -0x9c(%rbp),%xmm3
ff
divsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x60(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x78(%rbp),%xmm0
cvtsi2sdl -0xa0(%rbp),%xmm2
ff
cvtsi2sdl -0x9c(%rbp),%xmm3
ff
divsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa0(%rbp)
jmp    15c1 <thickenPoly+0x471>
jmp    1683 <thickenPoly+0x533>
jmp    175a <thickenPoly+0x60a>
movsd  -0x80(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
ucomisd -0x40(%rbp),%xmm0
jb     1755 <thickenPoly+0x605>
movsd  -0x40(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x80(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
divsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x34(%rbp),%eax
cmp    -0x54(%rbp),%eax
jne    16e9 <thickenPoly+0x599>
movl   $0xffffffff,-0x4(%rbp)
jmp    1773 <thickenPoly+0x623>
mov    -0x10(%rbp),%rax
movslq -0x60(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x70(%rbp),%xmm0
movsd  -0xa8(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x60(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x78(%rbp),%xmm0
movsd  -0xa8(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1697 <thickenPoly+0x547>
jmp    175a <thickenPoly+0x60a>
jmp    175f <thickenPoly+0x60f>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    1277 <thickenPoly+0x127>
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thickenPoly>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
movapd %xmm0,%xmm3
mov    %rsi,%rbx
mov    %rdi,%r13
cmpw   $0x0,0x100(%rsp)
je     119f <thickenPoly+0x4f>
movsd  0x0(%r13),%xmm0
movslq %edx,%rsi
ucomisd -0x8(%r13,%rsi,8),%xmm0
mov    %edx,%eax
jne    11a2 <thickenPoly+0x52>
jp     11a2 <thickenPoly+0x52>
add    $0xffffffffffffffff,%rsi
movsd  (%rbx),%xmm0
ucomisd (%rbx,%rsi,8),%xmm0
mov    %edx,%eax
jne    11a2 <thickenPoly+0x52>
jp     11a2 <thickenPoly+0x52>
lea    -0x1(%rdx),%eax
movzwl 0xf8(%rsp),%r10d
xor    %ebp,%ebp
test   %edx,%edx
jle    11d8 <thickenPoly+0x88>
test   %r10w,%r10w
jne    11d8 <thickenPoly+0x88>
test   %r9d,%r9d
je     17c9 <thickenPoly+0x679>
movsd  0x0(%r13),%xmm0
movsd  %xmm0,(%rcx)
movsd  (%rbx),%xmm0
movsd  %xmm0,(%r8)
mov    $0x1,%ebp
test   %eax,%eax
jle    17ce <thickenPoly+0x67e>
mov    %edx,%edx
mov    %rdx,0xb0(%rsp)
mov    %eax,%eax
mov    %rax,0xa8(%rsp)
mov    %r9d,0x4c(%rsp)
movslq %r9d,%r9
lea    0x8(%rcx),%rax
mov    %rax,0xa0(%rsp)
lea    0x8(%r8),%rax
mov    %rax,0x98(%rsp)
xor    %r15d,%r15d
xorpd  %xmm4,%xmm4
movsd  %xmm3,0x28(%rsp)
mov    %r8,0x10(%rsp)
mov    %rcx,0x8(%rsp)
mov    %r9,0x18(%rsp)
jmp    1264 <thickenPoly+0x114>
movsd  0x28(%rsp),%xmm3
mov    0x10(%rsp),%r8
mov    0x8(%rsp),%rcx
movzwl 0xf8(%rsp),%r10d
mov    0x18(%rsp),%r9
movsd  0x30(%rsp),%xmm4
cmp    0xa8(%rsp),%r15
je     17ce <thickenPoly+0x67e>
mov    %r15,%r14
add    $0x1,%r15
cmp    0xb0(%rsp),%r15
mov    %r15d,%eax
mov    $0x0,%r12d
cmovne %rax,%r12
movsd  0x0(%r13,%r12,8),%xmm5
subsd  0x0(%r13,%r14,8),%xmm5
movsd  (%rbx,%r12,8),%xmm6
subsd  (%rbx,%r14,8),%xmm6
cmpw   $0x0,0xf0(%rsp)
movsd  %xmm4,0x30(%rsp)
movapd %xmm5,0x80(%rsp)
movapd %xmm6,0x70(%rsp)
je     1360 <thickenPoly+0x210>
movapd %xmm6,%xmm1
mulsd  %xmm6,%xmm1
movapd %xmm5,%xmm0
mulsd  %xmm5,%xmm0
addsd  %xmm1,%xmm0
ucomisd 0xd4e(%rip),%xmm0
jb     1460 <thickenPoly+0x310>
sqrtsd %xmm0,%xmm0
test   %r10w,%r10w
jne    1506 <thickenPoly+0x3b6>
addsd  %xmm0,%xmm4
ucomisd %xmm3,%xmm4
jb     1256 <thickenPoly+0x106>
movslq %ebp,%rsi
mov    %r9,%rax
sub    %rsi,%rax
lea    (%rcx,%rsi,8),%rdx
lea    (%r8,%rsi,8),%rsi
xor    %edi,%edi
nop
cmp    %rdi,%rax
je     17c9 <thickenPoly+0x679>
subsd  %xmm3,%xmm4
movapd %xmm0,%xmm1
subsd  %xmm4,%xmm1
divsd  %xmm0,%xmm1
movapd %xmm5,%xmm2
mulsd  %xmm1,%xmm2
addsd  0x0(%r13,%r14,8),%xmm2
movsd  %xmm2,(%rdx,%rdi,8)
mulsd  %xmm6,%xmm1
addsd  (%rbx,%r14,8),%xmm1
movsd  %xmm1,(%rsi,%rdi,8)
add    $0x1,%rdi
ucomisd %xmm3,%xmm4
jae    1310 <thickenPoly+0x1c0>
add    %edi,%ebp
jmp    1256 <thickenPoly+0x106>
nopl   (%rax)
movsd  0xc98(%rip),%xmm1
mulsd  %xmm1,%xmm5
movsd  0xc94(%rip),%xmm0
divsd  %xmm0,%xmm5
movapd %xmm5,0x60(%rsp)
mulsd  %xmm1,%xmm6
divsd  %xmm0,%xmm6
movsd  0xc82(%rip),%xmm0
mulsd  %xmm0,%xmm6
movapd %xmm6,0x50(%rsp)
movapd %xmm6,%xmm0
call   1040 <sin@plt>
movsd  %xmm0,0x40(%rsp)
movaps 0x50(%rsp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,0x50(%rsp)
movsd  (%rbx,%r14,8),%xmm0
mulsd  0xc3b(%rip),%xmm0
divsd  0xc3b(%rip),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,0x20(%rsp)
movsd  (%rbx,%r12,8),%xmm0
mulsd  0xc1a(%rip),%xmm0
divsd  0xc1a(%rip),%xmm0
call   1060 <cos@plt>
mulsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movapd 0x60(%rsp),%xmm0
mulsd  0xc03(%rip),%xmm0
movapd %xmm0,0x60(%rsp)
call   1040 <sin@plt>
mulsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movapd 0x60(%rsp),%xmm0
call   1040 <sin@plt>
mulsd  0x20(%rsp),%xmm0
movsd  0x50(%rsp),%xmm1
mulsd  0x40(%rsp),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ucomisd 0xbd7(%rip),%xmm1
jb     14a3 <thickenPoly+0x353>
sqrtsd %xmm0,%xmm0
jmp    14a8 <thickenPoly+0x358>
nopl   0x0(%rax)
call   1070 <sqrt@plt>
movapd 0x70(%rsp),%xmm6
movapd 0x80(%rsp),%xmm5
movsd  0x30(%rsp),%xmm4
mov    0x18(%rsp),%r9
movzwl 0xf8(%rsp),%r10d
mov    0x8(%rsp),%rcx
mov    0x10(%rsp),%r8
movsd  0x28(%rsp),%xmm3
test   %r10w,%r10w
jne    1506 <thickenPoly+0x3b6>
jmp    12ee <thickenPoly+0x19e>
call   1070 <sqrt@plt>
movsd  0xb68(%rip),%xmm1
minsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1050 <asin@plt>
addsd  %xmm0,%xmm0
mulsd  0xb57(%rip),%xmm0
movsd  0x28(%rsp),%xmm3
mov    0x10(%rsp),%r8
mov    0x8(%rsp),%rcx
movzwl 0xf8(%rsp),%r10d
mov    0x18(%rsp),%r9
movsd  0x30(%rsp),%xmm4
movapd 0x80(%rsp),%xmm5
movapd 0x70(%rsp),%xmm6
test   %r10w,%r10w
je     12ee <thickenPoly+0x19e>
cmp    0x4c(%rsp),%ebp
je     17c9 <thickenPoly+0x679>
movsd  0x0(%r13,%r14,8),%xmm1
movslq %ebp,%rax
movsd  %xmm1,(%rcx,%rax,8)
movsd  (%rbx,%r14,8),%xmm1
movsd  %xmm1,(%r8,%rax,8)
add    $0x1,%ebp
ucomisd %xmm3,%xmm0
jbe    1256 <thickenPoly+0x106>
divsd  %xmm3,%xmm0
call   1030 <ceil@plt>
cmp    $0x2,%eax
jl     1232 <thickenPoly+0xe2>
cvtsi2sd %eax,%xmm8
movslq %ebp,%rbp
mov    0x18(%rsp),%r9
mov    %r9,%rdi
sub    %rbp,%rdi
lea    -0x2(%rax),%esi
cmp    %rsi,%rdi
mov    %rsi,%rdx
cmovb  %rdi,%rdx
mov    $0x1,%r10d
cmp    $0x2,%rdx
movdqa 0xac3(%rip),%xmm9
jae    159f <thickenPoly+0x44f>
mov    0x10(%rsp),%r8
mov    0x8(%rsp),%rcx
movapd 0x80(%rsp),%xmm10
movapd 0x70(%rsp),%xmm11
jmp    1770 <thickenPoly+0x620>
lea    0x0(,%r14,8),%r11
add    %r13,%r11
mov    %r11,0x90(%rsp)
lea    0x8(%r13,%r14,8),%rcx
mov    %rcx,0x38(%rsp)
lea    (%rbx,%r14,8),%rcx
mov    %rcx,0x60(%rsp)
lea    0x8(%rbx,%r14,8),%rcx
mov    %rcx,0x50(%rsp)
mov    0x8(%rsp),%rcx
lea    (%rcx,%rbp,8),%r8
cmp    %rsi,%rdi
cmovb  %rdi,%rsi
add    %rbp,%rsi
mov    0xa0(%rsp),%rcx
lea    (%rcx,%rsi,8),%r9
mov    0x10(%rsp),%rdi
lea    (%rdi,%rbp,8),%rdi
mov    0x98(%rsp),%rcx
lea    (%rcx,%rsi,8),%r12
cmp    %r12,%r8
setb   0x40(%rsp)
cmp    %r9,%rdi
setb   0x20(%rsp)
mov    0x38(%rsp),%rsi
cmp    %rsi,%r8
setb   0x7(%rsp)
cmp    %r9,%r11
setb   0x6(%rsp)
mov    0x50(%rsp),%r11
cmp    %r11,%r8
setb   0x5(%rsp)
mov    0x60(%rsp),%rcx
cmp    %r9,%rcx
setb   0x4(%rsp)
cmp    %rsi,%rdi
setb   %r9b
cmp    %r12,0x90(%rsp)
setb   0x38(%rsp)
cmp    %r11,%rdi
setb   %sil
cmp    %r12,%rcx
setb   %r11b
mov    0x20(%rsp),%cl
test   %cl,0x40(%rsp)
movapd 0x80(%rsp),%xmm10
movapd 0x70(%rsp),%xmm11
jne    175c <thickenPoly+0x60c>
mov    0x6(%rsp),%cl
and    %cl,0x7(%rsp)
jne    175c <thickenPoly+0x60c>
mov    0x4(%rsp),%cl
and    %cl,0x5(%rsp)
jne    175c <thickenPoly+0x60c>
and    0x38(%rsp),%r9b
jne    175c <thickenPoly+0x60c>
and    %r11b,%sil
jne    175c <thickenPoly+0x60c>
add    $0x1,%rdx
mov    %edx,%ecx
and    $0x1,%ecx
test   %rcx,%rcx
mov    $0x2,%esi
cmove  %rsi,%rcx
sub    %rcx,%rdx
add    %rdx,%rbp
lea    0x1(%rdx),%r10d
movapd %xmm8,%xmm1
unpcklpd %xmm8,%xmm1
movapd %xmm10,%xmm0
unpcklpd %xmm10,%xmm0
movapd %xmm11,%xmm3
unpcklpd %xmm11,%xmm3
movsd  0x0(%r13,%r14,8),%xmm4
unpcklpd %xmm4,%xmm4
movsd  (%rbx,%r14,8),%xmm5
unpcklpd %xmm5,%xmm5
xor    %esi,%esi
movdqa 0x921(%rip),%xmm6
mov    0x8(%rsp),%rcx
mov    0x18(%rsp),%r9
nopl   0x0(%rax)
cvtdq2pd %xmm6,%xmm7
divpd  %xmm1,%xmm7
movapd %xmm0,%xmm2
mulpd  %xmm7,%xmm2
addpd  %xmm4,%xmm2
movupd %xmm2,(%r8,%rsi,8)
mulpd  %xmm3,%xmm7
addpd  %xmm5,%xmm7
movupd %xmm7,(%rdi,%rsi,8)
add    $0x2,%rsi
paddd  %xmm9,%xmm6
cmp    %rsi,%rdx
jne    1720 <thickenPoly+0x5d0>
mov    0x10(%rsp),%r8
jmp    1770 <thickenPoly+0x620>
mov    0x10(%rsp),%r8
mov    0x8(%rsp),%rcx
mov    0x18(%rsp),%r9
nopl   0x0(%rax,%rax,1)
cmp    %rbp,%r9
je     17c9 <thickenPoly+0x679>
xorps  %xmm0,%xmm0
cvtsi2sd %r10d,%xmm0
divsd  %xmm8,%xmm0
movapd %xmm10,%xmm1
mulsd  %xmm0,%xmm1
addsd  0x0(%r13,%r14,8),%xmm1
movsd  %xmm1,(%rcx,%rbp,8)
mulsd  %xmm11,%xmm0
addsd  (%rbx,%r14,8),%xmm0
movsd  %xmm0,(%r8,%rbp,8)
add    $0x1,%rbp
add    $0x1,%r10d
cmp    %r10d,%eax
jne    1770 <thickenPoly+0x620>
movsd  0x28(%rsp),%xmm3
movzwl 0xf8(%rsp),%r10d
jmp    1250 <thickenPoly+0x100>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @thickenPoly(double* nocapture %0, double* nocapture %1, i32 %2, double* nocapture writeonly %3, double* nocapture writeonly %4, i32 %5, double %6, i16 signext %7, i16 signext %8, i16 signext %9) {
%11 = icmp eq i16 %9, 0
br i1 %11, label %12, label %14
12: ; preds = %10
%13 = add nsw i32 %2, -1
br label %26
14: ; preds = %10
%15 = load double, double* %0
%16 = add nsw i32 %2, -1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %0, i64 %17
%19 = load double, double* %18
%20 = fcmp une double %15, %19
br i1 %20, label %28, label %21
21: ; preds = %14
%22 = load double, double* %1
%23 = getelementptr inbounds double, double* %1, i64 %17
%24 = load double, double* %23
%25 = fcmp une double %22, %24
br i1 %25, label %28, label %26
26: ; preds = %12, %21
%27 = phi i32 [ %13, %12 ], [ %16, %21 ]
br label %28
28: ; preds = %14, %21, %26
%29 = phi i32 [ %27, %26 ], [ %2, %21 ], [ %2, %14 ]
%30 = icmp eq i16 %8, 0
%31 = icmp sgt i32 %2, 0
%32 = and i1 %31, %30
br i1 %32, label %33, label %38
33: ; preds = %28
%34 = icmp eq i32 %5, 0
br i1 %34, label %242, label %35
35: ; preds = %33
%36 = load double, double* %0
store double %36, double* %3
%37 = load double, double* %1
store double %37, double* %4
br label %38
38: ; preds = %35, %28
%39 = phi i32 [ 1, %35 ], [ 0, %28 ]
%40 = icmp sgt i32 %29, 0
br i1 %40, label %41, label %242
41: ; preds = %38
%42 = icmp eq i16 %7, 0
%43 = zext i32 %2 to i64
%44 = zext i32 %29 to i64
%45 = sext i32 %5 to i64
%46 = sext i32 %5 to i64
%47 = getelementptr double, double* %3, i64 1
%48 = getelementptr double, double* %4, i64 1
br label %49
49: ; preds = %41, %238
%50 = phi i64 [ 0, %41 ], [ %58, %238 ]
%51 = phi i32 [ %39, %41 ], [ %240, %238 ]
%52 = phi double [ 0.000000e+00, %41 ], [ %239, %238 ]
%53 = getelementptr double, double* %0, i64 %50
%54 = add nuw i64 %50, 1
%55 = getelementptr double, double* %0, i64 %54
%56 = getelementptr double, double* %1, i64 %50
%57 = getelementptr double, double* %1, i64 %54
%58 = add nuw nsw i64 %50, 1
%59 = icmp eq i64 %58, %43
%60 = and i64 %58, 4294967295
%61 = select i1 %59, i64 0, i64 %60
%62 = getelementptr inbounds double, double* %0, i64 %61
%63 = load double, double* %62
%64 = getelementptr inbounds double, double* %0, i64 %50
%65 = load double, double* %64
%66 = fsub double %63, %65
%67 = getelementptr inbounds double, double* %1, i64 %61
%68 = load double, double* %67
%69 = getelementptr inbounds double, double* %1, i64 %50
%70 = load double, double* %69
%71 = fsub double %68, %70
br i1 %42, label %72, label %101
72: ; preds = %49
%73 = fmul double %66, 0x400921FB54442D18
%74 = fdiv double %73, 1.800000e+02
%75 = fmul double %71, 0x400921FB54442D18
%76 = fdiv double %75, 1.800000e+02
%77 = fmul double %76, 5.000000e-01
%78 = tail call double @sin(double %77)
%79 = tail call double @sin(double %77)
%80 = load double, double* %69
%81 = fmul double %80, 0x400921FB54442D18
%82 = fdiv double %81, 1.800000e+02
%83 = tail call double @cos(double %82)
%84 = load double, double* %67
%85 = fmul double %84, 0x400921FB54442D18
%86 = fdiv double %85, 1.800000e+02
%87 = tail call double @cos(double %86)
%88 = fmul double %83, %87
%89 = fmul double %74, 5.000000e-01
%90 = tail call double @sin(double %89)
%91 = fmul double %88, %90
%92 = tail call double @sin(double %89)
%93 = fmul double %91, %92
%94 = tail call double @llvm.fmuladd.f64(double %78, double %79, double %93)
%95 = tail call double @sqrt(double %94)
%96 = fcmp ogt double %95, 1.000000e+00
%97 = select i1 %96, double 1.000000e+00, double %95
%98 = tail call double @asin(double %97)
%99 = fmul double %98, 2.000000e+00
%100 = fmul double %99, 6.371300e+03
br label %105
101: ; preds = %49
%102 = fmul double %71, %71
%103 = tail call double @llvm.fmuladd.f64(double %66, double %66, double %102)
%104 = tail call double @sqrt(double %103)
br label %105
105: ; preds = %101, %72
%106 = phi double [ %100, %72 ], [ %104, %101 ]
br i1 %30, label %213, label %107
107: ; preds = %105
%108 = icmp eq i32 %51, %5
br i1 %108, label %242, label %109
109: ; preds = %107
%110 = load double, double* %64
%111 = sext i32 %51 to i64
%112 = getelementptr inbounds double, double* %3, i64 %111
store double %110, double* %112
%113 = load double, double* %69
%114 = getelementptr inbounds double, double* %4, i64 %111
store double %113, double* %114
%115 = add i32 %51, 1
%116 = fcmp ogt double %106, %6
br i1 %116, label %117, label %238
117: ; preds = %109
%118 = fdiv double %106, %6
%119 = tail call i32 @ceil(double %118)
%120 = icmp sgt i32 %119, 1
br i1 %120, label %121, label %238
121: ; preds = %117
%122 = sitofp i32 %119 to double
%123 = sext i32 %115 to i64
%124 = sub nsw i64 %45, %123
%125 = add i32 %119, -2
%126 = zext i32 %125 to i64
%127 = call i64 @llvm.umin.i64(i64 %124, i64 %126)
%128 = add nuw nsw i64 %127, 1
%129 = icmp ult i64 %127, 2
br i1 %129, label %194, label %130
130: ; preds = %121
%131 = getelementptr double, double* %3, i64 %123
%132 = sub nsw i64 %45, %123
%133 = add i32 %119, -2
%134 = zext i32 %133 to i64
%135 = call i64 @llvm.umin.i64(i64 %132, i64 %134)
%136 = add nsw i64 %135, %123
%137 = getelementptr double, double* %47, i64 %136
%138 = getelementptr double, double* %4, i64 %123
%139 = getelementptr double, double* %48, i64 %136
%140 = icmp ult double* %131, %139
%141 = icmp ult double* %138, %137
%142 = and i1 %140, %141
%143 = icmp ult double* %131, %55
%144 = icmp ult double* %53, %137
%145 = and i1 %143, %144
%146 = or i1 %142, %145
%147 = icmp ult double* %131, %57
%148 = icmp ult double* %56, %137
%149 = and i1 %147, %148
%150 = or i1 %146, %149
%151 = icmp ult double* %138, %55
%152 = icmp ult double* %53, %139
%153 = and i1 %151, %152
%154 = or i1 %150, %153
%155 = icmp ult double* %138, %57
%156 = icmp ult double* %56, %139
%157 = and i1 %155, %156
%158 = or i1 %154, %157
br i1 %158, label %194, label %159
159: ; preds = %130
%160 = and i64 %128, 1
%161 = icmp eq i64 %160, 0
%162 = select i1 %161, i64 2, i64 %160
%163 = sub nsw i64 %128, %162
%164 = add nsw i64 %163, %123
%165 = trunc i64 %163 to i32
%166 = add i32 %165, 1
%167 = insertelement <2 x double> poison, double %122, i64 0
%168 = shufflevector <2 x double> %167, <2 x double> poison, <2 x i32> zeroinitializer
%169 = insertelement <2 x double> poison, double %66, i64 0
%170 = shufflevector <2 x double> %169, <2 x double> poison, <2 x i32> zeroinitializer
%171 = insertelement <2 x double> poison, double %71, i64 0
%172 = shufflevector <2 x double> %171, <2 x double> poison, <2 x i32> zeroinitializer
%173 = load double, double* %64
%174 = insertelement <2 x double> poison, double %173, i64 0
%175 = shufflevector <2 x double> %174, <2 x double> poison, <2 x i32> zeroinitializer
%176 = load double, double* %69
%177 = insertelement <2 x double> poison, double %176, i64 0
%178 = shufflevector <2 x double> %177, <2 x double> poison, <2 x i32> zeroinitializer
br label %179
179: ; preds = %179, %159
%180 = phi i64 [ 0, %159 ], [ %191, %179 ]
%181 = phi <2 x i32> [ <i32 1, i32 2>, %159 ], [ %192, %179 ]
%182 = add i64 %180, %123
%183 = sitofp <2 x i32> %181 to <2 x double>
%184 = fdiv <2 x double> %183, %168
%185 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %170, <2 x double> %184, <2 x double> %175)
%186 = getelementptr inbounds double, double* %3, i64 %182
%187 = bitcast double* %186 to <2 x double>*
store <2 x double> %185, <2 x double>* %187
%188 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %172, <2 x double> %184, <2 x double> %178)
%189 = getelementptr inbounds double, double* %4, i64 %182
%190 = bitcast double* %189 to <2 x double>*
store <2 x double> %188, <2 x double>* %190
%191 = add nuw i64 %180, 2
%192 = add <2 x i32> %181, <i32 2, i32 2>
%193 = icmp eq i64 %191, %163
br i1 %193, label %194, label %179
194: ; preds = %179, %130, %121
%195 = phi i64 [ %123, %130 ], [ %123, %121 ], [ %164, %179 ]
%196 = phi i32 [ 1, %130 ], [ 1, %121 ], [ %166, %179 ]
br label %197
197: ; preds = %194, %201
%198 = phi i64 [ %210, %201 ], [ %195, %194 ]
%199 = phi i32 [ %211, %201 ], [ %196, %194 ]
%200 = icmp eq i64 %198, %45
br i1 %200, label %242, label %201
201: ; preds = %197
%202 = load double, double* %64
%203 = sitofp i32 %199 to double
%204 = fdiv double %203, %122
%205 = tail call double @llvm.fmuladd.f64(double %66, double %204, double %202)
%206 = getelementptr inbounds double, double* %3, i64 %198
store double %205, double* %206
%207 = load double, double* %69
%208 = tail call double @llvm.fmuladd.f64(double %71, double %204, double %207)
%209 = getelementptr inbounds double, double* %4, i64 %198
store double %208, double* %209
%210 = add nsw i64 %198, 1
%211 = add nuw nsw i32 %199, 1
%212 = icmp eq i32 %211, %119
br i1 %212, label %236, label %197
213: ; preds = %105
%214 = fadd double %52, %106
%215 = fcmp ult double %214, %6
br i1 %215, label %238, label %216
216: ; preds = %213
%217 = sext i32 %51 to i64
br label %218
218: ; preds = %216, %225
%219 = phi i64 [ %217, %216 ], [ %232, %225 ]
%220 = phi double [ %214, %216 ], [ %221, %225 ]
%221 = fsub double %220, %6
%222 = fsub double %106, %221
%223 = fdiv double %222, %106
%224 = icmp eq i64 %219, %46
br i1 %224, label %242, label %225
225: ; preds = %218
%226 = load double, double* %64
%227 = tail call double @llvm.fmuladd.f64(double %66, double %223, double %226)
%228 = getelementptr inbounds double, double* %3, i64 %219
store double %227, double* %228
%229 = load double, double* %69
%230 = tail call double @llvm.fmuladd.f64(double %71, double %223, double %229)
%231 = getelementptr inbounds double, double* %4, i64 %219
store double %230, double* %231
%232 = add nsw i64 %219, 1
%233 = fcmp ult double %221, %6
br i1 %233, label %234, label %218
234: ; preds = %225
%235 = trunc i64 %232 to i32
br label %238
236: ; preds = %201
%237 = trunc i64 %210 to i32
br label %238
238: ; preds = %236, %234, %117, %213, %109
%239 = phi double [ %52, %109 ], [ %214, %213 ], [ %52, %117 ], [ %221, %234 ], [ %52, %236 ]
%240 = phi i32 [ %115, %109 ], [ %51, %213 ], [ %115, %117 ], [ %235, %234 ], [ %237, %236 ]
%241 = icmp eq i64 %58, %44
br i1 %241, label %242, label %49
242: ; preds = %238, %107, %197, %218, %38, %33
%243 = phi i32 [ -1, %33 ], [ %39, %38 ], [ -1, %218 ], [ -1, %197 ], [ %240, %238 ], [ -1, %107 ]
ret i32 %243
}