#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*/ normalize(float *);
void ncrossprod(float v1[3], float v2[3], float cp[3]) {
  cp[0] = v1[1] * v2[2] - v1[2] * v2[1];
  cp[1] = v1[2] * v2[0] - v1[0] * v2[2];
  cp[2] = v1[0] * v2[1] - v1[1] * v2[0];
  normalize(cp);
}


x86 assembly (clang, -O0):
<ncrossprod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x10(%rbp),%rax
mulss  0x8(%rax),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulss  (%rax),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rdi
call   1030 <normalize@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncrossprod>:
movss  0x4(%rdi),%xmm0
movss  0x4(%rsi),%xmm1
mulss  0x8(%rdi),%xmm1
mulss  0x8(%rsi),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,(%rdx)
movss  0x8(%rdi),%xmm0
movss  0x8(%rsi),%xmm1
mulss  (%rdi),%xmm1
mulss  (%rsi),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,0x4(%rdx)
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
mulss  0x4(%rdi),%xmm1
mulss  0x4(%rsi),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,0x8(%rdx)
mov    %rdx,%rdi
jmp    1030 <normalize@plt>

LLVM IR (-O0):
define void @ncrossprod(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %4
%8 = getelementptr inbounds float, float* %7, i64 1
%9 = load float, float* %8
%10 = load float*, float** %5
%11 = getelementptr inbounds float, float* %10, i64 2
%12 = load float, float* %11
%13 = load float*, float** %4
%14 = getelementptr inbounds float, float* %13, i64 2
%15 = load float, float* %14
%16 = load float*, float** %5
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = fmul float %15, %18
%20 = fneg float %19
%21 = call float @llvm.fmuladd.f32(float %9, float %12, float %20)
%22 = load float*, float** %6
%23 = getelementptr inbounds float, float* %22, i64 0
store float %21, float* %23
%24 = load float*, float** %4
%25 = getelementptr inbounds float, float* %24, i64 2
%26 = load float, float* %25
%27 = load float*, float** %5
%28 = getelementptr inbounds float, float* %27, i64 0
%29 = load float, float* %28
%30 = load float*, float** %4
%31 = getelementptr inbounds float, float* %30, i64 0
%32 = load float, float* %31
%33 = load float*, float** %5
%34 = getelementptr inbounds float, float* %33, i64 2
%35 = load float, float* %34
%36 = fmul float %32, %35
%37 = fneg float %36
%38 = call float @llvm.fmuladd.f32(float %26, float %29, float %37)
%39 = load float*, float** %6
%40 = getelementptr inbounds float, float* %39, i64 1
store float %38, float* %40
%41 = load float*, float** %4
%42 = getelementptr inbounds float, float* %41, i64 0
%43 = load float, float* %42
%44 = load float*, float** %5
%45 = getelementptr inbounds float, float* %44, i64 1
%46 = load float, float* %45
%47 = load float*, float** %4
%48 = getelementptr inbounds float, float* %47, i64 1
%49 = load float, float* %48
%50 = load float*, float** %5
%51 = getelementptr inbounds float, float* %50, i64 0
%52 = load float, float* %51
%53 = fmul float %49, %52
%54 = fneg float %53
%55 = call float @llvm.fmuladd.f32(float %43, float %46, float %54)
%56 = load float*, float** %6
%57 = getelementptr inbounds float, float* %56, i64 2
store float %55, float* %57
%58 = load float*, float** %6
%59 = call i32 @normalize(float* %58)
ret void
}

LLVM IR (-O2):
define void @ncrossprod(float* nocapture %0, float* nocapture %1, float* %2) {
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %1, i64 2
%7 = load float, float* %6
%8 = getelementptr inbounds float, float* %0, i64 2
%9 = load float, float* %8
%10 = getelementptr inbounds float, float* %1, i64 1
%11 = load float, float* %10
%12 = fneg float %9
%13 = fmul float %11, %12
%14 = tail call float @llvm.fmuladd.f32(float %5, float %7, float %13)
store float %14, float* %2
%15 = load float, float* %8
%16 = load float, float* %1
%17 = load float, float* %0
%18 = load float, float* %6
%19 = fneg float %17
%20 = fmul float %18, %19
%21 = tail call float @llvm.fmuladd.f32(float %15, float %16, float %20)
%22 = getelementptr inbounds float, float* %2, i64 1
store float %21, float* %22
%23 = load float, float* %0
%24 = load float, float* %10
%25 = load float, float* %4
%26 = load float, float* %1
%27 = fneg float %25
%28 = fmul float %26, %27
%29 = tail call float @llvm.fmuladd.f32(float %23, float %24, float %28)
%30 = getelementptr inbounds float, float* %2, i64 2
store float %29, float* %30
%31 = tail call i32 @normalize(float* %2)
ret void
}