#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 lldet2(double, double, double, double);
void normvec2(double *v1, double *v2, double *v) {
  v[0] = lldet2(v1[1], v2[1], v1[2], v2[2]);
  v[1] = lldet2(v1[2], v2[2], v1[0], v2[0]);
  v[2] = lldet2(v1[0], v2[0], v1[1], v2[1]);
}


x86 assembly (clang, -O0):
<normvec2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm3
call   1030 <lldet2@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm3
call   1030 <lldet2@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm3
call   1030 <lldet2@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normvec2>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
movsd  0x8(%rdi),%xmm0
movsd  0x10(%rdi),%xmm2
movsd  0x8(%rsi),%xmm1
movsd  0x10(%rsi),%xmm3
call   1030 <lldet2@plt>
movsd  %xmm0,(%r14)
movsd  (%rbx),%xmm2
movsd  0x10(%rbx),%xmm0
movsd  (%r15),%xmm3
movsd  0x10(%r15),%xmm1
call   1030 <lldet2@plt>
movsd  %xmm0,0x8(%r14)
movsd  (%rbx),%xmm0
movsd  0x8(%rbx),%xmm2
movsd  (%r15),%xmm1
movsd  0x8(%r15),%xmm3
call   1030 <lldet2@plt>
movsd  %xmm0,0x10(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @normvec2(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 1
%9 = load double, double* %8
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = load double, double* %11
%13 = load double*, double** %4
%14 = getelementptr inbounds double, double* %13, i64 2
%15 = load double, double* %14
%16 = load double*, double** %5
%17 = getelementptr inbounds double, double* %16, i64 2
%18 = load double, double* %17
%19 = call double @lldet2(double %9, double %12, double %15, double %18)
%20 = load double*, double** %6
%21 = getelementptr inbounds double, double* %20, i64 0
store double %19, double* %21
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = load double*, double** %5
%26 = getelementptr inbounds double, double* %25, i64 2
%27 = load double, double* %26
%28 = load double*, double** %4
%29 = getelementptr inbounds double, double* %28, i64 0
%30 = load double, double* %29
%31 = load double*, double** %5
%32 = getelementptr inbounds double, double* %31, i64 0
%33 = load double, double* %32
%34 = call double @lldet2(double %24, double %27, double %30, double %33)
%35 = load double*, double** %6
%36 = getelementptr inbounds double, double* %35, i64 1
store double %34, double* %36
%37 = load double*, double** %4
%38 = getelementptr inbounds double, double* %37, i64 0
%39 = load double, double* %38
%40 = load double*, double** %5
%41 = getelementptr inbounds double, double* %40, i64 0
%42 = load double, double* %41
%43 = load double*, double** %4
%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 = call double @lldet2(double %39, double %42, double %45, double %48)
%50 = load double*, double** %6
%51 = getelementptr inbounds double, double* %50, i64 2
store double %49, double* %51
ret void
}

LLVM IR (-O2):
define void @normvec2(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %0, i64 2
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %1, i64 2
%11 = load double, double* %10
%12 = tail call double @lldet2(double %5, double %7, double %9, double %11)
store double %12, double* %2
%13 = load double, double* %8
%14 = load double, double* %10
%15 = load double, double* %0
%16 = load double, double* %1
%17 = tail call double @lldet2(double %13, double %14, double %15, double %16)
%18 = getelementptr inbounds double, double* %2, i64 1
store double %17, double* %18
%19 = load double, double* %0
%20 = load double, double* %1
%21 = load double, double* %4
%22 = load double, double* %6
%23 = tail call double @lldet2(double %19, double %20, double %21, double %22)
%24 = getelementptr inbounds double, double* %2, i64 2
store double %23, double* %24
ret void
}