#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*/ assign(double *, double *);
void v_mult(double *r, const double *a, const double *b) {
  double temp[3];
  temp[0] = a[1] * b[2] - a[2] * b[1];
  temp[1] = a[2] * b[0] - a[0] * b[2];
  temp[2] = a[0] * b[1] - a[1] * b[0];
  assign(r, temp);
}


x86 assembly (clang, -O0):
<v_mult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x18(%rbp),%rax
mulsd  0x8(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
mulsd  0x10(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x18(%rbp),%rax
mulsd  (%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <assign@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_mult>:
sub    $0x18,%rsp
movupd 0x8(%rsi),%xmm0
movupd 0x8(%rdx),%xmm1
movsd  (%rdx),%xmm2
movsd  (%rsi),%xmm3
movapd %xmm0,%xmm4
shufpd $0x1,%xmm3,%xmm4
mulpd  %xmm1,%xmm4
mulsd  %xmm1,%xmm3
shufpd $0x1,%xmm2,%xmm1
mulpd  %xmm0,%xmm1
subpd  %xmm4,%xmm1
movapd %xmm1,(%rsp)
mulsd  %xmm0,%xmm2
subsd  %xmm2,%xmm3
movsd  %xmm3,0x10(%rsp)
mov    %rsp,%rsi
call   1030 <assign@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define void @v_mult(double* %0, double* nocapture %1, double* nocapture %2) {
%4 = alloca [3 x double]
%5 = bitcast [3 x double]* %4 to i8*
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = bitcast double* %6 to <2 x double>*
%8 = load <2 x double>, <2 x double>* %7
%9 = getelementptr inbounds double, double* %2, i64 1
%10 = bitcast double* %9 to <2 x double>*
%11 = load <2 x double>, <2 x double>* %10
%12 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%13 = load double, double* %2
%14 = load double, double* %1
%15 = insertelement <2 x double> %8, double %14, i64 0
%16 = fneg <2 x double> %15
%17 = shufflevector <2 x double> %16, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%18 = fmul <2 x double> %11, %17
%19 = extractelement <2 x double> %11, i64 1
%20 = insertelement <2 x double> poison, double %19, i64 0
%21 = insertelement <2 x double> %20, double %13, i64 1
%22 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %8, <2 x double> %21, <2 x double> %18)
%23 = bitcast [3 x double]* %4 to <2 x double>*
store <2 x double> %22, <2 x double>* %23
%24 = extractelement <2 x double> %8, i64 0
%25 = fneg double %24
%26 = fmul double %13, %25
%27 = extractelement <2 x double> %11, i64 0
%28 = tail call double @llvm.fmuladd.f64(double %14, double %27, double %26)
%29 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 2
store double %28, double* %29
%30 = call i32 @assign(double* %0, double* %12)
ret void
}