#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int nums[4][4];
  int r = 0, c = 0;
  int nums2[4][4];
  for (r = 0; r <= 3; r++) {
    for (c = 0; c <= 3; c++) {
      scanf("%d", &nums[r][c]);
    }
  }
  r = 0;
  c = 0;
  for (r = 0; r <= 3; r++) {
    for (c = 0; c <= 3; c++) {
      nums2[r][c] = nums[c][r];
    }
  }
  for (r = 0; r <= 3; r++) {
    printf("\n");
    for (c = 0; c <= 3; c++) {
      printf("%d \t", nums2[r][c]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
movl   $0x0,-0x54(%rbp)
cmpl   $0x3,-0x54(%rbp)
jg     11a9 <main+0x89>
movl   $0x0,-0x58(%rbp)
cmpl   $0x3,-0x58(%rbp)
jg     1196 <main+0x76>
movslq -0x54(%rbp),%rax
lea    -0x50(%rbp),%rsi
shl    $0x4,%rax
add    %rax,%rsi
movslq -0x58(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe7d(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    1158 <main+0x38>
jmp    119b <main+0x7b>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1147 <main+0x27>
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
movl   $0x0,-0x54(%rbp)
cmpl   $0x3,-0x54(%rbp)
jg     1229 <main+0x109>
movl   $0x0,-0x58(%rbp)
cmpl   $0x3,-0x58(%rbp)
jg     1216 <main+0xf6>
movslq -0x58(%rbp),%rcx
lea    -0x50(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x54(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
movslq -0x54(%rbp),%rcx
lea    -0xa0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x58(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    11cf <main+0xaf>
jmp    121b <main+0xfb>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    11be <main+0x9e>
movl   $0x0,-0x54(%rbp)
cmpl   $0x3,-0x54(%rbp)
jg     12a1 <main+0x181>
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x58(%rbp)
cmpl   $0x3,-0x58(%rbp)
jg     128e <main+0x16e>
movslq -0x54(%rbp),%rcx
lea    -0xa0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x58(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    124f <main+0x12f>
jmp    1293 <main+0x173>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1230 <main+0x110>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
lea    0xebb(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x28(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x2c(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x30(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x34(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x38(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x3c(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x10(%rsp),%ebp
mov    0x20(%rsp),%r13d
mov    0x30(%rsp),%r12d
mov    (%rsp),%r14d
mov    0x4(%rsp),%r15d
mov    0x14(%rsp),%eax
mov    %eax,0x4c(%rsp)
mov    0x24(%rsp),%eax
mov    %eax,0x50(%rsp)
mov    0x34(%rsp),%eax
mov    %eax,0x54(%rsp)
mov    0x8(%rsp),%eax
mov    %eax,0x58(%rsp)
mov    0x18(%rsp),%eax
mov    %eax,0x5c(%rsp)
mov    0x28(%rsp),%eax
mov    %eax,0x60(%rsp)
mov    0x38(%rsp),%eax
mov    %eax,0x64(%rsp)
mov    0xc(%rsp),%eax
mov    %eax,0x68(%rsp)
mov    0x1c(%rsp),%eax
mov    %eax,0x6c(%rsp)
mov    0x2c(%rsp),%eax
mov    %eax,0x70(%rsp)
mov    0x3c(%rsp),%eax
mov    %eax,0x74(%rsp)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd70(%rip),%rbx
mov    %rbx,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    0x4c(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    0x50(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    0x54(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    0x58(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    0x5c(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    0x60(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    0x64(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    0x68(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    0x6c(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    0x70(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    0x74(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [5 x i8] c"%d \09\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x [4 x i32]]
%3 = alloca i32
%4 = alloca i32
%5 = alloca [4 x [4 x i32]]
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %3
br label %6
6: ; preds = %25, %0
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 3
br i1 %8, label %9, label %28
9: ; preds = %6
store i32 0, i32* %4
br label %10
10: ; preds = %21, %9
%11 = load i32, i32* %4
%12 = icmp sle i32 %11, 3
br i1 %12, label %13, label %24
13: ; preds = %10
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %2, i64 0, i64 %15
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [4 x i32], [4 x i32]* %16, i64 0, i64 %18
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %19)
br label %21
21: ; preds = %13
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %10
24: ; preds = %10
br label %25
25: ; preds = %24
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %6
28: ; preds = %6
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %3
br label %29
29: ; preds = %54, %28
%30 = load i32, i32* %3
%31 = icmp sle i32 %30, 3
br i1 %31, label %32, label %57
32: ; preds = %29
store i32 0, i32* %4
br label %33
33: ; preds = %50, %32
%34 = load i32, i32* %4
%35 = icmp sle i32 %34, 3
br i1 %35, label %36, label %53
36: ; preds = %33
%37 = load i32, i32* %4
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %2, i64 0, i64 %38
%40 = load i32, i32* %3
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [4 x i32], [4 x i32]* %39, i64 0, i64 %41
%43 = load i32, i32* %42
%44 = load i32, i32* %3
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %5, i64 0, i64 %45
%47 = load i32, i32* %4
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [4 x i32], [4 x i32]* %46, i64 0, i64 %48
store i32 %43, i32* %49
br label %50
50: ; preds = %36
%51 = load i32, i32* %4
%52 = add nsw i32 %51, 1
store i32 %52, i32* %4
br label %33
53: ; preds = %33
br label %54
54: ; preds = %53
%55 = load i32, i32* %3
%56 = add nsw i32 %55, 1
store i32 %56, i32* %3
br label %29
57: ; preds = %29
store i32 0, i32* %3
br label %58
58: ; preds = %79, %57
%59 = load i32, i32* %3
%60 = icmp sle i32 %59, 3
br i1 %60, label %61, label %82
61: ; preds = %58
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %4
br label %63
63: ; preds = %75, %61
%64 = load i32, i32* %4
%65 = icmp sle i32 %64, 3
br i1 %65, label %66, label %78
66: ; preds = %63
%67 = load i32, i32* %3
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %5, i64 0, i64 %68
%70 = load i32, i32* %4
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [4 x i32], [4 x i32]* %69, i64 0, i64 %71
%73 = load i32, i32* %72
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %73)
br label %75
75: ; preds = %66
%76 = load i32, i32* %4
%77 = add nsw i32 %76, 1
store i32 %77, i32* %4
br label %63
78: ; preds = %63
br label %79
79: ; preds = %78
%80 = load i32, i32* %3
%81 = add nsw i32 %80, 1
store i32 %81, i32* %3
br label %58
82: ; preds = %58
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c"%d \09\00"
define i32 @main() {
%1 = alloca [4 x [4 x i32]]
%2 = bitcast [4 x [4 x i32]]* %1 to i8*
%3 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %1, i64 0, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %1, i64 0, i64 0, i64 1
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%7 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %1, i64 0, i64 0, i64 2
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%9 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %1, i64 0, i64 0, i64 3
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %1, i64 0, i64 1, i64 0
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %11)
%13 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %1, i64 0, i64 1, i64 1
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %13)
%15 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %1, i64 0, i64 1, i64 2
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %15)
%17 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %1, i64 0, i64 1, i64 3
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %17)
%19 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %1, i64 0, i64 2, i64 0
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %19)
%21 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %1, i64 0, i64 2, i64 1
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %21)
%23 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %1, i64 0, i64 2, i64 2
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %23)
%25 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %1, i64 0, i64 2, i64 3
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %25)
%27 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %1, i64 0, i64 3, i64 0
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %27)
%29 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %1, i64 0, i64 3, i64 1
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %29)
%31 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %1, i64 0, i64 3, i64 2
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %31)
%33 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %1, i64 0, i64 3, i64 3
%34 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %33)
%35 = load i32, i32* %3
%36 = load i32, i32* %11
%37 = load i32, i32* %19
%38 = load i32, i32* %27
%39 = load i32, i32* %5
%40 = load i32, i32* %13
%41 = load i32, i32* %21
%42 = load i32, i32* %29
%43 = load i32, i32* %7
%44 = load i32, i32* %15
%45 = load i32, i32* %23
%46 = load i32, i32* %31
%47 = load i32, i32* %9
%48 = load i32, i32* %17
%49 = load i32, i32* %25
%50 = load i32, i32* %33
%51 = call i32 @putchar(i32 10)
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %35)
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %36)
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %37)
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %38)
%56 = call i32 @putchar(i32 10)
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %39)
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %40)
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %41)
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %42)
%61 = call i32 @putchar(i32 10)
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %43)
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %44)
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %45)
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %46)
%66 = call i32 @putchar(i32 10)
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %47)
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %48)
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %49)
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %50)
ret i32 0
}