#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 /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_intersect1(double);
int /*<<< orphan*/ test_intersect2(double);
int /*<<< orphan*/ test_intersect3(double);
int /*<<< orphan*/ test_intersect4(double);
int /*<<< orphan*/ test_intersect5(double);
int /*<<< orphan*/ test_intersect6(double);
int /*<<< orphan*/ test_intersect7(double);
int /*<<< orphan*/ test_intersect_line1(double);
int /*<<< orphan*/ test_intersect_line2(double);
int /*<<< orphan*/ test_intersect_line3(double);
int /*<<< orphan*/ test_scalar_prod1(double);
int main(int argc, char *argv[]) {
  double EPS = 0.0000000001;
  if (!test_scalar_prod1(EPS))
    printf("test scalar_prod1 failed!\n");
  else
    printf("test scalar_prod1 successful!\n");
  if (!test_intersect1(EPS))
    printf("test intersect1 failed!\n");
  else
    printf("test intersect1 successful!\n");
  if (!test_intersect2(EPS))
    printf("test intersect2 failed!\n");
  else
    printf("test intersect2 successful!\n");
  if (!test_intersect3(EPS))
    printf("test intersect3 failed!\n");
  else
    printf("test intersect3 successful!\n");
  if (!test_intersect4(EPS))
    printf("test intersect4 failed!\n");
  else
    printf("test intersect4 successful!\n");
  if (!test_intersect5(EPS))
    printf("test intersect5 failed!\n");
  else
    printf("test intersect5 successful!\n");
  if (!test_intersect6(EPS))
    printf("test intersect6 failed!\n");
  else
    printf("test intersect6 successful!\n");
  if (!test_intersect7(EPS))
    printf("test intersect7 failed!\n");
  else
    printf("test intersect7 successful!\n");
  if (!test_intersect_line1(EPS))
    printf("test intersect_line1 failed!\n");
  else
    printf("test intersect_line1 successful!\n");
  if (!test_intersect_line2(EPS))
    printf("test intersect_line2 failed!\n");
  else
    printf("test intersect_line2 successful!\n");
  if (!test_intersect_line3(EPS))
    printf("test intersect_line3 failed!\n");
  else
    printf("test intersect_line3 successful!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xe22(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1070 <test_scalar_prod1@plt>
cmp    $0x0,%eax
jne    1207 <main+0x47>
lea    0xe0b(%rip),%rdi
call   1050 <printf@plt>
jmp    1213 <main+0x53>
lea    0xe15(%rip),%rdi
call   1050 <printf@plt>
movsd  -0x18(%rbp),%xmm0
call   10b0 <test_intersect1@plt>
cmp    $0x0,%eax
jne    1237 <main+0x77>
lea    0xe15(%rip),%rdi
call   1050 <printf@plt>
jmp    1243 <main+0x83>
lea    0xe1d(%rip),%rdi
call   1050 <printf@plt>
movsd  -0x18(%rbp),%xmm0
call   1060 <test_intersect2@plt>
cmp    $0x0,%eax
jne    1267 <main+0xa7>
lea    0xe1b(%rip),%rdi
call   1050 <printf@plt>
jmp    1273 <main+0xb3>
lea    0xe23(%rip),%rdi
call   1050 <printf@plt>
movsd  -0x18(%rbp),%xmm0
call   10c0 <test_intersect3@plt>
cmp    $0x0,%eax
jne    1297 <main+0xd7>
lea    0xe21(%rip),%rdi
call   1050 <printf@plt>
jmp    12a3 <main+0xe3>
lea    0xe29(%rip),%rdi
call   1050 <printf@plt>
movsd  -0x18(%rbp),%xmm0
call   1040 <test_intersect4@plt>
cmp    $0x0,%eax
jne    12c7 <main+0x107>
lea    0xe27(%rip),%rdi
call   1050 <printf@plt>
jmp    12d3 <main+0x113>
lea    0xe2f(%rip),%rdi
call   1050 <printf@plt>
movsd  -0x18(%rbp),%xmm0
call   1090 <test_intersect5@plt>
cmp    $0x0,%eax
jne    12f7 <main+0x137>
lea    0xe2d(%rip),%rdi
call   1050 <printf@plt>
jmp    1303 <main+0x143>
lea    0xe35(%rip),%rdi
call   1050 <printf@plt>
movsd  -0x18(%rbp),%xmm0
call   1030 <test_intersect6@plt>
cmp    $0x0,%eax
jne    1327 <main+0x167>
lea    0xe33(%rip),%rdi
call   1050 <printf@plt>
jmp    1333 <main+0x173>
lea    0xe3b(%rip),%rdi
call   1050 <printf@plt>
movsd  -0x18(%rbp),%xmm0
call   10a0 <test_intersect7@plt>
cmp    $0x0,%eax
jne    1357 <main+0x197>
lea    0xe39(%rip),%rdi
call   1050 <printf@plt>
jmp    1363 <main+0x1a3>
lea    0xe41(%rip),%rdi
call   1050 <printf@plt>
movsd  -0x18(%rbp),%xmm0
call   10e0 <test_intersect_line1@plt>
cmp    $0x0,%eax
jne    1387 <main+0x1c7>
lea    0xe3f(%rip),%rdi
call   1050 <printf@plt>
jmp    1393 <main+0x1d3>
lea    0xe4c(%rip),%rdi
call   1050 <printf@plt>
movsd  -0x18(%rbp),%xmm0
call   1080 <test_intersect_line2@plt>
cmp    $0x0,%eax
jne    13b7 <main+0x1f7>
lea    0xe4f(%rip),%rdi
call   1050 <printf@plt>
jmp    13c3 <main+0x203>
lea    0xe5c(%rip),%rdi
call   1050 <printf@plt>
movsd  -0x18(%rbp),%xmm0
call   10d0 <test_intersect_line3@plt>
cmp    $0x0,%eax
jne    13e7 <main+0x227>
lea    0xe5f(%rip),%rdi
call   1050 <printf@plt>
jmp    13f3 <main+0x233>
lea    0xe6c(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xe37(%rip),%xmm0
call   1070 <test_scalar_prod1@plt>
test   %eax,%eax
lea    0xe31(%rip),%rax
lea    0x106a(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
movsd  0xe11(%rip),%xmm0
call   10b0 <test_intersect1@plt>
test   %eax,%eax
lea    0xe25(%rip),%rax
lea    0x1028(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
movsd  0xdeb(%rip),%xmm0
call   1060 <test_intersect2@plt>
test   %eax,%eax
lea    0xe17(%rip),%rax
lea    0xfe6(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
movsd  0xdc5(%rip),%xmm0
call   10c0 <test_intersect3@plt>
test   %eax,%eax
lea    0xe09(%rip),%rax
lea    0xfa4(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
movsd  0xd9f(%rip),%xmm0
call   1050 <test_intersect4@plt>
test   %eax,%eax
lea    0xdfb(%rip),%rax
lea    0xf62(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
movsd  0xd79(%rip),%xmm0
call   1090 <test_intersect5@plt>
test   %eax,%eax
lea    0xded(%rip),%rax
lea    0xf20(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
movsd  0xd53(%rip),%xmm0
call   1040 <test_intersect6@plt>
test   %eax,%eax
lea    0xddf(%rip),%rax
lea    0xede(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
movsd  0xd2d(%rip),%xmm0
call   10a0 <test_intersect7@plt>
test   %eax,%eax
lea    0xdd1(%rip),%rax
lea    0xe9c(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
movsd  0xd07(%rip),%xmm0
call   10e0 <test_intersect_line1@plt>
test   %eax,%eax
lea    0xdc3(%rip),%rax
lea    0xe55(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
movsd  0xce1(%rip),%xmm0
call   1080 <test_intersect_line2@plt>
test   %eax,%eax
lea    0xdba(%rip),%rax
lea    0xe0e(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
movsd  0xcbb(%rip),%xmm0
call   10d0 <test_intersect_line3@plt>
test   %eax,%eax
lea    0xdb1(%rip),%rax
lea    0xdc7(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"test scalar_prod1 failed!\0A\00"
@.str.1 = [31 x i8] c"test scalar_prod1 successful!\0A\00"
@.str.2 = [25 x i8] c"test intersect1 failed!\0A\00"
@.str.3 = [29 x i8] c"test intersect1 successful!\0A\00"
@.str.4 = [25 x i8] c"test intersect2 failed!\0A\00"
@.str.5 = [29 x i8] c"test intersect2 successful!\0A\00"
@.str.6 = [25 x i8] c"test intersect3 failed!\0A\00"
@.str.7 = [29 x i8] c"test intersect3 successful!\0A\00"
@.str.8 = [25 x i8] c"test intersect4 failed!\0A\00"
@.str.9 = [29 x i8] c"test intersect4 successful!\0A\00"
@.str.10 = [25 x i8] c"test intersect5 failed!\0A\00"
@.str.11 = [29 x i8] c"test intersect5 successful!\0A\00"
@.str.12 = [25 x i8] c"test intersect6 failed!\0A\00"
@.str.13 = [29 x i8] c"test intersect6 successful!\0A\00"
@.str.14 = [25 x i8] c"test intersect7 failed!\0A\00"
@.str.15 = [29 x i8] c"test intersect7 successful!\0A\00"
@.str.16 = [30 x i8] c"test intersect_line1 failed!\0A\00"
@.str.17 = [34 x i8] c"test intersect_line1 successful!\0A\00"
@.str.18 = [30 x i8] c"test intersect_line2 failed!\0A\00"
@.str.19 = [34 x i8] c"test intersect_line2 successful!\0A\00"
@.str.20 = [30 x i8] c"test intersect_line3 failed!\0A\00"
@.str.21 = [34 x i8] c"test intersect_line3 successful!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 1.000000e-10, double* %6
%7 = load double, double* %6
%8 = call i32 @test_scalar_prod1(double %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %14
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
%15 = load double, double* %6
%16 = call i32 @test_intersect1(double %15)
%17 = icmp ne i32 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %14
%19 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %22
20: ; preds = %14
%21 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
br label %22
22: ; preds = %20, %18
%23 = load double, double* %6
%24 = call i32 @test_intersect2(double %23)
%25 = icmp ne i32 %24, 0
br i1 %25, label %28, label %26
26: ; preds = %22
%27 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
br label %30
28: ; preds = %22
%29 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
br label %30
30: ; preds = %28, %26
%31 = load double, double* %6
%32 = call i32 @test_intersect3(double %31)
%33 = icmp ne i32 %32, 0
br i1 %33, label %36, label %34
34: ; preds = %30
%35 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
br label %38
36: ; preds = %30
%37 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0))
br label %38
38: ; preds = %36, %34
%39 = load double, double* %6
%40 = call i32 @test_intersect4(double %39)
%41 = icmp ne i32 %40, 0
br i1 %41, label %44, label %42
42: ; preds = %38
%43 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0))
br label %46
44: ; preds = %38
%45 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.9, i64 0, i64 0))
br label %46
46: ; preds = %44, %42
%47 = load double, double* %6
%48 = call i32 @test_intersect5(double %47)
%49 = icmp ne i32 %48, 0
br i1 %49, label %52, label %50
50: ; preds = %46
%51 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0))
br label %54
52: ; preds = %46
%53 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0))
br label %54
54: ; preds = %52, %50
%55 = load double, double* %6
%56 = call i32 @test_intersect6(double %55)
%57 = icmp ne i32 %56, 0
br i1 %57, label %60, label %58
58: ; preds = %54
%59 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0))
br label %62
60: ; preds = %54
%61 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.13, i64 0, i64 0))
br label %62
62: ; preds = %60, %58
%63 = load double, double* %6
%64 = call i32 @test_intersect7(double %63)
%65 = icmp ne i32 %64, 0
br i1 %65, label %68, label %66
66: ; preds = %62
%67 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.14, i64 0, i64 0))
br label %70
68: ; preds = %62
%69 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.15, i64 0, i64 0))
br label %70
70: ; preds = %68, %66
%71 = load double, double* %6
%72 = call i32 @test_intersect_line1(double %71)
%73 = icmp ne i32 %72, 0
br i1 %73, label %76, label %74
74: ; preds = %70
%75 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.16, i64 0, i64 0))
br label %78
76: ; preds = %70
%77 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.17, i64 0, i64 0))
br label %78
78: ; preds = %76, %74
%79 = load double, double* %6
%80 = call i32 @test_intersect_line2(double %79)
%81 = icmp ne i32 %80, 0
br i1 %81, label %84, label %82
82: ; preds = %78
%83 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.18, i64 0, i64 0))
br label %86
84: ; preds = %78
%85 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.19, i64 0, i64 0))
br label %86
86: ; preds = %84, %82
%87 = load double, double* %6
%88 = call i32 @test_intersect_line3(double %87)
%89 = icmp ne i32 %88, 0
br i1 %89, label %92, label %90
90: ; preds = %86
%91 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.20, i64 0, i64 0))
br label %94
92: ; preds = %86
%93 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.21, i64 0, i64 0))
br label %94
94: ; preds = %92, %90
ret i32 0
}

LLVM IR (-O2):
@str = [26 x i8] c"test scalar_prod1 failed!\00"
@str.22 = [24 x i8] c"test intersect1 failed!\00"
@str.23 = [24 x i8] c"test intersect2 failed!\00"
@str.24 = [24 x i8] c"test intersect3 failed!\00"
@str.25 = [24 x i8] c"test intersect4 failed!\00"
@str.26 = [24 x i8] c"test intersect5 failed!\00"
@str.27 = [24 x i8] c"test intersect6 failed!\00"
@str.28 = [24 x i8] c"test intersect7 failed!\00"
@str.29 = [29 x i8] c"test intersect_line1 failed!\00"
@str.30 = [29 x i8] c"test intersect_line2 failed!\00"
@str.31 = [29 x i8] c"test intersect_line3 failed!\00"
@str.32 = [33 x i8] c"test intersect_line3 successful!\00"
@str.33 = [33 x i8] c"test intersect_line2 successful!\00"
@str.34 = [33 x i8] c"test intersect_line1 successful!\00"
@str.35 = [28 x i8] c"test intersect7 successful!\00"
@str.36 = [28 x i8] c"test intersect6 successful!\00"
@str.37 = [28 x i8] c"test intersect5 successful!\00"
@str.38 = [28 x i8] c"test intersect4 successful!\00"
@str.39 = [28 x i8] c"test intersect3 successful!\00"
@str.40 = [28 x i8] c"test intersect2 successful!\00"
@str.41 = [28 x i8] c"test intersect1 successful!\00"
@str.42 = [30 x i8] c"test scalar_prod1 successful!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test_scalar_prod1(double 1.000000e-10)
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @str.42, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
%7 = tail call i32 @test_intersect1(double 1.000000e-10)
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str.22, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @str.41, i64 0, i64 0)
%10 = tail call i32 @puts(i8* dereferenceable(1) %9)
%11 = tail call i32 @test_intersect2(double 1.000000e-10)
%12 = icmp eq i32 %11, 0
%13 = select i1 %12, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str.23, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @str.40, i64 0, i64 0)
%14 = tail call i32 @puts(i8* dereferenceable(1) %13)
%15 = tail call i32 @test_intersect3(double 1.000000e-10)
%16 = icmp eq i32 %15, 0
%17 = select i1 %16, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str.24, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @str.39, i64 0, i64 0)
%18 = tail call i32 @puts(i8* dereferenceable(1) %17)
%19 = tail call i32 @test_intersect4(double 1.000000e-10)
%20 = icmp eq i32 %19, 0
%21 = select i1 %20, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str.25, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @str.38, i64 0, i64 0)
%22 = tail call i32 @puts(i8* dereferenceable(1) %21)
%23 = tail call i32 @test_intersect5(double 1.000000e-10)
%24 = icmp eq i32 %23, 0
%25 = select i1 %24, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str.26, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @str.37, i64 0, i64 0)
%26 = tail call i32 @puts(i8* dereferenceable(1) %25)
%27 = tail call i32 @test_intersect6(double 1.000000e-10)
%28 = icmp eq i32 %27, 0
%29 = select i1 %28, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str.27, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @str.36, i64 0, i64 0)
%30 = tail call i32 @puts(i8* dereferenceable(1) %29)
%31 = tail call i32 @test_intersect7(double 1.000000e-10)
%32 = icmp eq i32 %31, 0
%33 = select i1 %32, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str.28, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @str.35, i64 0, i64 0)
%34 = tail call i32 @puts(i8* dereferenceable(1) %33)
%35 = tail call i32 @test_intersect_line1(double 1.000000e-10)
%36 = icmp eq i32 %35, 0
%37 = select i1 %36, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @str.29, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @str.34, i64 0, i64 0)
%38 = tail call i32 @puts(i8* dereferenceable(1) %37)
%39 = tail call i32 @test_intersect_line2(double 1.000000e-10)
%40 = icmp eq i32 %39, 0
%41 = select i1 %40, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @str.30, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @str.33, i64 0, i64 0)
%42 = tail call i32 @puts(i8* dereferenceable(1) %41)
%43 = tail call i32 @test_intersect_line3(double 1.000000e-10)
%44 = icmp eq i32 %43, 0
%45 = select i1 %44, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @str.31, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @str.32, i64 0, i64 0)
%46 = tail call i32 @puts(i8* dereferenceable(1) %45)
ret i32 0
}