#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 **double_alloc2(int, int);
double **set_mt(double *vm) {
  double **TM;
  TM = double_alloc2(3, 3);
  TM[0][0] = vm[0];
  TM[1][1] = vm[1];
  TM[2][2] = vm[2];
  TM[0][1] = vm[3];
  TM[0][2] = vm[4];
  TM[1][2] = vm[5];
  TM[1][0] = TM[0][1];
  TM[2][0] = TM[0][2];
  TM[2][1] = TM[1][2];
  return TM;
}


x86 assembly (clang, -O0):
<set_mt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x3,%esi
mov    %esi,%edi
call   1030 <double_alloc2@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
movsd  0x28(%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)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_mt>:
push   %rbx
mov    %rdi,%rbx
mov    $0x3,%edi
mov    $0x3,%esi
call   1030 <double_alloc2@plt>
movsd  (%rbx),%xmm0
mov    (%rax),%rcx
movsd  %xmm0,(%rcx)
movsd  0x8(%rbx),%xmm0
mov    0x8(%rax),%rdx
movsd  %xmm0,0x8(%rdx)
movsd  0x10(%rbx),%xmm0
mov    0x10(%rax),%rsi
movsd  %xmm0,0x10(%rsi)
movsd  0x18(%rbx),%xmm0
movsd  %xmm0,0x8(%rcx)
movsd  0x20(%rbx),%xmm0
movsd  %xmm0,0x10(%rcx)
movsd  0x28(%rbx),%xmm0
movsd  %xmm0,0x10(%rdx)
movsd  0x8(%rcx),%xmm0
movsd  %xmm0,(%rdx)
movsd  0x10(%rcx),%xmm0
movsd  %xmm0,(%rsi)
movsd  0x10(%rdx),%xmm0
movsd  %xmm0,0x8(%rsi)
pop    %rbx
ret

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

LLVM IR (-O2):
define double** @set_mt(double* nocapture %0) {
%2 = tail call double** @double_alloc2(i32 3, i32 3)
%3 = load double, double* %0
%4 = load double*, double** %2
store double %3, double* %4
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double*, double** %2, i64 1
%8 = load double*, double** %7
%9 = getelementptr inbounds double, double* %8, i64 1
store double %6, double* %9
%10 = getelementptr inbounds double, double* %0, i64 2
%11 = load double, double* %10
%12 = getelementptr inbounds double*, double** %2, 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 3
%16 = load double, double* %15
%17 = getelementptr inbounds double, double* %4, i64 1
store double %16, double* %17
%18 = getelementptr inbounds double, double* %0, i64 4
%19 = load double, double* %18
%20 = getelementptr inbounds double, double* %4, i64 2
store double %19, double* %20
%21 = getelementptr inbounds double, double* %0, i64 5
%22 = load double, double* %21
%23 = getelementptr inbounds double, double* %8, i64 2
store double %22, double* %23
%24 = load double, double* %17
store double %24, double* %8
%25 = load double, double* %20
store double %25, double* %13
%26 = load double, double* %23
%27 = getelementptr inbounds double, double* %13, i64 1
store double %26, double* %27
ret double** %2
}