int pointinpoly(point, pgon)
double point[2], pgon[100][2];
{
  int i, numverts, inside_flag, xflag0;
  int crossings;
  double *p, *stop;
  double tx, ty, y;
  for (i = 0; pgon[i][0] != -1 && i < 100; i++)
    ;
  numverts = i;
  crossings = 0;
  tx = point[0];
  ty = point[1];
  y = pgon[numverts - 1][1];
  p = (double *)pgon + 1;
  if ((y >= ty) != (*p >= ty)) {
    if ((xflag0 = (pgon[numverts - 1][0] >= tx)) == (*(double *)pgon >= tx)) {
      if (xflag0)
        crossings++;
    } else {
      crossings += (pgon[numverts - 1][0] -
                    (y - ty) * (*(double *)pgon - pgon[numverts - 1][0]) /
                        (*p - y)) >= tx;
    }
  }
  stop = pgon[numverts];
  for (y = *p, p += 2; p < stop; y = *p, p += 2) {
    if (y >= ty) {
      while ((p < stop) && (*p >= ty))
        p += 2;
      if (p >= stop)
        break;
      if ((xflag0 = (*(p - 3) >= tx)) == (*(p - 1) >= tx)) {
        if (xflag0)
          crossings++;
      } else {
        crossings += (*(p - 3) - (*(p - 2) - ty) * (*(p - 1) - *(p - 3)) /
                                     (*p - *(p - 2))) >= tx;
      }
    } else {
      while ((p < stop) && (*p < ty))
        p += 2;
      if (p >= stop)
        break;
      if ((xflag0 = (*(p - 3) >= tx)) == (*(p - 1) >= tx)) {
        if (xflag0)
          crossings++;
      } else {
        crossings += (*(p - 3) - (*(p - 2) - ty) * (*(p - 1) - *(p - 3)) /
                                     (*p - *(p - 2))) >= tx;
      }
    }
  }
  inside_flag = crossings & 0x01;
  return (inside_flag);
}


x86 assembly (clang, -O0):
<pointinpoly>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm0
xor    %eax,%eax
movsd  0xed0(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x51(%rbp)
jne    1148 <pointinpoly+0x48>
jp     1148 <pointinpoly+0x48>
jmp    1152 <pointinpoly+0x52>
cmpl   $0x64,-0x14(%rbp)
setl   %al
mov    %al,-0x51(%rbp)
mov    -0x51(%rbp),%al
test   $0x1,%al
jne    1162 <pointinpoly+0x62>
jmp    1175 <pointinpoly+0x75>
jmp    1167 <pointinpoly+0x67>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <pointinpoly+0x13>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x30(%rbp)
movsd  -0x50(%rbp),%xmm0
ucomisd -0x48(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x30(%rbp),%rcx
movsd  (%rcx),%xmm0
ucomisd -0x48(%rbp),%xmm0
setae  %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
je     12c8 <pointinpoly+0x1c8>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm0
ucomisd -0x40(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rcx
movsd  (%rcx),%xmm0
ucomisd -0x40(%rbp),%xmm0
setae  %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
jne    1255 <pointinpoly+0x155>
cmpl   $0x0,-0x20(%rbp)
je     1250 <pointinpoly+0x150>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12c3 <pointinpoly+0x1c3>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm0
movsd  -0x50(%rbp),%xmm1
subsd  -0x48(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x4,%rcx
add    %rcx,%rax
subsd  (%rax),%xmm2
mulsd  %xmm2,%xmm1
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm2
subsd  -0x50(%rbp),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
ucomisd -0x40(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    12c8 <pointinpoly+0x1c8>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x30(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x38(%rbp),%rax
jae    1553 <pointinpoly+0x453>
movsd  -0x50(%rbp),%xmm0
ucomisd -0x48(%rbp),%xmm0
jb     141f <pointinpoly+0x31f>
jmp    1317 <pointinpoly+0x217>
mov    -0x30(%rbp),%rcx
xor    %eax,%eax
cmp    -0x38(%rbp),%rcx
mov    %al,-0x52(%rbp)
jae    133d <pointinpoly+0x23d>
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd -0x48(%rbp),%xmm0
setae  %al
mov    %al,-0x52(%rbp)
mov    -0x52(%rbp),%al
test   $0x1,%al
jne    134d <pointinpoly+0x24d>
jmp    135e <pointinpoly+0x25e>
mov    -0x30(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x30(%rbp)
jmp    1317 <pointinpoly+0x217>
mov    -0x30(%rbp),%rax
cmp    -0x38(%rbp),%rax
jb     1371 <pointinpoly+0x271>
jmp    1553 <pointinpoly+0x453>
mov    -0x30(%rbp),%rax
movsd  -0x18(%rax),%xmm0
ucomisd -0x40(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x20(%rbp)
mov    -0x30(%rbp),%rcx
movsd  -0x8(%rcx),%xmm0
ucomisd -0x40(%rbp),%xmm0
setae  %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
jne    13c1 <pointinpoly+0x2c1>
cmpl   $0x0,-0x20(%rbp)
je     13bc <pointinpoly+0x2bc>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    141a <pointinpoly+0x31a>
mov    -0x30(%rbp),%rax
movsd  -0x18(%rax),%xmm0
mov    -0x30(%rbp),%rax
movsd  -0x10(%rax),%xmm1
subsd  -0x48(%rbp),%xmm1
mov    -0x30(%rbp),%rax
movsd  -0x8(%rax),%xmm2
mov    -0x30(%rbp),%rax
subsd  -0x18(%rax),%xmm2
mulsd  %xmm2,%xmm1
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x30(%rbp),%rax
subsd  -0x10(%rax),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
ucomisd -0x40(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1530 <pointinpoly+0x430>
jmp    1424 <pointinpoly+0x324>
mov    -0x30(%rbp),%rcx
xor    %eax,%eax
cmp    -0x38(%rbp),%rcx
mov    %al,-0x53(%rbp)
jae    144e <pointinpoly+0x34e>
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x53(%rbp)
mov    -0x53(%rbp),%al
test   $0x1,%al
jne    145e <pointinpoly+0x35e>
jmp    146f <pointinpoly+0x36f>
mov    -0x30(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x30(%rbp)
jmp    1424 <pointinpoly+0x324>
mov    -0x30(%rbp),%rax
cmp    -0x38(%rbp),%rax
jb     1482 <pointinpoly+0x382>
jmp    1553 <pointinpoly+0x453>
mov    -0x30(%rbp),%rax
movsd  -0x18(%rax),%xmm0
ucomisd -0x40(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x20(%rbp)
mov    -0x30(%rbp),%rcx
movsd  -0x8(%rcx),%xmm0
ucomisd -0x40(%rbp),%xmm0
setae  %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
jne    14d2 <pointinpoly+0x3d2>
cmpl   $0x0,-0x20(%rbp)
je     14cd <pointinpoly+0x3cd>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    152b <pointinpoly+0x42b>
mov    -0x30(%rbp),%rax
movsd  -0x18(%rax),%xmm0
mov    -0x30(%rbp),%rax
movsd  -0x10(%rax),%xmm1
subsd  -0x48(%rbp),%xmm1
mov    -0x30(%rbp),%rax
movsd  -0x8(%rax),%xmm2
mov    -0x30(%rbp),%rax
subsd  -0x18(%rax),%xmm2
mulsd  %xmm2,%xmm1
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x30(%rbp),%rax
subsd  -0x10(%rax),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
ucomisd -0x40(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1530 <pointinpoly+0x430>
jmp    1535 <pointinpoly+0x435>
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x30(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x30(%rbp)
jmp    12f4 <pointinpoly+0x1f4>
mov    -0x24(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pointinpoly>:
lea    -0x10(%rsi),%r9
movabs $0xfffffffe00000000,%rdx
ff ff ff
xor    %eax,%eax
movabs $0x100000000,%r8
movsd  0xede(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    %r8,%rdx
movsd  0x10(%r9),%xmm1
add    $0x10,%r9
ucomisd %xmm0,%xmm1
jne    1145 <pointinpoly+0x45>
jnp    1152 <pointinpoly+0x52>
lea    0x1(%rax),%rcx
cmp    $0x64,%rax
mov    %rcx,%rax
jb     1130 <pointinpoly+0x30>
movsd  0x8(%rdi),%xmm0
mov    %rdx,%rax
sar    $0x1c,%rax
movsd  0x8(%rsi,%rax,1),%xmm3
ucomisd %xmm0,%xmm3
setb   %r8b
movsd  0x8(%rsi),%xmm2
ucomisd %xmm0,%xmm2
movsd  (%rdi),%xmm1
setae  %cl
xor    %eax,%eax
xor    %r8b,%cl
jne    11d8 <pointinpoly+0xd8>
sar    $0x20,%rdx
shl    $0x4,%rdx
movsd  (%rsi,%rdx,1),%xmm4
ucomisd %xmm1,%xmm4
setae  %cl
movsd  (%rsi),%xmm5
ucomisd %xmm1,%xmm5
setb   %dl
cmp    %dl,%cl
je     11b3 <pointinpoly+0xb3>
ucomisd %xmm1,%xmm4
jb     11d8 <pointinpoly+0xd8>
mov    $0x1,%eax
jmp    11d8 <pointinpoly+0xd8>
movapd %xmm2,%xmm6
subsd  %xmm3,%xmm6
subsd  %xmm0,%xmm3
subsd  %xmm4,%xmm5
mulsd  %xmm3,%xmm5
divsd  %xmm6,%xmm5
subsd  %xmm5,%xmm4
xor    %eax,%eax
ucomisd %xmm1,%xmm4
setae  %al
add    $0x18,%rsi
cmp    %r9,%rsi
jae    12c6 <pointinpoly+0x1c6>
ucomisd %xmm0,%xmm2
jae    1220 <pointinpoly+0x120>
nopl   0x0(%rax,%rax,1)
cmp    %r9,%rsi
jae    12c6 <pointinpoly+0x1c6>
movsd  (%rsi),%xmm2
ucomisd %xmm2,%xmm0
jbe    1239 <pointinpoly+0x139>
add    $0x10,%rsi
cmp    %r9,%rsi
jb     11f9 <pointinpoly+0xf9>
jmp    12c6 <pointinpoly+0x1c6>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    %r9,%rsi
jae    12c6 <pointinpoly+0x1c6>
movsd  (%rsi),%xmm2
ucomisd %xmm0,%xmm2
jb     1267 <pointinpoly+0x167>
add    $0x10,%rsi
jmp    1220 <pointinpoly+0x120>
movsd  -0x18(%rsi),%xmm3
movsd  -0x8(%rsi),%xmm4
ucomisd %xmm1,%xmm3
setae  %cl
ucomisd %xmm1,%xmm4
setb   %dl
cmp    %dl,%cl
je     1295 <pointinpoly+0x195>
ucomisd %xmm1,%xmm3
jb     12bd <pointinpoly+0x1bd>
add    $0x1,%eax
add    $0x10,%rsi
jmp    11dc <pointinpoly+0xdc>
movsd  -0x18(%rsi),%xmm3
movsd  -0x8(%rsi),%xmm4
ucomisd %xmm1,%xmm3
setae  %cl
ucomisd %xmm1,%xmm4
setb   %dl
cmp    %dl,%cl
je     1295 <pointinpoly+0x195>
ucomisd %xmm1,%xmm3
jb     12bd <pointinpoly+0x1bd>
add    $0x1,%eax
add    $0x10,%rsi
jmp    11dc <pointinpoly+0xdc>
movsd  -0x10(%rsi),%xmm5
movapd %xmm2,%xmm6
subsd  %xmm5,%xmm6
subsd  %xmm0,%xmm5
subsd  %xmm3,%xmm4
mulsd  %xmm5,%xmm4
divsd  %xmm6,%xmm4
subsd  %xmm4,%xmm3
ucomisd %xmm1,%xmm3
sbb    $0xffffffff,%eax
add    $0x10,%rsi
jmp    11dc <pointinpoly+0xdc>
and    $0x1,%eax
ret

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

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