#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 *, ...);
void printMatrix(char matrix[4][4][4]) {
  int count;
  int current_matrix;
  int line;
  for (line = 0; line < 4; line++) {
    for (current_matrix = 0; current_matrix < 4; current_matrix++) {
      for (count = 0; count < 4; count++) {
        printf("%c", matrix[current_matrix][line][count]);
        printf(((current_matrix < 3) || (count < 3)) ? " " : "");
      }
      printf((current_matrix < 3) ? " " : "");
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<printMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    120e <printMatrix+0xfe>
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    11f2 <printMatrix+0xe2>
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    11c5 <printMatrix+0xb5>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%al
cmpl   $0x3,-0x10(%rbp)
mov    %al,-0x15(%rbp)
jl     1198 <printMatrix+0x88>
cmpl   $0x3,-0xc(%rbp)
setl   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%cl
lea    0xe64(%rip),%rdi
lea    0xe5a(%rip),%rax
test   $0x1,%cl
cmovne %rax,%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <printMatrix+0x35>
mov    -0x10(%rbp),%ecx
lea    0xe37(%rip),%rdi
lea    0xe2d(%rip),%rax
cmp    $0x3,%ecx
cmovl  %rax,%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <printMatrix+0x24>
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <printMatrix+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMatrix>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0xfffffffffffffffc,%rbx
xchg   %ax,%ax
movsbl 0x10(%r14,%rbx,4),%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl 0x11(%r14,%rbx,4),%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl 0x12(%r14,%rbx,4),%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl 0x13(%r14,%rbx,4),%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl 0x20(%r14,%rbx,4),%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl 0x21(%r14,%rbx,4),%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl 0x22(%r14,%rbx,4),%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl 0x23(%r14,%rbx,4),%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl 0x30(%r14,%rbx,4),%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl 0x31(%r14,%rbx,4),%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl 0x32(%r14,%rbx,4),%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl 0x33(%r14,%rbx,4),%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl 0x40(%r14,%rbx,4),%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl 0x41(%r14,%rbx,4),%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl 0x42(%r14,%rbx,4),%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl 0x43(%r14,%rbx,4),%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
inc    %rbx
jne    1120 <printMatrix+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [2 x i8] c"\0A\00"
define void @printMatrix([4 x [4 x i8]]* %0) {
%2 = alloca [4 x [4 x i8]]*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store [4 x [4 x i8]]* %0, [4 x [4 x i8]]** %2
store i32 0, i32* %5
br label %6
6: ; preds = %55, %1
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 4
br i1 %8, label %9, label %58
9: ; preds = %6
store i32 0, i32* %4
br label %10
10: ; preds = %50, %9
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 4
br i1 %12, label %13, label %53
13: ; preds = %10
store i32 0, i32* %3
br label %14
14: ; preds = %41, %13
%15 = load i32, i32* %3
%16 = icmp slt i32 %15, 4
br i1 %16, label %17, label %44
17: ; preds = %14
%18 = load [4 x [4 x i8]]*, [4 x [4 x i8]]** %2
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %18, i64 %20
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %21, i64 0, i64 %23
%25 = load i32, i32* %3
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [4 x i8], [4 x i8]* %24, i64 0, i64 %26
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %4
%32 = icmp slt i32 %31, 3
br i1 %32, label %36, label %33
33: ; preds = %17
%34 = load i32, i32* %3
%35 = icmp slt i32 %34, 3
br label %36
36: ; preds = %33, %17
%37 = phi i1 [ true, %17 ], [ %35, %33 ]
%38 = zext i1 %37 to i64
%39 = select i1 %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%40 = call i32 (i8*, ...) @printf(i8* %39)
br label %41
41: ; preds = %36
%42 = load i32, i32* %3
%43 = add nsw i32 %42, 1
store i32 %43, i32* %3
br label %14
44: ; preds = %14
%45 = load i32, i32* %4
%46 = icmp slt i32 %45, 3
%47 = zext i1 %46 to i64
%48 = select i1 %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%49 = call i32 (i8*, ...) @printf(i8* %48)
br label %50
50: ; preds = %44
%51 = load i32, i32* %4
%52 = add nsw i32 %51, 1
store i32 %52, i32* %4
br label %10
53: ; preds = %10
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %55
55: ; preds = %53
%56 = load i32, i32* %5
%57 = add nsw i32 %56, 1
store i32 %57, i32* %5
br label %6
58: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @printMatrix([4 x [4 x i8]]* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %87, %2 ]
%4 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %0, i64 0, i64 %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = tail call i32 @putchar(i32 %6)
%8 = tail call i32 @putchar(i32 32)
%9 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %0, i64 0, i64 %3, i64 1
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = tail call i32 @putchar(i32 %11)
%13 = tail call i32 @putchar(i32 32)
%14 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %0, i64 0, i64 %3, i64 2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = tail call i32 @putchar(i32 %16)
%18 = tail call i32 @putchar(i32 32)
%19 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %0, i64 0, i64 %3, i64 3
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = tail call i32 @putchar(i32 %21)
%23 = tail call i32 @putchar(i32 32)
%24 = tail call i32 @putchar(i32 32)
%25 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %0, i64 1, i64 %3, i64 0
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = tail call i32 @putchar(i32 %27)
%29 = tail call i32 @putchar(i32 32)
%30 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %0, i64 1, i64 %3, i64 1
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = tail call i32 @putchar(i32 %32)
%34 = tail call i32 @putchar(i32 32)
%35 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %0, i64 1, i64 %3, i64 2
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = tail call i32 @putchar(i32 %37)
%39 = tail call i32 @putchar(i32 32)
%40 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %0, i64 1, i64 %3, i64 3
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = tail call i32 @putchar(i32 %42)
%44 = tail call i32 @putchar(i32 32)
%45 = tail call i32 @putchar(i32 32)
%46 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %0, i64 2, i64 %3, i64 0
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = tail call i32 @putchar(i32 %48)
%50 = tail call i32 @putchar(i32 32)
%51 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %0, i64 2, i64 %3, i64 1
%52 = load i8, i8* %51
%53 = sext i8 %52 to i32
%54 = tail call i32 @putchar(i32 %53)
%55 = tail call i32 @putchar(i32 32)
%56 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %0, i64 2, i64 %3, i64 2
%57 = load i8, i8* %56
%58 = sext i8 %57 to i32
%59 = tail call i32 @putchar(i32 %58)
%60 = tail call i32 @putchar(i32 32)
%61 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %0, i64 2, i64 %3, i64 3
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = tail call i32 @putchar(i32 %63)
%65 = tail call i32 @putchar(i32 32)
%66 = tail call i32 @putchar(i32 32)
%67 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %0, i64 3, i64 %3, i64 0
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = tail call i32 @putchar(i32 %69)
%71 = tail call i32 @putchar(i32 32)
%72 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %0, i64 3, i64 %3, i64 1
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = tail call i32 @putchar(i32 %74)
%76 = tail call i32 @putchar(i32 32)
%77 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %0, i64 3, i64 %3, i64 2
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = tail call i32 @putchar(i32 %79)
%81 = tail call i32 @putchar(i32 32)
%82 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %0, i64 3, i64 %3, i64 3
%83 = load i8, i8* %82
%84 = sext i8 %83 to i32
%85 = tail call i32 @putchar(i32 %84)
%86 = tail call i32 @putchar(i32 10)
%87 = add nuw nsw i64 %3, 1
%88 = icmp eq i64 %87, 4
br i1 %88, label %89, label %2
89: ; preds = %2
ret void
}