#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_l3(long **, long **);
void mat_transpose_matrix_l3(long a[3][3], long b[3][3]) {
  long 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_l3(a, c);
}


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

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

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

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