#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[8][8]) {
  printf("[ ");
  for (int row = 0; row < 8; row++) {
    for (int col = 0; col < 8; col++) {
      printf("%c", matrix[row][col]);
      if ((row < 8 - 1) || (col < 8 - 1)) {
        printf(",");
      }
    }
    if (row < 8 - 1) {
      printf("\n  ");
    }
  }
  printf(" ]\n");
}


x86 assembly (clang, -O0):
<printMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    11d1 <printMatrix+0xc1>
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    11a6 <printMatrix+0x96>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x7,-0xc(%rbp)
jl     1185 <printMatrix+0x75>
cmpl   $0x7,-0x10(%rbp)
jge    1193 <printMatrix+0x83>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1198 <printMatrix+0x88>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1142 <printMatrix+0x32>
cmpl   $0x7,-0xc(%rbp)
jge    11be <printMatrix+0xae>
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c3 <printMatrix+0xb3>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <printMatrix+0x21>
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMatrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb6(%rip),%r14
xor    %ebx,%ebx
jmp    116e <printMatrix+0x3e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    $0x8,%rbx
je     122e <printMatrix+0xfe>
movsbl (%r15,%rbx,8),%edi
call   1030 <putchar@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
movsbl 0x1(%r15,%rbx,8),%edi
call   1030 <putchar@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
movsbl 0x2(%r15,%rbx,8),%edi
call   1030 <putchar@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
movsbl 0x3(%r15,%rbx,8),%edi
call   1030 <putchar@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
movsbl 0x4(%r15,%rbx,8),%edi
call   1030 <putchar@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
movsbl 0x5(%r15,%rbx,8),%edi
call   1030 <putchar@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
movsbl 0x6(%r15,%rbx,8),%edi
call   1030 <putchar@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
movsbl 0x7(%r15,%rbx,8),%edi
call   1030 <putchar@plt>
cmp    $0x6,%rbx
ja     1160 <printMatrix+0x30>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1160 <printMatrix+0x30>
lea    0xdd2(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <puts@plt>

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

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