int in_quadrilateral(_Complex double *z, _Complex double zs[], int vids[],
                     double eps) {
  return (in_triangle(z, &zs[vids[0]], &zs[vids[1]], &zs[vids[2]], eps) ||
          in_triangle(z, &zs[vids[2]], &zs[vids[3]], &zs[vids[0]], eps));
}


x86 assembly (clang, -O0):
<in_quadrilateral>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
movslq (%rax),%rax
shl    $0x4,%rax
add    %rax,%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rax
movslq 0x4(%rax),%rax
shl    $0x4,%rax
add    %rax,%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
movslq 0x8(%rax),%rax
shl    $0x4,%rax
add    %rax,%rcx
movsd  -0x20(%rbp),%xmm0
mov    $0x1,%al
call   1030 <in_triangle@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x21(%rbp)
jne    11d2 <in_quadrilateral+0xc2>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
movslq 0x8(%rax),%rax
shl    $0x4,%rax
add    %rax,%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rax
movslq 0xc(%rax),%rax
shl    $0x4,%rax
add    %rax,%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
movslq (%rax),%rax
shl    $0x4,%rax
add    %rax,%rcx
movsd  -0x20(%rbp),%xmm0
mov    $0x1,%al
call   1030 <in_triangle@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_quadrilateral>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r14
movslq (%rdx),%rsi
shl    $0x4,%rsi
add    %r15,%rsi
movslq 0x4(%rdx),%rdx
shl    $0x4,%rdx
add    %r15,%rdx
movslq 0x8(%rbx),%rcx
shl    $0x4,%rcx
add    %r15,%rcx
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%al
call   1030 <in_triangle@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
jne    1193 <in_quadrilateral+0x83>
movslq 0x8(%rbx),%rsi
shl    $0x4,%rsi
add    %r15,%rsi
movslq 0xc(%rbx),%rdx
shl    $0x4,%rdx
add    %r15,%rdx
movslq (%rbx),%rcx
shl    $0x4,%rcx
add    %r15,%rcx
mov    %r14,%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1030 <in_triangle@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @in_quadrilateral({ double, double }* %0, { double, double }* %1, i32* nocapture %2, double %3) {
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds { double, double }, { double, double }* %1, i64 %6
%8 = getelementptr inbounds i32, i32* %2, i64 1
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds { double, double }, { double, double }* %1, i64 %10
%12 = getelementptr inbounds i32, i32* %2, i64 2
%13 = load i32, i32* %12
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds { double, double }, { double, double }* %1, i64 %14
%16 = tail call i32 ({ double, double }*, { double, double }*, { double, double }*, { double, double }*, double, ...) bitcast (i32 (...)* @in_triangle to i32 ({ double, double }*, { double, double }*, { double, double }*, { double, double }*, double, ...)*)({ double, double }* %0, { double, double }* %7, { double, double }* %11, { double, double }* %15, double %3)
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %32
18: ; preds = %4
%19 = load i32, i32* %12
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds { double, double }, { double, double }* %1, i64 %20
%22 = getelementptr inbounds i32, i32* %2, i64 3
%23 = load i32, i32* %22
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds { double, double }, { double, double }* %1, i64 %24
%26 = load i32, i32* %2
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds { double, double }, { double, double }* %1, i64 %27
%29 = tail call i32 ({ double, double }*, { double, double }*, { double, double }*, { double, double }*, double, ...) bitcast (i32 (...)* @in_triangle to i32 ({ double, double }*, { double, double }*, { double, double }*, { double, double }*, double, ...)*)({ double, double }* %0, { double, double }* %21, { double, double }* %25, { double, double }* %28, double %3)
%30 = icmp ne i32 %29, 0
%31 = zext i1 %30 to i32
br label %32
32: ; preds = %18, %4
%33 = phi i32 [ 1, %4 ], [ %31, %18 ]
ret i32 %33
}