#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 masiv[4][4];
  int masiv2[4][4];
  int i, k;
  printf("vavedi elementite na masiva");
  for (i = 0; i < 4; i++) {
    for (k = 0; k < 4; k++) {
      scanf("%d", &masiv[i][k]);
    }
  }
  for (k = 0; k < 4; k++) {
    for (i = 0; i < 4; i++) {
      masiv2[k][i] = masiv[i][k];
    }
  }
  for (k = 0; k < 4; k++) {
    for (i = 0; i < 4; i++) {
      printf("%d", masiv2[k][i]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x94(%rbp)
cmpl   $0x4,-0x94(%rbp)
jge    11c7 <main+0xa7>
movl   $0x0,-0x98(%rbp)
cmpl   $0x4,-0x98(%rbp)
jge    11ae <main+0x8e>
movslq -0x94(%rbp),%rax
lea    -0x50(%rbp),%rsi
shl    $0x4,%rax
add    %rax,%rsi
movslq -0x98(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe87(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    1161 <main+0x41>
jmp    11b3 <main+0x93>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    114a <main+0x2a>
movl   $0x0,-0x98(%rbp)
cmpl   $0x4,-0x98(%rbp)
jge    125d <main+0x13d>
movl   $0x0,-0x94(%rbp)
cmpl   $0x4,-0x94(%rbp)
jge    1244 <main+0x124>
movslq -0x94(%rbp),%rcx
lea    -0x50(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x98(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
movslq -0x98(%rbp),%rcx
lea    -0x90(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x94(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    11e8 <main+0xc8>
jmp    1249 <main+0x129>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    11d1 <main+0xb1>
movl   $0x0,-0x98(%rbp)
cmpl   $0x4,-0x98(%rbp)
jge    12e5 <main+0x1c5>
movl   $0x0,-0x94(%rbp)
cmpl   $0x4,-0x94(%rbp)
jge    12cc <main+0x1ac>
movslq -0x98(%rbp),%rcx
lea    -0x90(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x94(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    127e <main+0x15e>
jmp    12d1 <main+0x1b1>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    1267 <main+0x147>
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    $0x68,%rsp
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed9(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x28(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x2c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x30(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x34(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x38(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x3c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x10(%rsp),%r13d
mov    0x20(%rsp),%ebp
mov    0x30(%rsp),%r12d
mov    (%rsp),%esi
mov    0x4(%rsp),%r15d
mov    0x14(%rsp),%r14d
mov    0x24(%rsp),%eax
mov    %eax,0x40(%rsp)
mov    0x34(%rsp),%eax
mov    %eax,0x44(%rsp)
mov    0x8(%rsp),%eax
mov    %eax,0x48(%rsp)
mov    0x18(%rsp),%eax
mov    %eax,0x4c(%rsp)
mov    0x28(%rsp),%eax
mov    %eax,0x50(%rsp)
mov    0x38(%rsp),%eax
mov    %eax,0x54(%rsp)
mov    0xc(%rsp),%eax
mov    %eax,0x58(%rsp)
mov    0x1c(%rsp),%eax
mov    %eax,0x5c(%rsp)
mov    0x2c(%rsp),%eax
mov    %eax,0x60(%rsp)
mov    0x3c(%rsp),%eax
mov    %eax,0x64(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    0x40(%rsp),%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    0x44(%rsp),%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    0x48(%rsp),%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    0x4c(%rsp),%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    0x50(%rsp),%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    0x54(%rsp),%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    0x58(%rsp),%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    0x5c(%rsp),%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    0x60(%rsp),%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    0x64(%rsp),%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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