#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 */
typedef int /*<<< orphan*/ uint;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ project_vn_vnvn_normalized(double *, double const *,
                                              double const *,
                                              int /*<<< orphan*/ const);
int /*<<< orphan*/ sub_vn_vnvn(double *, double const *, double *,
                               int /*<<< orphan*/ const);
void project_plane_vn_vnvn_normalized(double v_out[], const double v[],
                                      const double v_plane[], const uint dims) {
  assert(v != v_out);
  project_vn_vnvn_normalized(v_out, v, v_plane, dims);
  sub_vn_vnvn(v_out, v, v_out, dims);
}


x86 assembly (clang, -O0):
<project_plane_vn_vnvn_normalized>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1050 <project_vn_vnvn_normalized@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <sub_vn_vnvn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<project_plane_vn_vnvn_normalized>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r15d
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%rbp
xor    %edi,%edi
cmp    %rbp,%rsi
setne  %dil
call   1040 <assert@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r15d,%ecx
call   1050 <project_vn_vnvn_normalized@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %r15d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <sub_vn_vnvn@plt>

LLVM IR (-O0):
define void @project_plane_vn_vnvn_normalized(double* %0, double* %1, double* %2, i32 %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store i32 %3, i32* %8
%9 = load double*, double** %6
%10 = load double*, double** %5
%11 = icmp ne double* %9, %10
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load double*, double** %5
%15 = load double*, double** %6
%16 = load double*, double** %7
%17 = load i32, i32* %8
%18 = call i32 @project_vn_vnvn_normalized(double* %14, double* %15, double* %16, i32 %17)
%19 = load double*, double** %5
%20 = load double*, double** %6
%21 = load double*, double** %5
%22 = load i32, i32* %8
%23 = call i32 @sub_vn_vnvn(double* %19, double* %20, double* %21, i32 %22)
ret void
}

LLVM IR (-O2):
define void @project_plane_vn_vnvn_normalized(double* %0, double* %1, double* %2, i32 %3) {
%5 = icmp ne double* %1, %0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @project_vn_vnvn_normalized(double* %0, double* %1, double* %2, i32 %3)
%9 = tail call i32 @sub_vn_vnvn(double* %0, double* %1, double* %0, i32 %3)
ret void
}