#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
void displayMatrix(size_t **matrix, size_t nbLines) {
  size_t i, j;
  for (i = 0; i < nbLines; i++) {
    for (j = 0; j < nbLines; j++) {
      fprintf(stdout, "%zu\t", matrix[i][j]);
    }
    fprintf(stdout, "\n");
  }
}


x86 assembly (clang, -O0):
<displayMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    11b0 <displayMatrix+0xa0>
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1188 <displayMatrix+0x78>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe90(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    113e <displayMatrix+0x2e>
mov    0x2e51(%rip),%rax
mov    (%rax),%edi
lea    0xe6d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <displayMatrix+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayMatrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     118a <displayMatrix+0x7a>
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x2eb3(%rip),%r13
lea    0xecc(%rip),%r15
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x0(%r13),%edi
mov    (%r14,%rbp,8),%rax
mov    (%rax,%r12,8),%rdx
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
add    $0x1,%r12
cmp    %r12,%rbx
jne    1150 <displayMatrix+0x40>
mov    0x0(%r13),%edi
lea    0xe8b(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
add    $0x1,%rbp
cmp    %rbx,%rbp
jne    1140 <displayMatrix+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [5 x i8] c"%zu\09\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @displayMatrix(i64** %0, i64 %1) {
%3 = alloca i64**
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64** %0, i64*** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %7
7: ; preds = %32, %2
%8 = load i64, i64* %5
%9 = load i64, i64* %4
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %35
11: ; preds = %7
store i64 0, i64* %6
br label %12
12: ; preds = %26, %11
%13 = load i64, i64* %6
%14 = load i64, i64* %4
%15 = icmp ult i64 %13, %14
br i1 %15, label %16, label %29
16: ; preds = %12
%17 = load i32, i32* @stdout
%18 = load i64**, i64*** %3
%19 = load i64, i64* %5
%20 = getelementptr inbounds i64*, i64** %18, i64 %19
%21 = load i64*, i64** %20
%22 = load i64, i64* %6
%23 = getelementptr inbounds i64, i64* %21, i64 %22
%24 = load i64, i64* %23
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %24)
br label %26
26: ; preds = %16
%27 = load i64, i64* %6
%28 = add i64 %27, 1
store i64 %28, i64* %6
br label %12
29: ; preds = %12
%30 = load i32, i32* @stdout
%31 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %32
32: ; preds = %29
%33 = load i64, i64* %5
%34 = add i64 %33, 1
store i64 %34, i64* %5
br label %7
35: ; preds = %7
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"%zu\09\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @displayMatrix(i64** nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %21, label %4
4: ; preds = %2, %16
%5 = phi i64 [ %19, %16 ], [ 0, %2 ]
%6 = getelementptr inbounds i64*, i64** %0, i64 %5
br label %7
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %14, %7 ]
%9 = load i32, i32* @stdout
%10 = load i64*, i64** %6
%11 = getelementptr inbounds i64, i64* %10, i64 %8
%12 = load i64, i64* %11
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %12)
%14 = add nuw i64 %8, 1
%15 = icmp eq i64 %14, %1
br i1 %15, label %16, label %7
16: ; preds = %7
%17 = load i32, i32* @stdout
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%19 = add nuw i64 %5, 1
%20 = icmp eq i64 %19, %1
br i1 %20, label %21, label %4
21: ; preds = %16, %2
ret void
}