#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 */
scalar_t__ isSameSide(double, double, double, double, double, double, double,
                      double);
int inTriangle(double x0, double y0, double x1, double y1, double x2, double y2,
               double xp, double yp) {
  if ((isSameSide(x0, y0, x1, y1, x2, y2, xp, yp)) &&
      (isSameSide(x1, y1, x2, y2, x0, y0, xp, yp)) &&
      (isSameSide(x2, y2, x0, y0, x1, y1, xp, yp)))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<inTriangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  %xmm5,-0x38(%rbp)
movsd  %xmm6,-0x40(%rbp)
movsd  %xmm7,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm4
movsd  -0x38(%rbp),%xmm5
movsd  -0x40(%rbp),%xmm6
movsd  -0x48(%rbp),%xmm7
call   1030 <isSameSide@plt>
cmp    $0x0,%rax
je     11f1 <inTriangle+0xe1>
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm3
movsd  -0x10(%rbp),%xmm4
movsd  -0x18(%rbp),%xmm5
movsd  -0x40(%rbp),%xmm6
movsd  -0x48(%rbp),%xmm7
call   1030 <isSameSide@plt>
cmp    $0x0,%rax
je     11f1 <inTriangle+0xe1>
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm5
movsd  -0x40(%rbp),%xmm6
movsd  -0x48(%rbp),%xmm7
call   1030 <isSameSide@plt>
cmp    $0x0,%rax
je     11f1 <inTriangle+0xe1>
movl   $0x1,-0x4(%rbp)
jmp    11f8 <inTriangle+0xe8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inTriangle>:
sub    $0x48,%rsp
movsd  %xmm0,0x8(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm2,0x28(%rsp)
movsd  %xmm3,0x30(%rsp)
movsd  %xmm4,0x10(%rsp)
movsd  %xmm5,0x20(%rsp)
movsd  %xmm6,0x38(%rsp)
movsd  %xmm7,0x40(%rsp)
call   1030 <isSameSide@plt>
test   %rax,%rax
je     11d3 <inTriangle+0xc3>
movsd  0x28(%rsp),%xmm0
movsd  0x30(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
movsd  0x20(%rsp),%xmm3
movsd  0x8(%rsp),%xmm4
movsd  0x18(%rsp),%xmm5
movsd  0x38(%rsp),%xmm6
movsd  0x40(%rsp),%xmm7
call   1030 <isSameSide@plt>
test   %rax,%rax
je     11d3 <inTriangle+0xc3>
movsd  0x10(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
movsd  0x18(%rsp),%xmm3
movsd  0x28(%rsp),%xmm4
movsd  0x30(%rsp),%xmm5
movsd  0x38(%rsp),%xmm6
movsd  0x40(%rsp),%xmm7
call   1030 <isSameSide@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     11d3 <inTriangle+0xc3>
add    $0x48,%rsp
ret
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
define i32 @inTriangle(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7) {
%9 = alloca i32
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
store double %0, double* %10
store double %1, double* %11
store double %2, double* %12
store double %3, double* %13
store double %4, double* %14
store double %5, double* %15
store double %6, double* %16
store double %7, double* %17
%18 = load double, double* %10
%19 = load double, double* %11
%20 = load double, double* %12
%21 = load double, double* %13
%22 = load double, double* %14
%23 = load double, double* %15
%24 = load double, double* %16
%25 = load double, double* %17
%26 = call i64 @isSameSide(double %18, double %19, double %20, double %21, double %22, double %23, double %24, double %25)
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %51
28: ; preds = %8
%29 = load double, double* %12
%30 = load double, double* %13
%31 = load double, double* %14
%32 = load double, double* %15
%33 = load double, double* %10
%34 = load double, double* %11
%35 = load double, double* %16
%36 = load double, double* %17
%37 = call i64 @isSameSide(double %29, double %30, double %31, double %32, double %33, double %34, double %35, double %36)
%38 = icmp ne i64 %37, 0
br i1 %38, label %39, label %51
39: ; preds = %28
%40 = load double, double* %14
%41 = load double, double* %15
%42 = load double, double* %10
%43 = load double, double* %11
%44 = load double, double* %12
%45 = load double, double* %13
%46 = load double, double* %16
%47 = load double, double* %17
%48 = call i64 @isSameSide(double %40, double %41, double %42, double %43, double %44, double %45, double %46, double %47)
%49 = icmp ne i64 %48, 0
br i1 %49, label %50, label %51
50: ; preds = %39
store i32 1, i32* %9
br label %52
51: ; preds = %39, %28, %8
store i32 0, i32* %9
br label %52
52: ; preds = %51, %50
%53 = load i32, i32* %9
ret i32 %53
}

LLVM IR (-O2):
define i32 @inTriangle(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7) {
%9 = tail call i64 @isSameSide(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7)
%10 = icmp eq i64 %9, 0
br i1 %10, label %17, label %11
11: ; preds = %8
%12 = tail call i64 @isSameSide(double %2, double %3, double %4, double %5, double %0, double %1, double %6, double %7)
%13 = icmp eq i64 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = tail call i64 @isSameSide(double %4, double %5, double %0, double %1, double %2, double %3, double %6, double %7)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %14, %11, %8
br label %18
18: ; preds = %14, %17
%19 = phi i32 [ 0, %17 ], [ 1, %14 ]
ret i32 %19
}