#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 *, short);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
void display_smatrix_number(short **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_smatrix_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_smatrix_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     11b0 <display_smatrix_number+0x80>
mov    -0x30(%rbp),%rdi
mov    -0x40(%rbp),%rax
movswl %ax,%esi
call   1050 <printf@plt>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    1181 <display_smatrix_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     1242 <display_smatrix_number+0x112>
mov    -0x38(%rbp),%rax
lea    0xe29(%rip),%rdi
movswl %ax,%esi
call   1050 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x28(%rbp),%rax
jg     1227 <display_smatrix_number+0xf7>
mov    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x40(%rbp),%rcx
movswl (%rax,%rcx,2),%esi
call   1050 <printf@plt>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    11eb <display_smatrix_number+0xbb>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    11c2 <display_smatrix_number+0x92>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_smatrix_number>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,%r14
mov    %r8,%rbx
mov    %rcx,(%rsp)
mov    %rdx,0x10(%rsp)
mov    %rsi,%rbp
mov    %rdi,%r13
mov    0x50(%rsp),%rdi
test   %rdi,%rdi
je     1162 <display_smatrix_number+0x32>
call   1040 <puts@plt>
lea    0xe97(%rip),%rdi
mov    $0x23,%esi
call   1050 <printf@plt>
mov    %rbx,0x8(%rsp)
cmp    %rbx,(%rsp)
jg     11a5 <display_smatrix_number+0x75>
mov    0x8(%rsp),%rax
lea    0x1(%rax),%r12
mov    (%rsp),%r15
nopl   0x0(%rax,%rax,1)
movswl %r15w,%esi
mov    %r14,%rdi
call   1050 <printf@plt>
add    $0x1,%r15
cmp    %r15,%r12
jne    1190 <display_smatrix_number+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    0x10(%rsp),%rbp
mov    0x8(%rsp),%r15
jle    11d3 <display_smatrix_number+0xa3>
mov    $0xa,%edi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>
lea    0x1(%r15),%r12
jmp    11f8 <display_smatrix_number+0xc8>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbp),%rax
cmp    0x10(%rsp),%rbp
mov    %rax,%rbp
je     11bb <display_smatrix_number+0x8b>
movswl %bp,%esi
lea    0xe02(%rip),%rdi
call   1050 <printf@plt>
cmp    %r15,(%rsp)
jg     11e0 <display_smatrix_number+0xb0>
mov    (%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x0(%r13,%rbp,8),%rax
movswl (%rax,%rbx,2),%esi
mov    %r14,%rdi
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1220 <display_smatrix_number+0xf0>
jmp    11e0 <display_smatrix_number+0xb0>

LLVM IR (-O0):
@.str = [4 x i8] c"%5c\00"
@.str.1 = [6 x i8] c"[%3d]\00"
define void @display_smatrix_number(i16** %0, i64 %1, i64 %2, i64 %3, i64 %4, i8* %5, i8* %6) {
%8 = alloca i16**
%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 i16** %0, i16*** %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), i16 signext 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 i16
%33 = call i32 @printf(i8* %30, i16 signext %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 i16
%47 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i16 signext %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 i16**, i16*** %8
%56 = load i64, i64* %15
%57 = getelementptr inbounds i16*, i16** %55, i64 %56
%58 = load i16*, i16** %57
%59 = load i64, i64* %16
%60 = getelementptr inbounds i16, i16* %58, i64 %59
%61 = load i16, i16* %60
%62 = call i32 @printf(i8* %54, i16 signext %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_smatrix_number(i16** 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), i16 signext 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 i16
%17 = tail call i32 @printf(i8* %5, i16 signext %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 i16
%26 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i16 signext %25)
br i1 %13, label %37, label %27
27: ; preds = %23
%28 = getelementptr inbounds i16*, i16** %0, i64 %24
br label %29
29: ; preds = %27, %29
%30 = phi i64 [ %3, %27 ], [ %35, %29 ]
%31 = load i16*, i16** %28
%32 = getelementptr inbounds i16, i16* %31, i64 %30
%33 = load i16, i16* %32
%34 = tail call i32 @printf(i8* %5, i16 signext %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
}