#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*/ input_5x5(int **);
int /*<<< orphan*/ print_5x5(int **);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ transpose_5x5(int **, int **);
int main() {
  int a[5][5], b[5][5];
  printf("Please input the elements of the 5x5 matrix\n");
  input_5x5(a);
  printf("The matrix you input is:\n");
  print_5x5(a);
  transpose_5x5(a, b);
  printf("The transpose of the matrix is:\n");
  print_5x5(b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1040 <input_5x5@plt>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1060 <print_5x5@plt>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1050 <transpose_5x5@plt>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
lea    -0xe0(%rbp),%rdi
call   1060 <print_5x5@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <input_5x5@plt>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1060 <print_5x5@plt>
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <transpose_5x5@plt>
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1060 <print_5x5@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [45 x i8] c"Please input the elements of the 5x5 matrix\0A\00"
@.str.1 = [26 x i8] c"The matrix you input is:\0A\00"
@.str.2 = [33 x i8] c"The transpose of the matrix is:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x [5 x i32]]
%3 = alloca [5 x [5 x i32]]
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %2, i64 0, i64 0
%6 = bitcast [5 x i32]* %5 to i32**
%7 = call i32 @input_5x5(i32** %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%9 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %2, i64 0, i64 0
%10 = bitcast [5 x i32]* %9 to i32**
%11 = call i32 @print_5x5(i32** %10)
%12 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %2, i64 0, i64 0
%13 = bitcast [5 x i32]* %12 to i32**
%14 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 0
%15 = bitcast [5 x i32]* %14 to i32**
%16 = call i32 @transpose_5x5(i32** %13, i32** %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%18 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 0
%19 = bitcast [5 x i32]* %18 to i32**
%20 = call i32 @print_5x5(i32** %19)
ret i32 0
}

LLVM IR (-O2):
@str = [44 x i8] c"Please input the elements of the 5x5 matrix\00"
@str.3 = [25 x i8] c"The matrix you input is:\00"
@str.4 = [32 x i8] c"The transpose of the matrix is:\00"
define i32 @main() {
%1 = alloca [5 x [5 x i32]]
%2 = alloca [5 x [5 x i32]]
%3 = bitcast [5 x [5 x i32]]* %1 to i8*
%4 = bitcast [5 x [5 x i32]]* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%6 = bitcast [5 x [5 x i32]]* %1 to i32**
%7 = call i32 @input_5x5(i32** %6)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.3, i64 0, i64 0))
%9 = call i32 @print_5x5(i32** %6)
%10 = bitcast [5 x [5 x i32]]* %2 to i32**
%11 = call i32 @transpose_5x5(i32** %6, i32** %10)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.4, i64 0, i64 0))
%13 = call i32 @print_5x5(i32** %10)
ret i32 0
}