#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 *, char, char, char, char);
int /*<<< orphan*/ scanf(char *, char *, char *, char *, char *);
int main(void) {
  int i, n = 4;
  char a[n][n];
  for (i = 0; i < 4; i++)
    scanf("%c %c %c %c ", &a[i][0], &a[i][1], &a[i][2], &a[i][3]);
  for (i = 3; i >= 0; i--)
    printf("%c %c %c %c\n", a[i][3], a[i][2], a[i][1], a[i][0]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
mov    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    %rsp,%rdx
mov    %rdx,-0x18(%rbp)
mov    %rcx,%rsi
imul   %rsi,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x30(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x20(%rbp)
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    11e1 <main+0xc1>
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%rdi
movslq -0x8(%rbp),%rax
imul   %rdi,%rax
mov    %r8,%rsi
add    %rax,%rsi
movslq -0x8(%rbp),%rax
imul   %rdi,%rax
mov    %r8,%rdx
add    %rax,%rdx
add    $0x1,%rdx
movslq -0x8(%rbp),%rax
imul   %rdi,%rax
mov    %r8,%rcx
add    %rax,%rcx
add    $0x2,%rcx
movslq -0x8(%rbp),%rax
imul   %rdi,%rax
add    %rax,%r8
add    $0x3,%r8
lea    0xe32(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1174 <main+0x54>
movl   $0x3,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1250 <main+0x130>
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%rdi
movslq -0x8(%rbp),%rcx
imul   %rdi,%rcx
mov    0x3(%rax,%rcx,1),%sil
movslq -0x8(%rbp),%rcx
imul   %rdi,%rcx
mov    0x2(%rax,%rcx,1),%dl
movslq -0x8(%rbp),%rcx
imul   %rdi,%rcx
mov    0x1(%rax,%rcx,1),%cl
movslq -0x8(%rbp),%r8
imul   %rdi,%r8
lea    0xddf(%rip),%rdi
movsbl %sil,%esi
movsbl %dl,%edx
movsbl %cl,%ecx
movsbl (%rax,%r8,1),%r8d
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    11e8 <main+0xc8>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x1(%rsp),%rdx
lea    0x2(%rsp),%rcx
lea    0x3(%rsp),%r8
lea    0xec5(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x4(%rsp),%rsi
lea    0x5(%rsp),%rdx
lea    0x6(%rsp),%rcx
lea    0x7(%rsp),%r8
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
lea    0x9(%rsp),%rdx
lea    0xa(%rsp),%rcx
lea    0xb(%rsp),%r8
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xc(%rsp),%rsi
lea    0xd(%rsp),%rdx
lea    0xe(%rsp),%rcx
lea    0xf(%rsp),%r8
mov    %rbx,%rdi
call   1040 <scanf@plt>
movsbl 0xf(%rsp),%esi
movsbl 0xe(%rsp),%edx
movsbl 0xd(%rsp),%ecx
movsbl 0xc(%rsp),%r8d
lea    0xe57(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xb(%rsp),%esi
movsbl 0xa(%rsp),%edx
movsbl 0x9(%rsp),%ecx
movsbl 0x8(%rsp),%r8d
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0x7(%rsp),%esi
movsbl 0x6(%rsp),%edx
movsbl 0x5(%rsp),%ecx
movsbl 0x4(%rsp),%r8d
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0x3(%rsp),%esi
movsbl 0x2(%rsp),%edx
movsbl 0x1(%rsp),%ecx
movsbl (%rsp),%r8d
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"%c %c %c %c \00"
@.str.1 = [13 x i8] c"%c %c %c %c\0A\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 1
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 2
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 3
%6 = call i32 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3, i8* %4, i8* %5)
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 4
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 5
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 6
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 7
%11 = call i32 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i8* %9, i8* %10)
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 8
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 9
%14 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 10
%15 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 11
%16 = call i32 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13, i8* %14, i8* %15)
%17 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 12
%18 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 13
%19 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 14
%20 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 15
%21 = call i32 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %17, i8* %18, i8* %19, i8* %20)
%22 = load i8, i8* %20
%23 = load i8, i8* %19
%24 = load i8, i8* %18
%25 = load i8, i8* %17
%26 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8 signext %22, i8 signext %23, i8 signext %24, i8 signext %25)
%27 = load i8, i8* %15
%28 = load i8, i8* %14
%29 = load i8, i8* %13
%30 = load i8, i8* %12
%31 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8 signext %27, i8 signext %28, i8 signext %29, i8 signext %30)
%32 = load i8, i8* %10
%33 = load i8, i8* %9
%34 = load i8, i8* %8
%35 = load i8, i8* %7
%36 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8 signext %32, i8 signext %33, i8 signext %34, i8 signext %35)
%37 = load i8, i8* %5
%38 = load i8, i8* %4
%39 = load i8, i8* %3
%40 = load i8, i8* %2
%41 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8 signext %37, i8 signext %38, i8 signext %39, i8 signext %40)
ret i32 0
}