#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*/ mat_copy_matrix_d3(double **, double **);
void mat_transpose_matrix_d3(double a[3][3], double b[3][3]) {
  double c[3][3];
  c[0][0] = b[0][0];
  c[0][1] = b[1][0];
  c[0][2] = b[2][0];
  c[1][0] = b[0][1];
  c[1][1] = b[1][1];
  c[1][2] = b[2][1];
  c[2][0] = b[0][2];
  c[2][1] = b[1][2];
  c[2][2] = b[2][2];
  mat_copy_matrix_d3(a, c);
}


x86 assembly (clang, -O0):
<mat_transpose_matrix_d3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x30(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x38(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x40(%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <mat_copy_matrix_d3@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat_transpose_matrix_d3>:
sub    $0x48,%rsp
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x18(%rsi),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x30(%rsi),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x20(%rsi),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x38(%rsi),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  0x28(%rsi),%xmm0
movsd  %xmm0,0x38(%rsp)
movsd  0x40(%rsi),%xmm0
movsd  %xmm0,0x40(%rsp)
mov    %rsp,%rsi
call   1030 <mat_copy_matrix_d3@plt>
add    $0x48,%rsp
ret

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

LLVM IR (-O2):
define void @mat_transpose_matrix_d3([3 x double]* %0, [3 x double]* nocapture %1) {
%3 = alloca [3 x [3 x double]]
%4 = bitcast [3 x [3 x double]]* %3 to i8*
%5 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
%6 = load double, double* %5
%7 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %3, i64 0, i64 0, i64 0
store double %6, double* %7
%8 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 1, i64 0
%9 = load double, double* %8
%10 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %3, i64 0, i64 0, i64 1
store double %9, double* %10
%11 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 2, i64 0
%12 = load double, double* %11
%13 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %3, i64 0, i64 0, i64 2
store double %12, double* %13
%14 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 1
%15 = load double, double* %14
%16 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %3, i64 0, i64 1, i64 0
store double %15, double* %16
%17 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 1, i64 1
%18 = load double, double* %17
%19 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %3, i64 0, i64 1, i64 1
store double %18, double* %19
%20 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 2, i64 1
%21 = load double, double* %20
%22 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %3, i64 0, i64 1, i64 2
store double %21, double* %22
%23 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 2
%24 = load double, double* %23
%25 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %3, i64 0, i64 2, i64 0
store double %24, double* %25
%26 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 1, i64 2
%27 = load double, double* %26
%28 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %3, i64 0, i64 2, i64 1
store double %27, double* %28
%29 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 2, i64 2
%30 = load double, double* %29
%31 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %3, i64 0, i64 2, i64 2
store double %30, double* %31
%32 = bitcast [3 x double]* %0 to double**
%33 = bitcast [3 x [3 x double]]* %3 to double**
%34 = call i32 @mat_copy_matrix_d3(double** %32, double** %33)
ret void
}