#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 get_line_intersection(float const, float const, float const, float const,
                          float const, float const, float const, float const,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *);
scalar_t__ v2_eq(float const *, float const *);
int intersect(const float p00[], const float p01[], const float p10[],
              const float p11[]) {
  if (v2_eq(p00, p10) && v2_eq(p01, p11))
    return 0;
  if (v2_eq(p01, p10) && v2_eq(p00, p11))
    return 0;
  return get_line_intersection(p00[0], p00[1], p01[0], p01[1], p10[0], p10[1],
                               p11[0], p11[1], NULL, NULL);
}


x86 assembly (clang, -O0):
<intersect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <v2_eq@plt>
cmp    $0x0,%rax
je     1172 <intersect+0x52>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <v2_eq@plt>
cmp    $0x0,%rax
je     1172 <intersect+0x52>
movl   $0x0,-0x4(%rbp)
jmp    11ff <intersect+0xdf>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <v2_eq@plt>
cmp    $0x0,%rax
je     11ac <intersect+0x8c>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <v2_eq@plt>
cmp    $0x0,%rax
je     11ac <intersect+0x8c>
movl   $0x0,-0x4(%rbp)
jmp    11ff <intersect+0xdf>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm3
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm4
mov    -0x20(%rbp),%rax
movss  0x4(%rax),%xmm5
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm6
mov    -0x28(%rbp),%rax
movss  0x4(%rax),%xmm7
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1030 <get_line_intersection@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intersect>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r12
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rdx,%rsi
call   1040 <v2_eq@plt>
test   %rax,%rax
je     1151 <intersect+0x31>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <v2_eq@plt>
test   %rax,%rax
jne    1171 <intersect+0x51>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <v2_eq@plt>
test   %rax,%rax
je     117f <intersect+0x5f>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <v2_eq@plt>
test   %rax,%rax
je     117f <intersect+0x5f>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
movss  (%rbx),%xmm0
movss  0x4(%rbx),%xmm1
movss  (%r15),%xmm2
movss  0x4(%r15),%xmm3
movss  (%r12),%xmm4
movss  0x4(%r12),%xmm5
movss  (%r14),%xmm6
movss  0x4(%r14),%xmm7
xor    %edi,%edi
xor    %esi,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <get_line_intersection@plt>

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

LLVM IR (-O2):
define i32 @intersect(float* %0, float* %1, float* %2, float* %3) {
%5 = tail call i64 @v2_eq(float* %0, float* %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = tail call i64 @v2_eq(float* %1, float* %3)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %30
10: ; preds = %7, %4
%11 = tail call i64 @v2_eq(float* %1, float* %2)
%12 = icmp eq i64 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = tail call i64 @v2_eq(float* %0, float* %3)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %30
16: ; preds = %13, %10
%17 = load float, float* %0
%18 = getelementptr inbounds float, float* %0, i64 1
%19 = load float, float* %18
%20 = load float, float* %1
%21 = getelementptr inbounds float, float* %1, i64 1
%22 = load float, float* %21
%23 = load float, float* %2
%24 = getelementptr inbounds float, float* %2, i64 1
%25 = load float, float* %24
%26 = load float, float* %3
%27 = getelementptr inbounds float, float* %3, i64 1
%28 = load float, float* %27
%29 = tail call i32 @get_line_intersection(float %17, float %19, float %20, float %22, float %23, float %25, float %26, float %28, i32* null, i32* null)
br label %30
30: ; preds = %13, %7, %16
%31 = phi i32 [ %29, %16 ], [ 0, %7 ], [ 0, %13 ]
ret i32 %31
}