#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int test1(double, double, double, double, double, double);
int tritest(double x0, double y0, double x1, double y1, double x2, double y2,
            double px, double py) {
  int lineAB, lineAC, lineBC;
  double m01 = (y1 - y0) / (x1 - x0);
  double b01 = m01 * -x1 + y1;
  double m02, m12, b02, b12;
  m02 = (y2 - y0) / (x2 - x0);
  m12 = (y2 - y1) / (x2 - x1);
  b02 = m02 * -x2 + y2;
  b12 = m12 * -x2 + y2;
  if (x1 == x0) {
    lineAB = ((px <= x0) == (x2 <= x0));
  } else {
    lineAB = test1(px, py, m01, b01, x2, y2);
  }
  if (x1 == x2) {
    lineAC = ((px <= x2) == (x0 <= x2));
  } else {
    lineAC = test1(px, py, m12, b12, x0, y0);
  }
  if (x2 == x0) {
    lineBC = ((px <= x0) == (x1 <= x0));
  } else {
    lineBC = test1(px, py, m02, b02, x1, y1);
  }
  return lineAB && lineAC && lineBC;
}


x86 assembly (clang, -O0):
<tritest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  %xmm7,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
jne    1288 <tritest+0x178>
jp     1288 <tritest+0x178>
movsd  -0x38(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
movsd  -0x28(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x44(%rbp)
jmp    12ae <tritest+0x19e>
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm5
call   1030 <test1@plt>
mov    %eax,-0x44(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jne    1303 <tritest+0x1f3>
jp     1303 <tritest+0x1f3>
movsd  -0x38(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
movsd  -0x8(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x48(%rbp)
jmp    1329 <tritest+0x219>
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm3
movsd  -0x8(%rbp),%xmm4
movsd  -0x10(%rbp),%xmm5
call   1030 <test1@plt>
mov    %eax,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
jne    137e <tritest+0x26e>
jp     137e <tritest+0x26e>
movsd  -0x38(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
movsd  -0x18(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4c(%rbp)
jmp    13a4 <tritest+0x294>
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm4
movsd  -0x20(%rbp),%xmm5
call   1030 <test1@plt>
mov    %eax,-0x4c(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x44(%rbp)
mov    %al,-0x81(%rbp)
je     13d5 <tritest+0x2c5>
xor    %eax,%eax
cmpl   $0x0,-0x48(%rbp)
mov    %al,-0x81(%rbp)
je     13d5 <tritest+0x2c5>
cmpl   $0x0,-0x4c(%rbp)
setne  %al
mov    %al,-0x81(%rbp)
mov    -0x81(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tritest>:
push   %rbp
push   %rbx
sub    $0x48,%rsp
movapd %xmm6,%xmm8
movapd %xmm4,%xmm9
movapd %xmm2,%xmm4
movapd %xmm0,%xmm6
ucomisd %xmm0,%xmm2
movsd  %xmm5,0x40(%rsp)
movsd  %xmm3,0x38(%rsp)
movsd  %xmm7,0x30(%rsp)
movsd  %xmm1,0x28(%rsp)
jne    115f <tritest+0x4f>
jp     115f <tritest+0x4f>
ucomisd %xmm8,%xmm6
setb   %al
ucomisd %xmm9,%xmm6
setae  %cl
xor    %al,%cl
movzbl %cl,%ebx
jmp    11c8 <tritest+0xb8>
movapd %xmm3,%xmm2
subsd  %xmm1,%xmm2
movapd %xmm4,%xmm0
subsd  %xmm6,%xmm0
divsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
mulsd  %xmm4,%xmm0
subsd  %xmm0,%xmm3
movapd %xmm8,%xmm0
movapd %xmm7,%xmm1
movsd  %xmm4,0x20(%rsp)
movapd %xmm9,%xmm4
movsd  %xmm8,0x18(%rsp)
movsd  %xmm9,0x10(%rsp)
movsd  %xmm6,0x8(%rsp)
call   1030 <test1@plt>
movsd  0x8(%rsp),%xmm6
movsd  0x10(%rsp),%xmm9
movsd  0x18(%rsp),%xmm8
movsd  0x20(%rsp),%xmm4
mov    %eax,%ebx
ucomisd %xmm9,%xmm4
jne    11e8 <tritest+0xd8>
jp     11e8 <tritest+0xd8>
ucomisd %xmm8,%xmm9
setb   %al
ucomisd %xmm6,%xmm9
setae  %cl
xor    %al,%cl
movzbl %cl,%ebp
jmp    1262 <tritest+0x152>
movsd  0x40(%rsp),%xmm3
movapd %xmm3,%xmm2
subsd  0x38(%rsp),%xmm2
movapd %xmm9,%xmm0
subsd  %xmm4,%xmm0
divsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
mulsd  %xmm9,%xmm0
subsd  %xmm0,%xmm3
movapd %xmm8,%xmm0
movsd  0x30(%rsp),%xmm1
movsd  %xmm4,0x20(%rsp)
movapd %xmm6,%xmm4
movsd  0x28(%rsp),%xmm5
movsd  %xmm8,0x18(%rsp)
movsd  %xmm9,0x10(%rsp)
movsd  %xmm6,0x8(%rsp)
call   1030 <test1@plt>
movsd  0x8(%rsp),%xmm6
movsd  0x10(%rsp),%xmm9
movsd  0x18(%rsp),%xmm8
movsd  0x20(%rsp),%xmm4
mov    %eax,%ebp
ucomisd %xmm6,%xmm9
jne    1281 <tritest+0x171>
jp     1281 <tritest+0x171>
ucomisd %xmm8,%xmm6
setb   %al
ucomisd %xmm4,%xmm6
setae  %cl
xor    %al,%cl
movzbl %cl,%eax
jmp    12be <tritest+0x1ae>
movsd  0x40(%rsp),%xmm3
movapd %xmm3,%xmm2
subsd  0x28(%rsp),%xmm2
movapd %xmm9,%xmm0
subsd  %xmm6,%xmm0
divsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm9
subsd  %xmm9,%xmm3
movapd %xmm8,%xmm0
movsd  0x30(%rsp),%xmm1
movsd  0x38(%rsp),%xmm5
call   1030 <test1@plt>
test   %ebx,%ebx
setne  %cl
test   %ebp,%ebp
setne  %dl
and    %cl,%dl
test   %eax,%eax
setne  %al
and    %dl,%al
movzbl %al,%eax
add    $0x48,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @tritest(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7) {
%9 = fsub double %3, %1
%10 = fsub double %2, %0
%11 = fdiv double %9, %10
%12 = fsub double %5, %1
%13 = fsub double %4, %0
%14 = fdiv double %12, %13
%15 = fsub double %5, %3
%16 = fsub double %4, %2
%17 = fdiv double %15, %16
%18 = fneg double %4
%19 = tail call double @llvm.fmuladd.f64(double %14, double %18, double %5)
%20 = tail call double @llvm.fmuladd.f64(double %17, double %18, double %5)
%21 = fcmp oeq double %2, %0
br i1 %21, label %22, label %27
22: ; preds = %8
%23 = fcmp ugt double %6, %0
%24 = fcmp ole double %4, %0
%25 = xor i1 %24, %23
%26 = zext i1 %25 to i32
br label %31
27: ; preds = %8
%28 = fneg double %2
%29 = tail call double @llvm.fmuladd.f64(double %11, double %28, double %3)
%30 = tail call i32 @test1(double %6, double %7, double %11, double %29, double %4, double %5)
br label %31
31: ; preds = %27, %22
%32 = phi i32 [ %26, %22 ], [ %30, %27 ]
%33 = fcmp oeq double %2, %4
br i1 %33, label %34, label %39
34: ; preds = %31
%35 = fcmp ugt double %6, %4
%36 = fcmp ole double %0, %4
%37 = xor i1 %36, %35
%38 = zext i1 %37 to i32
br label %41
39: ; preds = %31
%40 = tail call i32 @test1(double %6, double %7, double %17, double %20, double %0, double %1)
br label %41
41: ; preds = %39, %34
%42 = phi i32 [ %38, %34 ], [ %40, %39 ]
%43 = fcmp oeq double %4, %0
br i1 %43, label %44, label %49
44: ; preds = %41
%45 = fcmp ugt double %6, %0
%46 = fcmp ole double %2, %0
%47 = xor i1 %46, %45
%48 = zext i1 %47 to i32
br label %51
49: ; preds = %41
%50 = tail call i32 @test1(double %6, double %7, double %14, double %19, double %2, double %3)
br label %51
51: ; preds = %49, %44
%52 = phi i32 [ %48, %44 ], [ %50, %49 ]
%53 = icmp ne i32 %32, 0
%54 = icmp ne i32 %42, 0
%55 = select i1 %53, i1 %54, i1 false
%56 = icmp ne i32 %52, 0
%57 = select i1 %55, i1 %56, i1 false
%58 = zext i1 %57 to i32
ret i32 %58
}