#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 */
double sqrt(double);
double MagCross_lf(double *x, double *y) {
  double z0, z1, z2;
  z0 = x[1] * y[2] - x[2] * y[1];
  z1 = x[2] * y[0] - x[0] * y[2];
  z2 = x[0] * y[1] - x[1] * y[0];
  return sqrt(z0 * z0 + z1 * z1 + z2 * z2);
}


x86 assembly (clang, -O0):
<MagCross_lf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x10(%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,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%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,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%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,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MagCross_lf>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
movsd  0x10(%rsi),%xmm2
movsd  0x10(%rdi),%xmm3
movsd  (%rsi),%xmm4
movsd  0x8(%rsi),%xmm5
movapd %xmm1,%xmm6
mulsd  %xmm2,%xmm6
mulsd  %xmm0,%xmm2
mulsd  %xmm5,%xmm0
mulsd  %xmm3,%xmm5
subsd  %xmm5,%xmm6
mulsd  %xmm4,%xmm3
subsd  %xmm2,%xmm3
mulsd  %xmm1,%xmm4
subsd  %xmm4,%xmm0
mulsd  %xmm3,%xmm3
mulsd  %xmm6,%xmm6
addsd  %xmm3,%xmm6
mulsd  %xmm0,%xmm0
addsd  %xmm6,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1177 <MagCross_lf+0x67>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @MagCross_lf(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i64 1
%10 = load double, double* %9
%11 = load double*, double** %4
%12 = getelementptr inbounds double, double* %11, i64 2
%13 = load double, double* %12
%14 = load double*, double** %3
%15 = getelementptr inbounds double, double* %14, i64 2
%16 = load double, double* %15
%17 = load double*, double** %4
%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)
store double %22, double* %5
%23 = load double*, double** %3
%24 = getelementptr inbounds double, double* %23, i64 2
%25 = load double, double* %24
%26 = load double*, double** %4
%27 = getelementptr inbounds double, double* %26, i64 0
%28 = load double, double* %27
%29 = load double*, double** %3
%30 = getelementptr inbounds double, double* %29, i64 0
%31 = load double, double* %30
%32 = load double*, double** %4
%33 = getelementptr inbounds double, double* %32, i64 2
%34 = load double, double* %33
%35 = fmul double %31, %34
%36 = fneg double %35
%37 = call double @llvm.fmuladd.f64(double %25, double %28, double %36)
store double %37, double* %6
%38 = load double*, double** %3
%39 = getelementptr inbounds double, double* %38, i64 0
%40 = load double, double* %39
%41 = load double*, double** %4
%42 = getelementptr inbounds double, double* %41, i64 1
%43 = load double, double* %42
%44 = load double*, double** %3
%45 = getelementptr inbounds double, double* %44, i64 1
%46 = load double, double* %45
%47 = load double*, double** %4
%48 = getelementptr inbounds double, double* %47, i64 0
%49 = load double, double* %48
%50 = fmul double %46, %49
%51 = fneg double %50
%52 = call double @llvm.fmuladd.f64(double %40, double %43, double %51)
store double %52, double* %7
%53 = load double, double* %5
%54 = load double, double* %5
%55 = load double, double* %6
%56 = load double, double* %6
%57 = fmul double %55, %56
%58 = call double @llvm.fmuladd.f64(double %53, double %54, double %57)
%59 = load double, double* %7
%60 = load double, double* %7
%61 = call double @llvm.fmuladd.f64(double %59, double %60, double %58)
%62 = call double @sqrt(double %61)
ret double %62
}

LLVM IR (-O2):
define double @MagCross_lf(double* nocapture %0, double* nocapture %1) {
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = getelementptr inbounds double, double* %1, i64 2
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %1, i64 1
%10 = load double, double* %9
%11 = fneg double %8
%12 = fmul double %10, %11
%13 = tail call double @llvm.fmuladd.f64(double %4, double %6, double %12)
%14 = load double, double* %1
%15 = load double, double* %0
%16 = fneg double %15
%17 = fmul double %6, %16
%18 = tail call double @llvm.fmuladd.f64(double %8, double %14, double %17)
%19 = fneg double %4
%20 = fmul double %14, %19
%21 = tail call double @llvm.fmuladd.f64(double %15, double %10, double %20)
%22 = fmul double %18, %18
%23 = tail call double @llvm.fmuladd.f64(double %13, double %13, double %22)
%24 = tail call double @llvm.fmuladd.f64(double %21, double %21, double %23)
%25 = tail call double @sqrt(double %24)
ret double %25
}