#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*/ vcopy(float *, float *);
void vcross(float cross[3], const float v1[3], const float v2[3]) {
  float tmp[3];
  tmp[0] = (v1[1] * v2[2]) - (v1[2] * v2[1]);
  tmp[1] = (v1[2] * v2[0]) - (v1[0] * v2[2]);
  tmp[2] = (v1[0] * v2[1]) - (v1[1] * v2[0]);
  vcopy(cross, tmp);
}


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

x86 assembly (clang, -O2):
<vcross>:
sub    $0x18,%rsp
movss  0x4(%rdx),%xmm0
movss  0x8(%rdx),%xmm1
movss  0x4(%rsi),%xmm2
movss  0x8(%rsi),%xmm3
movaps %xmm0,%xmm4
mulss  %xmm3,%xmm4
movaps %xmm2,%xmm5
mulss  %xmm1,%xmm5
subss  %xmm4,%xmm5
movss  %xmm5,0xc(%rsp)
movss  (%rdx),%xmm4
movss  (%rsi),%xmm5
mulss  %xmm5,%xmm1
mulss  %xmm4,%xmm3
subss  %xmm1,%xmm3
movss  %xmm3,0x10(%rsp)
mulss  %xmm2,%xmm4
mulss  %xmm0,%xmm5
subss  %xmm4,%xmm5
movss  %xmm5,0x14(%rsp)
lea    0xc(%rsp),%rsi
call   1030 <vcopy@plt>
add    $0x18,%rsp
ret

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

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