#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 */
scalar_t__ malloc(int);
float *RBR_vector_cross(float *V1, float *V2) {
  int i;
  float *V3;
  V3 = (float *)malloc(3 * sizeof(float));
  V3[0] = V1[1] * V2[2] - V1[2] * V2[1];
  V3[1] = V1[2] * V2[0] - V1[0] * V2[2];
  V3[2] = V1[0] * V2[1] - V1[1] * V2[0];
  return V3;
}


x86 assembly (clang, -O0):
<RBR_vector_cross>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%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    -0x20(%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    -0x20(%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    -0x20(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RBR_vector_cross>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0xc,%edi
call   1030 <malloc@plt>
movss  0x4(%rbx),%xmm0
movss  0x4(%r14),%xmm1
mulss  0x8(%rbx),%xmm1
mulss  0x8(%r14),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,(%rax)
movss  0x8(%rbx),%xmm0
movss  0x8(%r14),%xmm1
mulss  (%rbx),%xmm1
mulss  (%r14),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,0x4(%rax)
movss  (%rbx),%xmm0
movss  (%r14),%xmm1
mulss  0x4(%rbx),%xmm1
mulss  0x4(%r14),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,0x8(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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