#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 */
void *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int scanf(char *, ...);
int main() {
  int **Matrix = malloc(5 * sizeof(int *));
  int **result = malloc(5 * sizeof(int *));
  for (int x = 0; x < 5; x++) {
    Matrix[x] = malloc(5 * sizeof(int));
    result[x] = malloc(5 * sizeof(int));
  }
  for (int x = 0; x < 5; x++) {
    for (int y = 0; y < 5; y++) {
      scanf("%d", &Matrix[x][y]);
    }
  }
  char L;
  while (scanf("%c", &L) == 1) {
    if (L == 'L') {
      int i = 0;
      for (int x = 5 - 1; x >= 0; x--) {
        int j = 0;
        for (int y = 0; y < 5; y++) {
          result[i][j] = Matrix[y][x];
          ++j;
        }
        ++i;
      }
      int **temp = result;
      result = Matrix;
      Matrix = temp;
    }
  }
  for (int x = 0; x < 5; x++) {
    for (int y = 0, space = 0; y < 5; y++) {
      if (space)
        printf(" ");
      else
        space = 1;
      printf("%d", Matrix[x][y]);
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x5,-0x1c(%rbp)
jge    11ac <main+0x7c>
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1162 <main+0x32>
movl   $0x0,-0x20(%rbp)
cmpl   $0x5,-0x20(%rbp)
jge    1214 <main+0xe4>
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    1201 <main+0xd1>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
movslq -0x24(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11c4 <main+0x94>
jmp    1206 <main+0xd6>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11b3 <main+0x83>
jmp    1219 <main+0xe9>
lea    0xde3(%rip),%rdi
lea    -0x25(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    12e2 <main+0x1b2>
movsbl -0x25(%rbp),%eax
cmp    $0x4c,%eax
jne    12dd <main+0x1ad>
movl   $0x0,-0x2c(%rbp)
movl   $0x4,-0x30(%rbp)
cmpl   $0x0,-0x30(%rbp)
jl     12c5 <main+0x195>
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
cmpl   $0x5,-0x38(%rbp)
jge    12ae <main+0x17e>
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x34(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1267 <main+0x137>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x30(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x30(%rbp)
jmp    124f <main+0x11f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1219 <main+0xe9>
movl   $0x0,-0x44(%rbp)
cmpl   $0x5,-0x44(%rbp)
jge    137a <main+0x24a>
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
cmpl   $0x5,-0x48(%rbp)
jge    135e <main+0x22e>
cmpl   $0x0,-0x4c(%rbp)
je     1328 <main+0x1f8>
lea    0xcea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    132f <main+0x1ff>
movl   $0x1,-0x4c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x48(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xcb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1301 <main+0x1d1>
lea    0xca3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    12e9 <main+0x1b9>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x28,%edi
call   1050 <malloc@plt>
mov    %rax,%rbp
mov    $0x28,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    $0x14,%edi
call   1050 <malloc@plt>
mov    %rax,%r12
mov    %rax,0x0(%rbp)
mov    $0x14,%edi
call   1050 <malloc@plt>
mov    %rax,(%r14)
mov    $0x14,%edi
call   1050 <malloc@plt>
mov    %rax,0x8(%rbp)
mov    $0x14,%edi
call   1050 <malloc@plt>
mov    %rax,0x8(%r14)
mov    $0x14,%edi
call   1050 <malloc@plt>
mov    %rax,0x10(%rbp)
mov    $0x14,%edi
call   1050 <malloc@plt>
mov    %rax,0x10(%r14)
mov    $0x14,%edi
call   1050 <malloc@plt>
mov    %rax,0x18(%rbp)
mov    $0x14,%edi
call   1050 <malloc@plt>
mov    %rax,0x18(%r14)
mov    $0x14,%edi
call   1050 <malloc@plt>
mov    %rax,0x20(%rbp)
mov    $0x14,%edi
call   1050 <malloc@plt>
mov    %rax,0x20(%r14)
lea    0xe06(%rip),%r15
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x4(%r12),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x8(%r12),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xc(%r12),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
add    $0x10,%r12
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0x8(%rbp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x4(%rbx),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x8(%rbx),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xc(%rbx),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
add    $0x10,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0x10(%rbp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x4(%rbx),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x8(%rbx),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xc(%rbx),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
add    $0x10,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0x18(%rbp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x4(%rbx),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x8(%rbx),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xc(%rbx),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
add    $0x10,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0x20(%rbp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x4(%rbx),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x8(%rbx),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xc(%rbx),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
add    $0x10,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xc87(%rip),%rdi
lea    0x7(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
cmp    $0x1,%eax
jne    1492 <main+0x352>
lea    0xc6b(%rip),%r15
lea    0x7(%rsp),%r12
mov    %rbp,%r13
jmp    1482 <main+0x342>
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14),%rbx
mov    0x0(%r13),%rax
mov    0x10(%rax),%ecx
mov    %ecx,(%rbx)
mov    0x8(%r13),%rcx
mov    0x10(%rcx),%edx
mov    %edx,0x4(%rbx)
mov    0x10(%r13),%rdx
mov    0x10(%rdx),%esi
mov    %esi,0x8(%rbx)
mov    0x18(%r13),%rsi
mov    0x10(%rsi),%edi
mov    %edi,0xc(%rbx)
mov    0x20(%r13),%rdi
mov    0x10(%rdi),%ebp
mov    %ebp,0x10(%rbx)
mov    0x8(%r14),%rbp
mov    0xc(%rax),%ebx
mov    %ebx,0x0(%rbp)
mov    0xc(%rcx),%ebx
mov    %ebx,0x4(%rbp)
mov    0xc(%rdx),%ebx
mov    %ebx,0x8(%rbp)
mov    0xc(%rsi),%ebx
mov    %ebx,0xc(%rbp)
mov    0xc(%rdi),%ebx
mov    %ebx,0x10(%rbp)
mov    0x10(%r14),%rbp
mov    0x8(%rax),%ebx
mov    %ebx,0x0(%rbp)
mov    0x8(%rcx),%ebx
mov    %ebx,0x4(%rbp)
mov    0x8(%rdx),%ebx
mov    %ebx,0x8(%rbp)
mov    0x8(%rsi),%ebx
mov    %ebx,0xc(%rbp)
mov    0x8(%rdi),%ebx
mov    %ebx,0x10(%rbp)
mov    0x18(%r14),%rbp
mov    0x4(%rax),%ebx
mov    %ebx,0x0(%rbp)
mov    0x4(%rcx),%ebx
mov    %ebx,0x4(%rbp)
mov    0x4(%rdx),%ebx
mov    %ebx,0x8(%rbp)
mov    0x4(%rsi),%ebx
mov    %ebx,0xc(%rbp)
mov    0x4(%rdi),%ebx
mov    %ebx,0x10(%rbp)
mov    0x20(%r14),%rbp
mov    (%rax),%eax
mov    %eax,0x0(%rbp)
mov    (%rcx),%eax
mov    %eax,0x4(%rbp)
mov    (%rdx),%eax
mov    %eax,0x8(%rbp)
mov    (%rsi),%eax
mov    %eax,0xc(%rbp)
mov    (%rdi),%eax
mov    %eax,0x10(%rbp)
mov    %r14,%rbp
mov    %r13,%r14
mov    %rbp,%r13
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
cmp    $0x1,%eax
jne    1492 <main+0x352>
cmpb   $0x4c,0x7(%rsp)
je     13b0 <main+0x270>
mov    %r13,%rbp
jmp    1470 <main+0x330>
lea    0xb67(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    0x0(%rbp,%rbx,8),%rax
mov    (%rax),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x0(%rbp,%rbx,8),%rax
mov    0x4(%rax),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x0(%rbp,%rbx,8),%rax
mov    0x8(%rax),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x0(%rbp,%rbx,8),%rax
mov    0xc(%rax),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x0(%rbp,%rbx,8),%rax
mov    0x10(%rax),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0x5,%rbx
jne    14a0 <main+0x360>
xor    %eax,%eax
add    $0x8,%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 = [3 x i8] c"%c\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32**
%3 = alloca i32**
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32**
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 0, i32* %1
%16 = call i8* @malloc(i32 40)
%17 = bitcast i8* %16 to i32**
store i32** %17, i32*** %2
%18 = call i8* @malloc(i32 40)
%19 = bitcast i8* %18 to i32**
store i32** %19, i32*** %3
store i32 0, i32* %4
br label %20
20: ; preds = %36, %0
%21 = load i32, i32* %4
%22 = icmp slt i32 %21, 5
br i1 %22, label %23, label %39
23: ; preds = %20
%24 = call i8* @malloc(i32 20)
%25 = bitcast i8* %24 to i32*
%26 = load i32**, i32*** %2
%27 = load i32, i32* %4
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32*, i32** %26, i64 %28
store i32* %25, i32** %29
%30 = call i8* @malloc(i32 20)
%31 = bitcast i8* %30 to i32*
%32 = load i32**, i32*** %3
%33 = load i32, i32* %4
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i32*, i32** %32, i64 %34
store i32* %31, i32** %35
br label %36
36: ; preds = %23
%37 = load i32, i32* %4
%38 = add nsw i32 %37, 1
store i32 %38, i32* %4
br label %20
39: ; preds = %20
store i32 0, i32* %5
br label %40
40: ; preds = %61, %39
%41 = load i32, i32* %5
%42 = icmp slt i32 %41, 5
br i1 %42, label %43, label %64
43: ; preds = %40
store i32 0, i32* %6
br label %44
44: ; preds = %57, %43
%45 = load i32, i32* %6
%46 = icmp slt i32 %45, 5
br i1 %46, label %47, label %60
47: ; preds = %44
%48 = load i32**, i32*** %2
%49 = load i32, i32* %5
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i32*, i32** %48, i64 %50
%52 = load i32*, i32** %51
%53 = load i32, i32* %6
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i32, i32* %52, i64 %54
%56 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %55)
br label %57
57: ; preds = %47
%58 = load i32, i32* %6
%59 = add nsw i32 %58, 1
store i32 %59, i32* %6
br label %44
60: ; preds = %44
br label %61
61: ; preds = %60
%62 = load i32, i32* %5
%63 = add nsw i32 %62, 1
store i32 %63, i32* %5
br label %40
64: ; preds = %40
br label %65
65: ; preds = %113, %64
%66 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%67 = icmp eq i32 %66, 1
br i1 %67, label %68, label %114
68: ; preds = %65
%69 = load i8, i8* %7
%70 = sext i8 %69 to i32
%71 = icmp eq i32 %70, 76
br i1 %71, label %72, label %113
72: ; preds = %68
store i32 0, i32* %8
store i32 4, i32* %9
br label %73
73: ; preds = %106, %72
%74 = load i32, i32* %9
%75 = icmp sge i32 %74, 0
br i1 %75, label %76, label %109
76: ; preds = %73
store i32 0, i32* %10
store i32 0, i32* %11
br label %77
77: ; preds = %100, %76
%78 = load i32, i32* %11
%79 = icmp slt i32 %78, 5
br i1 %79, label %80, label %103
80: ; preds = %77
%81 = load i32**, i32*** %2
%82 = load i32, i32* %11
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds i32*, i32** %81, i64 %83
%85 = load i32*, i32** %84
%86 = load i32, i32* %9
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i32, i32* %85, i64 %87
%89 = load i32, i32* %88
%90 = load i32**, i32*** %3
%91 = load i32, i32* %8
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds i32*, i32** %90, i64 %92
%94 = load i32*, i32** %93
%95 = load i32, i32* %10
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds i32, i32* %94, i64 %96
store i32 %89, i32* %97
%98 = load i32, i32* %10
%99 = add nsw i32 %98, 1
store i32 %99, i32* %10
br label %100
100: ; preds = %80
%101 = load i32, i32* %11
%102 = add nsw i32 %101, 1
store i32 %102, i32* %11
br label %77
103: ; preds = %77
%104 = load i32, i32* %8
%105 = add nsw i32 %104, 1
store i32 %105, i32* %8
br label %106
106: ; preds = %103
%107 = load i32, i32* %9
%108 = add nsw i32 %107, -1
store i32 %108, i32* %9
br label %73
109: ; preds = %73
%110 = load i32**, i32*** %3
store i32** %110, i32*** %12
%111 = load i32**, i32*** %2
store i32** %111, i32*** %3
%112 = load i32**, i32*** %12
store i32** %112, i32*** %2
br label %113
113: ; preds = %109, %68
br label %65
114: ; preds = %65
store i32 0, i32* %13
br label %115
115: ; preds = %144, %114
%116 = load i32, i32* %13
%117 = icmp slt i32 %116, 5
br i1 %117, label %118, label %147
118: ; preds = %115
store i32 0, i32* %14
store i32 0, i32* %15
br label %119
119: ; preds = %139, %118
%120 = load i32, i32* %14
%121 = icmp slt i32 %120, 5
br i1 %121, label %122, label %142
122: ; preds = %119
%123 = load i32, i32* %15
%124 = icmp ne i32 %123, 0
br i1 %124, label %125, label %127
125: ; preds = %122
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %128
127: ; preds = %122
store i32 1, i32* %15
br label %128
128: ; preds = %127, %125
%129 = load i32**, i32*** %2
%130 = load i32, i32* %13
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds i32*, i32** %129, i64 %131
%133 = load i32*, i32** %132
%134 = load i32, i32* %14
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds i32, i32* %133, i64 %135
%137 = load i32, i32* %136
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %137)
br label %139
139: ; preds = %128
%140 = load i32, i32* %14
%141 = add nsw i32 %140, 1
store i32 %141, i32* %14
br label %119
142: ; preds = %119
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %144
144: ; preds = %142
%145 = load i32, i32* %13
%146 = add nsw i32 %145, 1
store i32 %146, i32* %13
br label %115
147: ; preds = %115
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call dereferenceable_or_null(40) i8* @malloc(i32 40)
%3 = bitcast i8* %2 to i32**
%4 = tail call dereferenceable_or_null(40) i8* @malloc(i32 40)
%5 = bitcast i8* %4 to i32**
%6 = tail call dereferenceable_or_null(20) i8* @malloc(i32 20)
%7 = bitcast i8* %2 to i8**
store i8* %6, i8** %7
%8 = tail call dereferenceable_or_null(20) i8* @malloc(i32 20)
%9 = bitcast i8* %4 to i8**
store i8* %8, i8** %9
%10 = tail call dereferenceable_or_null(20) i8* @malloc(i32 20)
%11 = getelementptr inbounds i32*, i32** %3, i64 1
%12 = bitcast i32** %11 to i8**
store i8* %10, i8** %12
%13 = tail call dereferenceable_or_null(20) i8* @malloc(i32 20)
%14 = getelementptr inbounds i32*, i32** %5, i64 1
%15 = bitcast i32** %14 to i8**
store i8* %13, i8** %15
%16 = tail call dereferenceable_or_null(20) i8* @malloc(i32 20)
%17 = getelementptr inbounds i32*, i32** %3, i64 2
%18 = bitcast i32** %17 to i8**
store i8* %16, i8** %18
%19 = tail call dereferenceable_or_null(20) i8* @malloc(i32 20)
%20 = getelementptr inbounds i32*, i32** %5, i64 2
%21 = bitcast i32** %20 to i8**
store i8* %19, i8** %21
%22 = tail call dereferenceable_or_null(20) i8* @malloc(i32 20)
%23 = getelementptr inbounds i32*, i32** %3, i64 3
%24 = bitcast i32** %23 to i8**
store i8* %22, i8** %24
%25 = tail call dereferenceable_or_null(20) i8* @malloc(i32 20)
%26 = getelementptr inbounds i32*, i32** %5, i64 3
%27 = bitcast i32** %26 to i8**
store i8* %25, i8** %27
%28 = tail call dereferenceable_or_null(20) i8* @malloc(i32 20)
%29 = getelementptr inbounds i32*, i32** %3, i64 4
%30 = bitcast i32** %29 to i8**
store i8* %28, i8** %30
%31 = tail call dereferenceable_or_null(20) i8* @malloc(i32 20)
%32 = getelementptr inbounds i32*, i32** %5, i64 4
%33 = bitcast i32** %32 to i8**
store i8* %31, i8** %33
%34 = bitcast i8* %6 to i32*
%35 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%36 = getelementptr inbounds i32, i32* %34, i64 1
%37 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %36)
%38 = getelementptr inbounds i32, i32* %34, i64 2
%39 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %38)
%40 = getelementptr inbounds i32, i32* %34, i64 3
%41 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %40)
%42 = getelementptr inbounds i32, i32* %34, i64 4
%43 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %42)
%44 = load i32*, i32** %11
%45 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %44)
%46 = getelementptr inbounds i32, i32* %44, i64 1
%47 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %46)
%48 = getelementptr inbounds i32, i32* %44, i64 2
%49 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %48)
%50 = getelementptr inbounds i32, i32* %44, i64 3
%51 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %50)
%52 = getelementptr inbounds i32, i32* %44, i64 4
%53 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %52)
%54 = load i32*, i32** %17
%55 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %54)
%56 = getelementptr inbounds i32, i32* %54, i64 1
%57 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %56)
%58 = getelementptr inbounds i32, i32* %54, i64 2
%59 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %58)
%60 = getelementptr inbounds i32, i32* %54, i64 3
%61 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %60)
%62 = getelementptr inbounds i32, i32* %54, i64 4
%63 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %62)
%64 = load i32*, i32** %23
%65 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %64)
%66 = getelementptr inbounds i32, i32* %64, i64 1
%67 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %66)
%68 = getelementptr inbounds i32, i32* %64, i64 2
%69 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %68)
%70 = getelementptr inbounds i32, i32* %64, i64 3
%71 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %70)
%72 = getelementptr inbounds i32, i32* %64, i64 4
%73 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %72)
%74 = load i32*, i32** %29
%75 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %74)
%76 = getelementptr inbounds i32, i32* %74, i64 1
%77 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %76)
%78 = getelementptr inbounds i32, i32* %74, i64 2
%79 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %78)
%80 = getelementptr inbounds i32, i32* %74, i64 3
%81 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %80)
%82 = getelementptr inbounds i32, i32* %74, i64 4
%83 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %82)
%84 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%85 = icmp eq i32 %84, 1
br i1 %85, label %88, label %86
86: ; preds = %177, %0
%87 = phi i32** [ %3, %0 ], [ %178, %177 ]
br label %183
88: ; preds = %0, %177
%89 = phi i32** [ %179, %177 ], [ %5, %0 ]
%90 = phi i32** [ %178, %177 ], [ %3, %0 ]
%91 = load i8, i8* %1
%92 = icmp eq i8 %91, 76
br i1 %92, label %93, label %177
93: ; preds = %88
%94 = load i32*, i32** %89
%95 = load i32*, i32** %90
%96 = getelementptr inbounds i32, i32* %95, i64 4
%97 = load i32, i32* %96
store i32 %97, i32* %94
%98 = getelementptr inbounds i32*, i32** %90, i64 1
%99 = load i32*, i32** %98
%100 = getelementptr inbounds i32, i32* %99, i64 4
%101 = load i32, i32* %100
%102 = getelementptr inbounds i32, i32* %94, i64 1
store i32 %101, i32* %102
%103 = getelementptr inbounds i32*, i32** %90, i64 2
%104 = load i32*, i32** %103
%105 = getelementptr inbounds i32, i32* %104, i64 4
%106 = load i32, i32* %105
%107 = getelementptr inbounds i32, i32* %94, i64 2
store i32 %106, i32* %107
%108 = getelementptr inbounds i32*, i32** %90, i64 3
%109 = load i32*, i32** %108
%110 = getelementptr inbounds i32, i32* %109, i64 4
%111 = load i32, i32* %110
%112 = getelementptr inbounds i32, i32* %94, i64 3
store i32 %111, i32* %112
%113 = getelementptr inbounds i32*, i32** %90, i64 4
%114 = load i32*, i32** %113
%115 = getelementptr inbounds i32, i32* %114, i64 4
%116 = load i32, i32* %115
%117 = getelementptr inbounds i32, i32* %94, i64 4
store i32 %116, i32* %117
%118 = getelementptr inbounds i32*, i32** %89, i64 1
%119 = load i32*, i32** %118
%120 = getelementptr inbounds i32, i32* %95, i64 3
%121 = load i32, i32* %120
store i32 %121, i32* %119
%122 = getelementptr inbounds i32, i32* %99, i64 3
%123 = load i32, i32* %122
%124 = getelementptr inbounds i32, i32* %119, i64 1
store i32 %123, i32* %124
%125 = getelementptr inbounds i32, i32* %104, i64 3
%126 = load i32, i32* %125
%127 = getelementptr inbounds i32, i32* %119, i64 2
store i32 %126, i32* %127
%128 = getelementptr inbounds i32, i32* %109, i64 3
%129 = load i32, i32* %128
%130 = getelementptr inbounds i32, i32* %119, i64 3
store i32 %129, i32* %130
%131 = getelementptr inbounds i32, i32* %114, i64 3
%132 = load i32, i32* %131
%133 = getelementptr inbounds i32, i32* %119, i64 4
store i32 %132, i32* %133
%134 = getelementptr inbounds i32*, i32** %89, i64 2
%135 = load i32*, i32** %134
%136 = getelementptr inbounds i32, i32* %95, i64 2
%137 = load i32, i32* %136
store i32 %137, i32* %135
%138 = getelementptr inbounds i32, i32* %99, i64 2
%139 = load i32, i32* %138
%140 = getelementptr inbounds i32, i32* %135, i64 1
store i32 %139, i32* %140
%141 = getelementptr inbounds i32, i32* %104, i64 2
%142 = load i32, i32* %141
%143 = getelementptr inbounds i32, i32* %135, i64 2
store i32 %142, i32* %143
%144 = getelementptr inbounds i32, i32* %109, i64 2
%145 = load i32, i32* %144
%146 = getelementptr inbounds i32, i32* %135, i64 3
store i32 %145, i32* %146
%147 = getelementptr inbounds i32, i32* %114, i64 2
%148 = load i32, i32* %147
%149 = getelementptr inbounds i32, i32* %135, i64 4
store i32 %148, i32* %149
%150 = getelementptr inbounds i32*, i32** %89, i64 3
%151 = load i32*, i32** %150
%152 = getelementptr inbounds i32, i32* %95, i64 1
%153 = load i32, i32* %152
store i32 %153, i32* %151
%154 = getelementptr inbounds i32, i32* %99, i64 1
%155 = load i32, i32* %154
%156 = getelementptr inbounds i32, i32* %151, i64 1
store i32 %155, i32* %156
%157 = getelementptr inbounds i32, i32* %104, i64 1
%158 = load i32, i32* %157
%159 = getelementptr inbounds i32, i32* %151, i64 2
store i32 %158, i32* %159
%160 = getelementptr inbounds i32, i32* %109, i64 1
%161 = load i32, i32* %160
%162 = getelementptr inbounds i32, i32* %151, i64 3
store i32 %161, i32* %162
%163 = getelementptr inbounds i32, i32* %114, i64 1
%164 = load i32, i32* %163
%165 = getelementptr inbounds i32, i32* %151, i64 4
store i32 %164, i32* %165
%166 = getelementptr inbounds i32*, i32** %89, i64 4
%167 = load i32*, i32** %166
%168 = load i32, i32* %95
store i32 %168, i32* %167
%169 = load i32, i32* %99
%170 = getelementptr inbounds i32, i32* %167, i64 1
store i32 %169, i32* %170
%171 = load i32, i32* %104
%172 = getelementptr inbounds i32, i32* %167, i64 2
store i32 %171, i32* %172
%173 = load i32, i32* %109
%174 = getelementptr inbounds i32, i32* %167, i64 3
store i32 %173, i32* %174
%175 = load i32, i32* %114
%176 = getelementptr inbounds i32, i32* %167, i64 4
store i32 %175, i32* %176
br label %177
177: ; preds = %93, %88
%178 = phi i32** [ %90, %88 ], [ %89, %93 ]
%179 = phi i32** [ %89, %88 ], [ %90, %93 ]
%180 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%181 = icmp eq i32 %180, 1
br i1 %181, label %88, label %86
182: ; preds = %183
ret i32 0
183: ; preds = %86, %183
%184 = phi i64 [ 0, %86 ], [ %210, %183 ]
%185 = getelementptr inbounds i32*, i32** %87, i64 %184
%186 = load i32*, i32** %185
%187 = load i32, i32* %186
%188 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %187)
%189 = call i32 @putchar(i32 32)
%190 = load i32*, i32** %185
%191 = getelementptr inbounds i32, i32* %190, i64 1
%192 = load i32, i32* %191
%193 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %192)
%194 = call i32 @putchar(i32 32)
%195 = load i32*, i32** %185
%196 = getelementptr inbounds i32, i32* %195, i64 2
%197 = load i32, i32* %196
%198 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %197)
%199 = call i32 @putchar(i32 32)
%200 = load i32*, i32** %185
%201 = getelementptr inbounds i32, i32* %200, i64 3
%202 = load i32, i32* %201
%203 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %202)
%204 = call i32 @putchar(i32 32)
%205 = load i32*, i32** %185
%206 = getelementptr inbounds i32, i32* %205, i64 4
%207 = load i32, i32* %206
%208 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %207)
%209 = call i32 @putchar(i32 10)
%210 = add nuw nsw i64 %184, 1
%211 = icmp eq i64 %210, 5
br i1 %211, label %182, label %183
}