#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 */
typedef long ushort;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
void display_usmatrix_number(ushort **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_usmatrix_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_usmatrix_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     11ad <display_usmatrix_number+0x7d>
mov    -0x30(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1050 <printf@plt>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    1181 <display_usmatrix_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     123c <display_usmatrix_number+0x10c>
mov    -0x38(%rbp),%rsi
lea    0xe2c(%rip),%rdi
call   1050 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x28(%rbp),%rax
jg     1221 <display_usmatrix_number+0xf1>
mov    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x40(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1050 <printf@plt>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    11e5 <display_usmatrix_number+0xb5>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    11bf <display_usmatrix_number+0x8f>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_usmatrix_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_usmatrix_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_usmatrix_number+0x74>
lea    0x1(%rbp),%rbx
mov    0x8(%rsp),%r15
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <printf@plt>
add    $0x1,%r15
cmp    %r15,%rbx
jne    1190 <display_usmatrix_number+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    0x10(%rsp),%r12
jle    11cd <display_usmatrix_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_usmatrix_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_usmatrix_number+0x85>
lea    0xe04(%rip),%rdi
mov    %r12,%rsi
call   1050 <printf@plt>
cmp    %r15,0x8(%rsp)
jg     11e0 <display_usmatrix_number+0xb0>
mov    0x8(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x0(%r13,%r12,8),%rax
mov    (%rax,%rbp,8),%rsi
mov    %r14,%rdi
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1220 <display_usmatrix_number+0xf0>
jmp    11e0 <display_usmatrix_number+0xb0>

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