#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 *, float *);
int main() {
  float a[4][4];
  float b[4][4];
  int i, j;
  for (i = 0; i < 4; i++)
    for (j = 0; j < 4; j++) {
      printf("a%d,%d=", i + 1, j + 1);
      scanf("%f", &a[i][j]);
      b[j][i] = a[i][j];
    }
  printf(": \n");
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 4; j++)
      printf("%2.0f ", b[i][j]);
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x94(%rbp)
cmpl   $0x4,-0x94(%rbp)
jge    1218 <main+0xf8>
movl   $0x0,-0x98(%rbp)
cmpl   $0x4,-0x98(%rbp)
jge    11ff <main+0xdf>
mov    -0x94(%rbp),%esi
add    $0x1,%esi
mov    -0x98(%rbp),%edx
add    $0x1,%edx
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
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    0xe61(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x94(%rbp),%rcx
lea    -0x50(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x98(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movslq -0x98(%rbp),%rcx
lea    -0x90(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x94(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    1153 <main+0x33>
jmp    1204 <main+0xe4>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    113c <main+0x1c>
lea    0xdec(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x94(%rbp)
cmpl   $0x4,-0x94(%rbp)
jge    12bd <main+0x19d>
movl   $0x0,-0x98(%rbp)
cmpl   $0x4,-0x98(%rbp)
jge    129b <main+0x17b>
movslq -0x94(%rbp),%rcx
lea    -0x90(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x98(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd8f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    1247 <main+0x127>
lea    0xd6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%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   %r12
push   %rbx
sub    $0x80,%rsp
mov    $0xfffffffffffffffc,%rbx
lea    0xea3(%rip),%r14
lea    0xea4(%rip),%r15
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
lea    0x5(%rbx),%r12d
mov    %r14,%rdi
mov    %r12d,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    (%rsp,%rbp,1),%rsi
add    $0x40,%rsi
mov    %r15,%rdi
call   1060 <scanf@plt>
movss  0x40(%rsp,%rbp,1),%xmm0
movss  %xmm0,0x10(%rsp,%rbx,4)
mov    %r14,%rdi
mov    %r12d,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    (%rsp,%rbp,1),%rsi
add    $0x44,%rsi
mov    %r15,%rdi
call   1060 <scanf@plt>
movss  0x44(%rsp,%rbp,1),%xmm0
movss  %xmm0,0x20(%rsp,%rbx,4)
mov    %r14,%rdi
mov    %r12d,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    (%rsp,%rbp,1),%rsi
add    $0x48,%rsi
mov    %r15,%rdi
call   1060 <scanf@plt>
movss  0x48(%rsp,%rbp,1),%xmm0
movss  %xmm0,0x30(%rsp,%rbx,4)
mov    %r14,%rdi
mov    %r12d,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    (%rsp,%rbp,1),%rsi
add    $0x4c,%rsi
mov    %r15,%rdi
call   1060 <scanf@plt>
movss  0x4c(%rsp,%rbp,1),%xmm0
movss  %xmm0,0x40(%rsp,%rbx,4)
add    $0x10,%rbp
add    $0x1,%rbx
cmp    $0x40,%rbp
jne    1170 <main+0x30>
lea    0xdcd(%rip),%rdi
call   1040 <puts@plt>
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdb1(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x18(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x1c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movss  0x20(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x24(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x28(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x2c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movss  0x30(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x34(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x38(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x3c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"a%d,%d=\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.3 = [7 x i8] c"%2.0f \00"
@str = [3 x i8] c": \00"
define i32 @main() {
%1 = alloca [4 x [4 x float]]
%2 = alloca [4 x [4 x float]]
%3 = bitcast [4 x [4 x float]]* %1 to i8*
%4 = bitcast [4 x [4 x float]]* %2 to i8*
br label %5
5: ; preds = %0, %5
%6 = phi i64 [ 0, %0 ], [ %7, %5 ]
%7 = add nuw nsw i64 %6, 1
%8 = trunc i64 %7 to i32
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %8, i32 1)
%10 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %1, i64 0, i64 %6, i64 0
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %10)
%12 = load float, float* %10
%13 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %2, i64 0, i64 0, i64 %6
store float %12, float* %13
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %8, i32 2)
%15 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %1, i64 0, i64 %6, i64 1
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %15)
%17 = load float, float* %15
%18 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %2, i64 0, i64 1, i64 %6
store float %17, float* %18
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %8, i32 3)
%20 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %1, i64 0, i64 %6, i64 2
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %20)
%22 = load float, float* %20
%23 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %2, i64 0, i64 2, i64 %6
store float %22, float* %23
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %8, i32 4)
%25 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %1, i64 0, i64 %6, i64 3
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %25)
%27 = load float, float* %25
%28 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %2, i64 0, i64 3, i64 %6
store float %27, float* %28
%29 = icmp eq i64 %7, 4
br i1 %29, label %30, label %5
30: ; preds = %5
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%32 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %2, i64 0, i64 0, i64 0
%33 = load float, float* %32
%34 = fpext float %33 to double
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %34)
%36 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %2, i64 0, i64 0, i64 1
%37 = load float, float* %36
%38 = fpext float %37 to double
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %38)
%40 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %2, i64 0, i64 0, i64 2
%41 = load float, float* %40
%42 = fpext float %41 to double
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %42)
%44 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %2, i64 0, i64 0, i64 3
%45 = load float, float* %44
%46 = fpext float %45 to double
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %46)
%48 = call i32 @putchar(i32 10)
%49 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %2, i64 0, i64 1, i64 0
%50 = load float, float* %49
%51 = fpext float %50 to double
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %51)
%53 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %2, i64 0, i64 1, i64 1
%54 = load float, float* %53
%55 = fpext float %54 to double
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %55)
%57 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %2, i64 0, i64 1, i64 2
%58 = load float, float* %57
%59 = fpext float %58 to double
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %59)
%61 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %2, i64 0, i64 1, i64 3
%62 = load float, float* %61
%63 = fpext float %62 to double
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %63)
%65 = call i32 @putchar(i32 10)
%66 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %2, i64 0, i64 2, i64 0
%67 = load float, float* %66
%68 = fpext float %67 to double
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %68)
%70 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %2, i64 0, i64 2, i64 1
%71 = load float, float* %70
%72 = fpext float %71 to double
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %72)
%74 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %2, i64 0, i64 2, i64 2
%75 = load float, float* %74
%76 = fpext float %75 to double
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %76)
%78 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %2, i64 0, i64 2, i64 3
%79 = load float, float* %78
%80 = fpext float %79 to double
%81 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %80)
%82 = call i32 @putchar(i32 10)
%83 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %2, i64 0, i64 3, i64 0
%84 = load float, float* %83
%85 = fpext float %84 to double
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %85)
%87 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %2, i64 0, i64 3, i64 1
%88 = load float, float* %87
%89 = fpext float %88 to double
%90 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %89)
%91 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %2, i64 0, i64 3, i64 2
%92 = load float, float* %91
%93 = fpext float %92 to double
%94 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %93)
%95 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %2, i64 0, i64 3, i64 3
%96 = load float, float* %95
%97 = fpext float %96 to double
%98 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %97)
%99 = call i32 @putchar(i32 10)
ret i32 0
}