#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 *, int);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
void display_imatrix0(int **m, long nrow, long ncol, char *format, char *name) {
  long i, j;
  if (name != NULL)
    puts(name);
  for (i = 0; i < nrow; i++) {
    for (j = 0; j < ncol; j++)
      printf(format, m[i][j]);
    putchar('\n');
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<display_imatrix0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1160 <display_imatrix0+0x30>
mov    -0x28(%rbp),%rdi
call   1040 <puts@plt>
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    11d4 <display_imatrix0+0xa4>
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    11b9 <display_imatrix0+0x89>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x38(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1050 <printf@plt>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    117e <display_imatrix0+0x4e>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1168 <display_imatrix0+0x38>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_imatrix0>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r13
mov    %rsi,%r15
mov    %rdi,%r12
test   %r8,%r8
je     1154 <display_imatrix0+0x24>
mov    %r8,%rdi
call   1040 <puts@plt>
test   %r15,%r15
jle    119a <display_imatrix0+0x6a>
xor    %ebx,%ebx
jmp    1173 <display_imatrix0+0x43>
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %r15,%rbx
je     119a <display_imatrix0+0x6a>
test   %r13,%r13
jle    1160 <display_imatrix0+0x30>
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    (%r12,%rbx,8),%rax
mov    (%rax,%rbp,4),%esi
mov    %r14,%rdi
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r13
jne    1180 <display_imatrix0+0x50>
jmp    1160 <display_imatrix0+0x30>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @display_imatrix0(i32** %0, i64 %1, i64 %2, i8* %3, i8* %4) {
%6 = alloca i32**
%7 = alloca i64
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i64
store i32** %0, i32*** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%13 = load i8*, i8** %10
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %18
15: ; preds = %5
%16 = load i8*, i8** %10
%17 = call i32 @puts(i8* %16)
br label %18
18: ; preds = %15, %5
store i64 0, i64* %11
br label %19
19: ; preds = %43, %18
%20 = load i64, i64* %11
%21 = load i64, i64* %7
%22 = icmp slt i64 %20, %21
br i1 %22, label %23, label %46
23: ; preds = %19
store i64 0, i64* %12
br label %24
24: ; preds = %38, %23
%25 = load i64, i64* %12
%26 = load i64, i64* %8
%27 = icmp slt i64 %25, %26
br i1 %27, label %28, label %41
28: ; preds = %24
%29 = load i8*, i8** %9
%30 = load i32**, i32*** %6
%31 = load i64, i64* %11
%32 = getelementptr inbounds i32*, i32** %30, i64 %31
%33 = load i32*, i32** %32
%34 = load i64, i64* %12
%35 = getelementptr inbounds i32, i32* %33, i64 %34
%36 = load i32, i32* %35
%37 = call i32 @printf(i8* %29, i32 %36)
br label %38
38: ; preds = %28
%39 = load i64, i64* %12
%40 = add nsw i64 %39, 1
store i64 %40, i64* %12
br label %24
41: ; preds = %24
%42 = call i32 @putchar(i8 signext 10)
br label %43
43: ; preds = %41
%44 = load i64, i64* %11
%45 = add nsw i64 %44, 1
store i64 %45, i64* %11
br label %19
46: ; preds = %19
%47 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @display_imatrix0(i32** nocapture %0, i64 %1, i64 %2, i8* %3, i8* %4) {
%6 = icmp eq i8* %4, null
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 @puts(i8* %4)
br label %9
9: ; preds = %7, %5
%10 = icmp sgt i64 %1, 0
br i1 %10, label %11, label %29
11: ; preds = %9
%12 = icmp sgt i64 %2, 0
br label %13
13: ; preds = %11, %25
%14 = phi i64 [ 0, %11 ], [ %27, %25 ]
br i1 %12, label %15, label %25
15: ; preds = %13
%16 = getelementptr inbounds i32*, i32** %0, i64 %14
br label %17
17: ; preds = %15, %17
%18 = phi i64 [ 0, %15 ], [ %23, %17 ]
%19 = load i32*, i32** %16
%20 = getelementptr inbounds i32, i32* %19, i64 %18
%21 = load i32, i32* %20
%22 = tail call i32 @printf(i8* %3, i32 %21)
%23 = add nuw nsw i64 %18, 1
%24 = icmp eq i64 %23, %2
br i1 %24, label %25, label %17
25: ; preds = %17, %13
%26 = tail call i32 @putchar(i8 signext 10)
%27 = add nuw nsw i64 %14, 1
%28 = icmp eq i64 %27, %1
br i1 %28, label %29, label %13
29: ; preds = %25, %9
%30 = tail call i32 @putchar(i8 signext 10)
ret void
}