#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*/ swp(double *, double *);
void ltr_int_transpose_in_place(double matrix[3][3]) {
  swp(&matrix[0][1], &matrix[1][0]);
  swp(&matrix[0][2], &matrix[2][0]);
  swp(&matrix[1][2], &matrix[2][1]);
}


x86 assembly (clang, -O0):
<ltr_int_transpose_in_place>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
mov    -0x8(%rbp),%rsi
add    $0x18,%rsi
call   1030 <swp@plt>
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
mov    -0x8(%rbp),%rsi
add    $0x30,%rsi
call   1030 <swp@plt>
mov    -0x8(%rbp),%rdi
add    $0x18,%rdi
add    $0x10,%rdi
mov    -0x8(%rbp),%rsi
add    $0x30,%rsi
add    $0x8,%rsi
call   1030 <swp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltr_int_transpose_in_place>:
push   %rbx
mov    %rdi,%rbx
add    $0x8,%rdi
lea    0x18(%rbx),%rsi
call   1030 <swp@plt>
lea    0x10(%rbx),%rdi
lea    0x30(%rbx),%rsi
call   1030 <swp@plt>
lea    0x28(%rbx),%rdi
add    $0x38,%rbx
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <swp@plt>

LLVM IR (-O0):
define void @ltr_int_transpose_in_place([3 x double]* %0) {
%2 = alloca [3 x double]*
store [3 x double]* %0, [3 x double]** %2
%3 = load [3 x double]*, [3 x double]** %2
%4 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0
%5 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 1
%6 = load [3 x double]*, [3 x double]** %2
%7 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 1
%8 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%9 = call i32 @swp(double* %5, double* %8)
%10 = load [3 x double]*, [3 x double]** %2
%11 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0
%12 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 2
%13 = load [3 x double]*, [3 x double]** %2
%14 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 2
%15 = getelementptr inbounds [3 x double], [3 x double]* %14, i64 0, i64 0
%16 = call i32 @swp(double* %12, double* %15)
%17 = load [3 x double]*, [3 x double]** %2
%18 = getelementptr inbounds [3 x double], [3 x double]* %17, i64 1
%19 = getelementptr inbounds [3 x double], [3 x double]* %18, i64 0, i64 2
%20 = load [3 x double]*, [3 x double]** %2
%21 = getelementptr inbounds [3 x double], [3 x double]* %20, i64 2
%22 = getelementptr inbounds [3 x double], [3 x double]* %21, i64 0, i64 1
%23 = call i32 @swp(double* %19, double* %22)
ret void
}

LLVM IR (-O2):
define void @ltr_int_transpose_in_place([3 x double]* %0) {
%2 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 1
%3 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 0
%4 = tail call i32 @swp(double* %2, double* %3)
%5 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 2
%6 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 0
%7 = tail call i32 @swp(double* %5, double* %6)
%8 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 2
%9 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 1
%10 = tail call i32 @swp(double* %8, double* %9)
ret void
}