#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__ accuratePointInTriangle(double, double, double, double, double,
                                   double, double, double);
int /*<<< orphan*/ printPoint(double, double);
int /*<<< orphan*/ printTriangle(double, double, double, double, double,
                                 double);
int /*<<< orphan*/ printf(char *);
void test(double x1, double y1, double x2, double y2, double x3, double y3,
          double x, double y) {
  printTriangle(x1, y1, x2, y2, x3, y3);
  printf("Point ");
  printPoint(x, y);
  printf(" is within triangle? ");
  if (accuratePointInTriangle(x1, y1, x2, y2, x3, y3, x, y)) {
    printf("true\n");
  } else {
    printf("false\n");
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%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  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm5
call   1040 <printTriangle@plt>
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
call   1060 <printPoint@plt>
lea    0xe52(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm5
movsd  -0x38(%rbp),%xmm6
movsd  -0x40(%rbp),%xmm7
call   1050 <accuratePointInTriangle@plt>
cmp    $0x0,%rax
je     1202 <test+0xc2>
lea    0xe25(%rip),%rdi
call   1030 <printf@plt>
jmp    120e <test+0xce>
lea    0xe1a(%rip),%rdi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
sub    $0x48,%rsp
movsd  %xmm7,0x10(%rsp)
movsd  %xmm6,0x8(%rsp)
movsd  %xmm5,0x40(%rsp)
movsd  %xmm4,0x38(%rsp)
movsd  %xmm3,0x30(%rsp)
movsd  %xmm2,0x28(%rsp)
movsd  %xmm1,0x20(%rsp)
movsd  %xmm0,0x18(%rsp)
call   1050 <printTriangle@plt>
lea    0xe70(%rip),%rdi
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1070 <printPoint@plt>
lea    0xe5a(%rip),%rdi
call   1040 <printf@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
movsd  0x28(%rsp),%xmm2
movsd  0x30(%rsp),%xmm3
movsd  0x38(%rsp),%xmm4
movsd  0x40(%rsp),%xmm5
movsd  0x8(%rsp),%xmm6
movsd  0x10(%rsp),%xmm7
call   1060 <accuratePointInTriangle@plt>
test   %rax,%rax
lea    0xe2c(%rip),%rax
lea    0xe2b(%rip),%rdi
cmove  %rax,%rdi
add    $0x48,%rsp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Point \00"
@.str.1 = [22 x i8] c" is within triangle? \00"
@.str.2 = [6 x i8] c"true\0A\00"
@.str.3 = [7 x i8] c"false\0A\00"
define void @test(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
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
%17 = load double, double* %9
%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 = call i32 @printTriangle(double %17, double %18, double %19, double %20, double %21, double %22)
%24 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%25 = load double, double* %15
%26 = load double, double* %16
%27 = call i32 @printPoint(double %25, double %26)
%28 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%29 = load double, double* %9
%30 = load double, double* %10
%31 = load double, double* %11
%32 = load double, double* %12
%33 = load double, double* %13
%34 = load double, double* %14
%35 = load double, double* %15
%36 = load double, double* %16
%37 = call i64 @accuratePointInTriangle(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 %41
39: ; preds = %8
%40 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %43
41: ; preds = %8
%42 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %43
43: ; preds = %41, %39
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"Point \00"
@.str.1 = [22 x i8] c" is within triangle? \00"
@str = [6 x i8] c"false\00"
@str.4 = [5 x i8] c"true\00"
define void @test(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7) {
%9 = tail call i32 @printTriangle(double %0, double %1, double %2, double %3, double %4, double %5)
%10 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @printPoint(double %6, double %7)
%12 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i64 @accuratePointInTriangle(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7)
%14 = icmp eq i64 %13, 0
%15 = select i1 %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.4, i64 0, i64 0)
%16 = tail call i32 @puts(i8* dereferenceable(1) %15)
ret void
}