int swptst_(int *n1, int *n2, int *n3, int *n4, double *x, double *y,
            double *z__) {
  int ret_val;
  static double x4, y4, z4, dx1, dx2, dx3, dy1, dy2, dy3, dz1, dz2, dz3;
  --z__;
  --y;
  --x;
  x4 = x[*n4];
  y4 = y[*n4];
  z4 = z__[*n4];
  dx1 = x[*n1] - x4;
  dx2 = x[*n2] - x4;
  dx3 = x[*n3] - x4;
  dy1 = y[*n1] - y4;
  dy2 = y[*n2] - y4;
  dy3 = y[*n3] - y4;
  dz1 = z__[*n1] - z4;
  dz2 = z__[*n2] - z4;
  dz3 = z__[*n3] - z4;
  ret_val = dx3 * (dy2 * dz1 - dy1 * dz2) - dy3 * (dx2 * dz1 - dx1 * dz2) +
                dz3 * (dx2 * dy1 - dx1 * dy2) >
            0.;
  return ret_val;
}


x86 assembly (clang, -O0):
<swptst_>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    0x10(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,0x10(%rbp)
mov    -0x30(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq (%rcx),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,0x2ecc(%rip)
mov    -0x30(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq (%rcx),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,0x2ebc(%rip)
mov    0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq (%rcx),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,0x2eac(%rip)
mov    -0x28(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq (%rcx),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  0x2e84(%rip),%xmm0
movsd  %xmm0,0x2e94(%rip)
mov    -0x28(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  0x2e64(%rip),%xmm0
movsd  %xmm0,0x2e7c(%rip)
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  0x2e44(%rip),%xmm0
movsd  %xmm0,0x2e64(%rip)
mov    -0x30(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq (%rcx),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  0x2e2c(%rip),%xmm0
movsd  %xmm0,0x2e4c(%rip)
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  0x2e0c(%rip),%xmm0
movsd  %xmm0,0x2e34(%rip)
mov    -0x30(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  0x2dec(%rip),%xmm0
movsd  %xmm0,0x2e1c(%rip)
mov    0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq (%rcx),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  0x2dd4(%rip),%xmm0
movsd  %xmm0,0x2e04(%rip)
mov    0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  0x2db4(%rip),%xmm0
movsd  %xmm0,0x2dec(%rip)
mov    0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  0x2d94(%rip),%xmm0
movsd  %xmm0,0x2dd4(%rip)
movsd  0x2d9c(%rip),%xmm1
movsd  0x2da4(%rip),%xmm2
movsd  0x2dac(%rip),%xmm3
movsd  0x2d8c(%rip),%xmm0
mulsd  0x2da4(%rip),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  0x2d6d(%rip),%xmm0
movsd  0x2d45(%rip),%xmm3
movsd  0x2d65(%rip),%xmm5
movsd  0x2d2d(%rip),%xmm4
mulsd  0x2d5d(%rip),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0x2d1b(%rip),%xmm0
movsd  0x2cdb(%rip),%xmm2
movsd  0x2ce3(%rip),%xmm4
movsd  0x2cc3(%rip),%xmm3
mulsd  0x2cdb(%rip),%xmm3
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swptst_>:
mov    0x8(%rsp),%rax
movslq (%rcx),%rcx
movsd  -0x8(%r8,%rcx,8),%xmm1
movsd  -0x8(%r9,%rcx,8),%xmm4
movsd  -0x8(%rax,%rcx,8),%xmm5
movslq (%rdi),%rcx
movsd  -0x8(%r8,%rcx,8),%xmm8
subsd  %xmm1,%xmm8
movslq (%rsi),%rsi
movsd  -0x8(%r8,%rsi,8),%xmm9
subsd  %xmm1,%xmm9
movslq (%rdx),%rdx
movsd  -0x8(%r8,%rdx,8),%xmm6
subsd  %xmm1,%xmm6
movsd  -0x8(%r9,%rcx,8),%xmm1
subsd  %xmm4,%xmm1
movsd  -0x8(%r9,%rsi,8),%xmm2
subsd  %xmm4,%xmm2
movsd  -0x8(%r9,%rdx,8),%xmm7
subsd  %xmm4,%xmm7
movsd  -0x8(%rax,%rcx,8),%xmm4
subsd  %xmm5,%xmm4
movsd  -0x8(%rax,%rsi,8),%xmm0
subsd  %xmm5,%xmm0
movsd  -0x8(%rax,%rdx,8),%xmm10
subsd  %xmm5,%xmm10
movapd %xmm0,%xmm5
mulsd  %xmm1,%xmm5
movapd %xmm2,%xmm3
mulsd  %xmm4,%xmm3
subsd  %xmm5,%xmm3
mulsd  %xmm6,%xmm3
mulsd  %xmm8,%xmm0
mulsd  %xmm9,%xmm4
subsd  %xmm0,%xmm4
mulsd  %xmm7,%xmm4
subsd  %xmm4,%xmm3
mulsd  %xmm8,%xmm2
mulsd  %xmm9,%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm10,%xmm1
addsd  %xmm3,%xmm1
xorpd  %xmm0,%xmm0
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
@swptst_.x4 = internal global double 0.000000e+00
@swptst_.y4 = internal global double 0.000000e+00
@swptst_.z4 = internal global double 0.000000e+00
@swptst_.dx1 = internal global double 0.000000e+00
@swptst_.dx2 = internal global double 0.000000e+00
@swptst_.dx3 = internal global double 0.000000e+00
@swptst_.dy1 = internal global double 0.000000e+00
@swptst_.dy2 = internal global double 0.000000e+00
@swptst_.dy3 = internal global double 0.000000e+00
@swptst_.dz1 = internal global double 0.000000e+00
@swptst_.dz2 = internal global double 0.000000e+00
@swptst_.dz3 = internal global double 0.000000e+00
define i32 @swptst_(i32* %0, i32* %1, i32* %2, i32* %3, double* %4, double* %5, double* %6) {
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca i32
store i32* %0, i32** %8
store i32* %1, i32** %9
store i32* %2, i32** %10
store i32* %3, i32** %11
store double* %4, double** %12
store double* %5, double** %13
store double* %6, double** %14
%16 = load double*, double** %14
%17 = getelementptr inbounds double, double* %16, i32 -1
store double* %17, double** %14
%18 = load double*, double** %13
%19 = getelementptr inbounds double, double* %18, i32 -1
store double* %19, double** %13
%20 = load double*, double** %12
%21 = getelementptr inbounds double, double* %20, i32 -1
store double* %21, double** %12
%22 = load double*, double** %12
%23 = load i32*, i32** %11
%24 = load i32, i32* %23
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %22, i64 %25
%27 = load double, double* %26
store double %27, double* @swptst_.x4
%28 = load double*, double** %13
%29 = load i32*, i32** %11
%30 = load i32, i32* %29
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds double, double* %28, i64 %31
%33 = load double, double* %32
store double %33, double* @swptst_.y4
%34 = load double*, double** %14
%35 = load i32*, i32** %11
%36 = load i32, i32* %35
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double, double* %34, i64 %37
%39 = load double, double* %38
store double %39, double* @swptst_.z4
%40 = load double*, double** %12
%41 = load i32*, i32** %8
%42 = load i32, i32* %41
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double, double* %40, i64 %43
%45 = load double, double* %44
%46 = load double, double* @swptst_.x4
%47 = fsub double %45, %46
store double %47, double* @swptst_.dx1
%48 = load double*, double** %12
%49 = load i32*, i32** %9
%50 = load i32, i32* %49
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double, double* %48, i64 %51
%53 = load double, double* %52
%54 = load double, double* @swptst_.x4
%55 = fsub double %53, %54
store double %55, double* @swptst_.dx2
%56 = load double*, double** %12
%57 = load i32*, i32** %10
%58 = load i32, i32* %57
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds double, double* %56, i64 %59
%61 = load double, double* %60
%62 = load double, double* @swptst_.x4
%63 = fsub double %61, %62
store double %63, double* @swptst_.dx3
%64 = load double*, double** %13
%65 = load i32*, i32** %8
%66 = load i32, i32* %65
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds double, double* %64, i64 %67
%69 = load double, double* %68
%70 = load double, double* @swptst_.y4
%71 = fsub double %69, %70
store double %71, double* @swptst_.dy1
%72 = load double*, double** %13
%73 = load i32*, i32** %9
%74 = load i32, i32* %73
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %72, i64 %75
%77 = load double, double* %76
%78 = load double, double* @swptst_.y4
%79 = fsub double %77, %78
store double %79, double* @swptst_.dy2
%80 = load double*, double** %13
%81 = load i32*, i32** %10
%82 = load i32, i32* %81
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds double, double* %80, i64 %83
%85 = load double, double* %84
%86 = load double, double* @swptst_.y4
%87 = fsub double %85, %86
store double %87, double* @swptst_.dy3
%88 = load double*, double** %14
%89 = load i32*, i32** %8
%90 = load i32, i32* %89
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds double, double* %88, i64 %91
%93 = load double, double* %92
%94 = load double, double* @swptst_.z4
%95 = fsub double %93, %94
store double %95, double* @swptst_.dz1
%96 = load double*, double** %14
%97 = load i32*, i32** %9
%98 = load i32, i32* %97
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds double, double* %96, i64 %99
%101 = load double, double* %100
%102 = load double, double* @swptst_.z4
%103 = fsub double %101, %102
store double %103, double* @swptst_.dz2
%104 = load double*, double** %14
%105 = load i32*, i32** %10
%106 = load i32, i32* %105
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds double, double* %104, i64 %107
%109 = load double, double* %108
%110 = load double, double* @swptst_.z4
%111 = fsub double %109, %110
store double %111, double* @swptst_.dz3
%112 = load double, double* @swptst_.dx3
%113 = load double, double* @swptst_.dy2
%114 = load double, double* @swptst_.dz1
%115 = load double, double* @swptst_.dy1
%116 = load double, double* @swptst_.dz2
%117 = fmul double %115, %116
%118 = fneg double %117
%119 = call double @llvm.fmuladd.f64(double %113, double %114, double %118)
%120 = load double, double* @swptst_.dy3
%121 = load double, double* @swptst_.dx2
%122 = load double, double* @swptst_.dz1
%123 = load double, double* @swptst_.dx1
%124 = load double, double* @swptst_.dz2
%125 = fmul double %123, %124
%126 = fneg double %125
%127 = call double @llvm.fmuladd.f64(double %121, double %122, double %126)
%128 = fmul double %120, %127
%129 = fneg double %128
%130 = call double @llvm.fmuladd.f64(double %112, double %119, double %129)
%131 = load double, double* @swptst_.dz3
%132 = load double, double* @swptst_.dx2
%133 = load double, double* @swptst_.dy1
%134 = load double, double* @swptst_.dx1
%135 = load double, double* @swptst_.dy2
%136 = fmul double %134, %135
%137 = fneg double %136
%138 = call double @llvm.fmuladd.f64(double %132, double %133, double %137)
%139 = call double @llvm.fmuladd.f64(double %131, double %138, double %130)
%140 = fcmp ogt double %139, 0.000000e+00
%141 = zext i1 %140 to i32
store i32 %141, i32* %15
%142 = load i32, i32* %15
ret i32 %142
}

LLVM IR (-O2):
define i32 @swptst_(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3, double* nocapture %4, double* nocapture %5, double* nocapture %6) {
%8 = getelementptr inbounds double, double* %6, i64 -1
%9 = getelementptr inbounds double, double* %5, i64 -1
%10 = getelementptr inbounds double, double* %4, i64 -1
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds double, double* %10, i64 %12
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %9, i64 %12
%16 = load double, double* %15
%17 = getelementptr inbounds double, double* %8, i64 %12
%18 = load double, double* %17
%19 = load i32, i32* %0
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds double, double* %10, i64 %20
%22 = load double, double* %21
%23 = fsub double %22, %14
%24 = load i32, i32* %1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %10, i64 %25
%27 = load double, double* %26
%28 = fsub double %27, %14
%29 = load i32, i32* %2
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds double, double* %10, i64 %30
%32 = load double, double* %31
%33 = fsub double %32, %14
%34 = getelementptr inbounds double, double* %9, i64 %20
%35 = load double, double* %34
%36 = fsub double %35, %16
%37 = getelementptr inbounds double, double* %9, i64 %25
%38 = load double, double* %37
%39 = fsub double %38, %16
%40 = getelementptr inbounds double, double* %9, i64 %30
%41 = load double, double* %40
%42 = fsub double %41, %16
%43 = getelementptr inbounds double, double* %8, i64 %20
%44 = load double, double* %43
%45 = fsub double %44, %18
%46 = getelementptr inbounds double, double* %8, i64 %25
%47 = load double, double* %46
%48 = fsub double %47, %18
%49 = getelementptr inbounds double, double* %8, i64 %30
%50 = load double, double* %49
%51 = fsub double %50, %18
%52 = fneg double %36
%53 = fmul double %48, %52
%54 = tail call double @llvm.fmuladd.f64(double %39, double %45, double %53)
%55 = fneg double %23
%56 = fmul double %48, %55
%57 = tail call double @llvm.fmuladd.f64(double %28, double %45, double %56)
%58 = fneg double %42
%59 = fmul double %57, %58
%60 = tail call double @llvm.fmuladd.f64(double %33, double %54, double %59)
%61 = fmul double %39, %55
%62 = tail call double @llvm.fmuladd.f64(double %28, double %36, double %61)
%63 = tail call double @llvm.fmuladd.f64(double %51, double %62, double %60)
%64 = fcmp ogt double %63, 0.000000e+00
%65 = zext i1 %64 to i32
ret i32 %65
}