#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(int *matrix) {
  static char RoutineName[] = "PrintMatrix";
  int i, j;
  if (matrix) {
    for (i = 0; i < 8; i++) {
      for (j = 0; j < 8; j++) {
        printf("%6d ", *(matrix++));
      }
      printf("\n");
    }
  } else {
    printf("Null\n");
  }
}


x86 assembly (clang, -O0):
<PrintMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1197 <PrintMatrix+0x87>
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    1192 <PrintMatrix+0x82>
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    1176 <PrintMatrix+0x66>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <PrintMatrix+0x2f>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <PrintMatrix+0x1e>
jmp    11a5 <PrintMatrix+0x95>
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintMatrix>:
test   %rdi,%rdi
je     11e7 <PrintMatrix+0xb7>
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
lea    0xeb8(%rip),%r14
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x14(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x18(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x1c(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rbx
cmp    $0x100,%ebx
jne    1150 <PrintMatrix+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xe17(%rip),%rdi
jmp    1040 <puts@plt>

LLVM IR (-O0):
@PrintMatrix.RoutineName = internal global [12 x i8] c"PrintMatrix\00"
@.str = [5 x i8] c"%6d \00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [6 x i8] c"Null\0A\00"
define void @PrintMatrix(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %29
7: ; preds = %1
store i32 0, i32* %3
br label %8
8: ; preds = %25, %7
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 8
br i1 %10, label %11, label %28
11: ; preds = %8
store i32 0, i32* %4
br label %12
12: ; preds = %20, %11
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 8
br i1 %14, label %15, label %23
15: ; preds = %12
%16 = load i32*, i32** %2
%17 = getelementptr inbounds i32, i32* %16, i32 1
store i32* %17, i32** %2
%18 = load i32, i32* %16
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %15
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %12
23: ; preds = %12
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %25
25: ; preds = %23
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %8
28: ; preds = %8
br label %31
29: ; preds = %1
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %31
31: ; preds = %29, %28
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%6d \00"
@str = [5 x i8] c"Null\00"
define void @PrintMatrix(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %33, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %31, %3 ], [ 0, %1 ]
%5 = phi i32* [ %27, %3 ], [ %0, %1 ]
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %5
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds i32, i32* %5, i64 2
%10 = load i32, i32* %6
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds i32, i32* %5, i64 3
%13 = load i32, i32* %9
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = getelementptr inbounds i32, i32* %5, i64 4
%16 = load i32, i32* %12
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = getelementptr inbounds i32, i32* %5, i64 5
%19 = load i32, i32* %15
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = getelementptr inbounds i32, i32* %5, i64 6
%22 = load i32, i32* %18
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %22)
%24 = getelementptr inbounds i32, i32* %5, i64 7
%25 = load i32, i32* %21
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %25)
%27 = getelementptr inbounds i32, i32* %5, i64 8
%28 = load i32, i32* %24
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %28)
%30 = tail call i32 @putchar(i32 10)
%31 = add nuw nsw i32 %4, 1
%32 = icmp eq i32 %31, 8
br i1 %32, label %35, label %3
33: ; preds = %1
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %35
35: ; preds = %3, %33
ret void
}