void set_mt(double *vm, double **TM) {
  TM[0][0] = vm[1];
  TM[1][1] = vm[2];
  TM[2][2] = vm[0];
  TM[0][1] = -vm[5];
  TM[0][2] = vm[3];
  TM[1][2] = -vm[4];
  TM[1][0] = TM[0][1];
  TM[2][0] = TM[0][2];
  TM[2][1] = TM[1][2];
}


x86 assembly (clang, -O0):
<set_mt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_mt>:
movsd  0x8(%rdi),%xmm0
mov    (%rsi),%rax
movsd  %xmm0,(%rax)
movsd  0x10(%rdi),%xmm0
mov    0x8(%rsi),%rcx
movsd  %xmm0,0x8(%rcx)
movsd  (%rdi),%xmm0
mov    0x10(%rsi),%rdx
movsd  %xmm0,0x10(%rdx)
movsd  0x28(%rdi),%xmm0
movaps 0xecd(%rip),%xmm1
xorps  %xmm1,%xmm0
movlps %xmm0,0x8(%rax)
movsd  0x18(%rdi),%xmm0
movsd  %xmm0,0x10(%rax)
movsd  0x20(%rdi),%xmm0
xorps  %xmm1,%xmm0
movlps %xmm0,0x10(%rcx)
movsd  0x8(%rax),%xmm0
movsd  %xmm0,(%rcx)
movsd  0x10(%rax),%xmm0
movsd  %xmm0,(%rdx)
movsd  0x10(%rcx),%xmm0
movsd  %xmm0,0x8(%rdx)
ret

LLVM IR (-O0):
define void @set_mt(double* %0, double** %1) {
%3 = alloca double*
%4 = alloca double**
store double* %0, double** %3
store double** %1, double*** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 1
%7 = load double, double* %6
%8 = load double**, double*** %4
%9 = getelementptr inbounds double*, double** %8, i64 0
%10 = load double*, double** %9
%11 = getelementptr inbounds double, double* %10, i64 0
store double %7, double* %11
%12 = load double*, double** %3
%13 = getelementptr inbounds double, double* %12, i64 2
%14 = load double, double* %13
%15 = load double**, double*** %4
%16 = getelementptr inbounds double*, double** %15, i64 1
%17 = load double*, double** %16
%18 = getelementptr inbounds double, double* %17, i64 1
store double %14, double* %18
%19 = load double*, double** %3
%20 = getelementptr inbounds double, double* %19, i64 0
%21 = load double, double* %20
%22 = load double**, double*** %4
%23 = getelementptr inbounds double*, double** %22, i64 2
%24 = load double*, double** %23
%25 = getelementptr inbounds double, double* %24, i64 2
store double %21, double* %25
%26 = load double*, double** %3
%27 = getelementptr inbounds double, double* %26, i64 5
%28 = load double, double* %27
%29 = fneg double %28
%30 = load double**, double*** %4
%31 = getelementptr inbounds double*, double** %30, i64 0
%32 = load double*, double** %31
%33 = getelementptr inbounds double, double* %32, i64 1
store double %29, double* %33
%34 = load double*, double** %3
%35 = getelementptr inbounds double, double* %34, i64 3
%36 = load double, double* %35
%37 = load double**, double*** %4
%38 = getelementptr inbounds double*, double** %37, i64 0
%39 = load double*, double** %38
%40 = getelementptr inbounds double, double* %39, i64 2
store double %36, double* %40
%41 = load double*, double** %3
%42 = getelementptr inbounds double, double* %41, i64 4
%43 = load double, double* %42
%44 = fneg double %43
%45 = load double**, double*** %4
%46 = getelementptr inbounds double*, double** %45, i64 1
%47 = load double*, double** %46
%48 = getelementptr inbounds double, double* %47, i64 2
store double %44, double* %48
%49 = load double**, double*** %4
%50 = getelementptr inbounds double*, double** %49, i64 0
%51 = load double*, double** %50
%52 = getelementptr inbounds double, double* %51, i64 1
%53 = load double, double* %52
%54 = load double**, double*** %4
%55 = getelementptr inbounds double*, double** %54, i64 1
%56 = load double*, double** %55
%57 = getelementptr inbounds double, double* %56, i64 0
store double %53, double* %57
%58 = load double**, double*** %4
%59 = getelementptr inbounds double*, double** %58, i64 0
%60 = load double*, double** %59
%61 = getelementptr inbounds double, double* %60, i64 2
%62 = load double, double* %61
%63 = load double**, double*** %4
%64 = getelementptr inbounds double*, double** %63, i64 2
%65 = load double*, double** %64
%66 = getelementptr inbounds double, double* %65, i64 0
store double %62, double* %66
%67 = load double**, double*** %4
%68 = getelementptr inbounds double*, double** %67, i64 1
%69 = load double*, double** %68
%70 = getelementptr inbounds double, double* %69, i64 2
%71 = load double, double* %70
%72 = load double**, double*** %4
%73 = getelementptr inbounds double*, double** %72, i64 2
%74 = load double*, double** %73
%75 = getelementptr inbounds double, double* %74, i64 1
store double %71, double* %75
ret void
}

LLVM IR (-O2):
define void @set_mt(double* nocapture %0, double** nocapture %1) {
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = load double*, double** %1
store double %4, double* %5
%6 = getelementptr inbounds double, double* %0, i64 2
%7 = load double, double* %6
%8 = getelementptr inbounds double*, double** %1, i64 1
%9 = load double*, double** %8
%10 = getelementptr inbounds double, double* %9, i64 1
store double %7, double* %10
%11 = load double, double* %0
%12 = getelementptr inbounds double*, double** %1, i64 2
%13 = load double*, double** %12
%14 = getelementptr inbounds double, double* %13, i64 2
store double %11, double* %14
%15 = getelementptr inbounds double, double* %0, i64 5
%16 = load double, double* %15
%17 = fneg double %16
%18 = getelementptr inbounds double, double* %5, i64 1
store double %17, double* %18
%19 = getelementptr inbounds double, double* %0, i64 3
%20 = load double, double* %19
%21 = getelementptr inbounds double, double* %5, i64 2
store double %20, double* %21
%22 = getelementptr inbounds double, double* %0, i64 4
%23 = load double, double* %22
%24 = fneg double %23
%25 = getelementptr inbounds double, double* %9, i64 2
store double %24, double* %25
%26 = load double, double* %18
store double %26, double* %9
%27 = load double, double* %21
store double %27, double* %13
%28 = load double, double* %25
%29 = getelementptr inbounds double, double* %13, i64 1
store double %28, double* %29
ret void
}