#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_imatrix_number(int **m, long nrl, long nrh, long ncl, long nch,
                            char *format, char *name) {
  long i, j;
  if (name != NULL)
    puts(name);
  printf("%5c", '#');
  for (j = ncl; j <= nch; j++) {
    printf(format, j);
  }
  putchar('\n');
  for (i = nrl; i <= nrh; i++) {
    printf("[%3d]", i);
    for (j = ncl; j <= nch; j++) {
      printf(format, m[i][j]);
    }
    putchar('\n');
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<display_imatrix_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpq   $0x0,0x10(%rbp)
je     1168 <display_imatrix_number+0x38>
mov    0x10(%rbp),%rdi
call   1040 <puts@plt>
lea    0xe91(%rip),%rdi
mov    $0x23,%esi
call   1050 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x28(%rbp),%rax
jg     11af <display_imatrix_number+0x7f>
mov    -0x30(%rbp),%rdi
mov    -0x40(%rbp),%rax
mov    %eax,%esi
call   1050 <printf@plt>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    1181 <display_imatrix_number+0x51>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     123f <display_imatrix_number+0x10f>
mov    -0x38(%rbp),%rax
mov    %eax,%esi
lea    0xe28(%rip),%rdi
call   1050 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x28(%rbp),%rax
jg     1224 <display_imatrix_number+0xf4>
mov    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x40(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1050 <printf@plt>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    11e9 <display_imatrix_number+0xb9>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    11c1 <display_imatrix_number+0x91>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_imatrix_number>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,%r14
mov    %r8,%rbx
mov    %rcx,0x8(%rsp)
mov    %rdx,0x10(%rsp)
mov    %rsi,%r12
mov    %rdi,%r13
mov    0x50(%rsp),%rdi
test   %rdi,%rdi
je     1163 <display_imatrix_number+0x33>
call   1040 <puts@plt>
lea    0xe96(%rip),%rdi
mov    $0x23,%esi
call   1050 <printf@plt>
mov    %rbx,%rbp
cmp    %rbx,0x8(%rsp)
jg     11a4 <display_imatrix_number+0x74>
lea    0x1(%rbp),%rbx
mov    0x8(%rsp),%r15
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15d,%esi
call   1050 <printf@plt>
add    $0x1,%r15
cmp    %r15,%rbx
jne    1190 <display_imatrix_number+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    0x10(%rsp),%r12
jle    11cd <display_imatrix_number+0x9d>
mov    $0xa,%edi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>
mov    %rbp,%r15
lea    0x1(%rbp),%rbx
jmp    11f9 <display_imatrix_number+0xc9>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r12),%rax
cmp    0x10(%rsp),%r12
mov    %rax,%r12
je     11b5 <display_imatrix_number+0x85>
lea    0xe04(%rip),%rdi
mov    %r12d,%esi
call   1050 <printf@plt>
cmp    %r15,0x8(%rsp)
jg     11e0 <display_imatrix_number+0xb0>
mov    0x8(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x0(%r13,%r12,8),%rax
mov    (%rax,%rbp,4),%esi
mov    %r14,%rdi
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1220 <display_imatrix_number+0xf0>
jmp    11e0 <display_imatrix_number+0xb0>

LLVM IR (-O0):
@.str = [4 x i8] c"%5c\00"
@.str.1 = [6 x i8] c"[%3d]\00"
define void @display_imatrix_number(i32** %0, i64 %1, i64 %2, i64 %3, i64 %4, i8* %5, i8* %6) {
%8 = alloca i32**
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i64
%16 = alloca i64
store i32** %0, i32*** %8
store i64 %1, i64* %9
store i64 %2, i64* %10
store i64 %3, i64* %11
store i64 %4, i64* %12
store i8* %5, i8** %13
store i8* %6, i8** %14
%17 = load i8*, i8** %14
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %22
19: ; preds = %7
%20 = load i8*, i8** %14
%21 = call i32 @puts(i8* %20)
br label %22
22: ; preds = %19, %7
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 35)
%24 = load i64, i64* %11
store i64 %24, i64* %16
br label %25
25: ; preds = %34, %22
%26 = load i64, i64* %16
%27 = load i64, i64* %12
%28 = icmp sle i64 %26, %27
br i1 %28, label %29, label %37
29: ; preds = %25
%30 = load i8*, i8** %13
%31 = load i64, i64* %16
%32 = trunc i64 %31 to i32
%33 = call i32 @printf(i8* %30, i32 %32)
br label %34
34: ; preds = %29
%35 = load i64, i64* %16
%36 = add nsw i64 %35, 1
store i64 %36, i64* %16
br label %25
37: ; preds = %25
%38 = call i32 @putchar(i8 signext 10)
%39 = load i64, i64* %9
store i64 %39, i64* %15
br label %40
40: ; preds = %68, %37
%41 = load i64, i64* %15
%42 = load i64, i64* %10
%43 = icmp sle i64 %41, %42
br i1 %43, label %44, label %71
44: ; preds = %40
%45 = load i64, i64* %15
%46 = trunc i64 %45 to i32
%47 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %46)
%48 = load i64, i64* %11
store i64 %48, i64* %16
br label %49
49: ; preds = %63, %44
%50 = load i64, i64* %16
%51 = load i64, i64* %12
%52 = icmp sle i64 %50, %51
br i1 %52, label %53, label %66
53: ; preds = %49
%54 = load i8*, i8** %13
%55 = load i32**, i32*** %8
%56 = load i64, i64* %15
%57 = getelementptr inbounds i32*, i32** %55, i64 %56
%58 = load i32*, i32** %57
%59 = load i64, i64* %16
%60 = getelementptr inbounds i32, i32* %58, i64 %59
%61 = load i32, i32* %60
%62 = call i32 @printf(i8* %54, i32 %61)
br label %63
63: ; preds = %53
%64 = load i64, i64* %16
%65 = add nsw i64 %64, 1
store i64 %65, i64* %16
br label %49
66: ; preds = %49
%67 = call i32 @putchar(i8 signext 10)
br label %68
68: ; preds = %66
%69 = load i64, i64* %15
%70 = add nsw i64 %69, 1
store i64 %70, i64* %15
br label %40
71: ; preds = %40
%72 = call i32 @putchar(i8 signext 10)
ret void
}

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