#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_i3(int **, int **);
void mat_transpose_matrix_i3(int a[3][3], int b[3][3]) {
  int 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_i3(a, c);
}


x86 assembly (clang, -O0):
<mat_transpose_matrix_i3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%eax
mov    %eax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%eax
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1c(%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x14(%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <mat_copy_matrix_i3@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat_transpose_matrix_i3>:
sub    $0x28,%rsp
mov    (%rsi),%eax
mov    %eax,(%rsp)
mov    0xc(%rsi),%eax
mov    %eax,0x4(%rsp)
mov    0x18(%rsi),%eax
mov    %eax,0x8(%rsp)
mov    0x4(%rsi),%eax
mov    %eax,0xc(%rsp)
mov    0x10(%rsi),%eax
mov    %eax,0x10(%rsp)
mov    0x1c(%rsi),%eax
mov    %eax,0x14(%rsp)
mov    0x8(%rsi),%eax
mov    %eax,0x18(%rsp)
mov    0x14(%rsi),%eax
mov    %eax,0x1c(%rsp)
mov    0x20(%rsi),%eax
mov    %eax,0x20(%rsp)
mov    %rsp,%rsi
call   1030 <mat_copy_matrix_i3@plt>
add    $0x28,%rsp
ret

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

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