#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*/ writeDebugStream(char *, ...);
int /*<<< orphan*/ writeDebugStreamLine(char *);
void matrixPrintL(long *matrix, int numRows, int numCols, char *label) {
  int i, j;
  writeDebugStreamLine(label);
  for (i = 0; i < numRows; i++) {
    for (j = 0; j < numCols; j++) {
      writeDebugStream("%d", matrix[numCols * i + j]);
      writeDebugStream("\t");
    }
    writeDebugStreamLine("");
  }
}


x86 assembly (clang, -O0):
<matrixPrintL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <writeDebugStreamLine@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11be <matrixPrintL+0x9e>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11a4 <matrixPrintL+0x84>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
add    -0x20(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <writeDebugStream@plt>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1040 <writeDebugStream@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1159 <matrixPrintL+0x39>
lea    0xe59(%rip),%rdi
call   1030 <writeDebugStreamLine@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1146 <matrixPrintL+0x26>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrixPrintL>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edx,0x4(%rsp)
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rcx,%rdi
call   1030 <writeDebugStreamLine@plt>
test   %ebp,%ebp
jle    11d3 <matrixPrintL+0xb3>
movslq 0x4(%rsp),%rax
mov    %ebp,%ecx
mov    %rcx,0x8(%rsp)
mov    %eax,%r14d
shl    $0x3,%rax
mov    %rax,0x10(%rsp)
lea    0xe9a(%rip),%r15
lea    0xe96(%rip),%rbp
xor    %r12d,%r12d
jmp    119c <matrixPrintL+0x7c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0xe7d(%rip),%rdi
call   1030 <writeDebugStreamLine@plt>
add    $0x1,%r12
add    0x10(%rsp),%rbx
cmp    0x8(%rsp),%r12
je     11d3 <matrixPrintL+0xb3>
cmpl   $0x0,0x4(%rsp)
jle    1180 <matrixPrintL+0x60>
xor    %r13d,%r13d
cs nopw 0x0(%rax,%rax,1)
mov    (%rbx,%r13,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <writeDebugStream@plt>
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <writeDebugStream@plt>
add    $0x1,%r13
cmp    %r13,%r14
jne    11b0 <matrixPrintL+0x90>
jmp    1180 <matrixPrintL+0x60>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [2 x i8] c"\09\00"
@.str.2 = [1 x i8] zeroinitializer
define void @matrixPrintL(i64* nocapture %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 @writeDebugStreamLine(i8* %3)
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %29
7: ; preds = %4
%8 = icmp sgt i32 %2, 0
%9 = sext i32 %2 to i64
%10 = zext i32 %1 to i64
%11 = zext i32 %2 to i64
br label %12
12: ; preds = %7, %25
%13 = phi i64 [ 0, %7 ], [ %27, %25 ]
br i1 %8, label %14, label %25
14: ; preds = %12
%15 = mul nsw i64 %13, %9
br label %16
16: ; preds = %14, %16
%17 = phi i64 [ 0, %14 ], [ %23, %16 ]
%18 = add nsw i64 %17, %15
%19 = getelementptr inbounds i64, i64* %0, i64 %18
%20 = load i64, i64* %19
%21 = tail call i32 (i8*, ...) @writeDebugStream(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %20)
%22 = tail call i32 (i8*, ...) @writeDebugStream(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%23 = add nuw nsw i64 %17, 1
%24 = icmp eq i64 %23, %11
br i1 %24, label %25, label %16
25: ; preds = %16, %12
%26 = tail call i32 @writeDebugStreamLine(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%27 = add nuw nsw i64 %13, 1
%28 = icmp eq i64 %27, %10
br i1 %28, label %29, label %12
29: ; preds = %25, %4
ret void
}