void print_imat(m, rsize1, rsize2, csize1, csize2) int **m;
int rsize1, rsize2, csize1, csize2;
{
  int i, j;
  putchar('{');
  for (i = rsize1; i <= rsize2; i++) {
    putchar('{');
    for (j = csize1; j < csize2; j++)
      printf("%d  ", m[i][j]);
    printf("%d}\n", m[i][csize2]);
  }
  putchar('}');
}


x86 assembly (clang, -O0):
<print_imat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    $0x7b,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11d3 <print_imat+0xb3>
mov    $0x7b,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11a4 <print_imat+0x84>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1169 <print_imat+0x49>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114b <print_imat+0x2b>
mov    $0x7d,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_imat>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8d,0x8(%rsp)
mov    %ecx,0x4(%rsp)
mov    %edx,%ebx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    $0x7b,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
mov    %ebx,(%rsp)
cmp    %ebx,%r14d
jle    116d <print_imat+0x4d>
mov    $0x7d,%edi
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>
movslq 0x8(%rsp),%rax
movslq 0x4(%rsp),%rcx
movslq %r14d,%r14
addl   $0x1,(%rsp)
mov    %rax,%r13
mov    %rcx,0x10(%rsp)
sub    %ecx,%eax
mov    %eax,0xc(%rsp)
lea    0xe6d(%rip),%rbx
jmp    11c1 <print_imat+0xa1>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x0(%rbp,%r14,8),%rax
mov    (%rax,%r13,4),%esi
lea    0xe55(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r14
cmp    %r14d,(%rsp)
je     1153 <print_imat+0x33>
mov    $0x7b,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
mov    0x4(%rsp),%eax
cmp    0x8(%rsp),%eax
jge    11a0 <print_imat+0x80>
mov    0xc(%rsp),%r15d
mov    0x10(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x0(%rbp,%r14,8),%rax
mov    (%rax,%r12,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r12
add    $0xffffffff,%r15d
jne    11f0 <print_imat+0xd0>
jmp    11a0 <print_imat+0x80>

LLVM IR (-O0):
@.str = [5 x i8] c"%d \00"
@.str.1 = [5 x i8] c"%d}\0A\00"
define void @print_imat(i32** %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32** %0, i32*** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%13 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 123)
%14 = load i32, i32* %7
store i32 %14, i32* %11
br label %15
15: ; preds = %51, %5
%16 = load i32, i32* %11
%17 = load i32, i32* %8
%18 = icmp sle i32 %16, %17
br i1 %18, label %19, label %54
19: ; preds = %15
%20 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 123)
%21 = load i32, i32* %9
store i32 %21, i32* %12
br label %22
22: ; preds = %37, %19
%23 = load i32, i32* %12
%24 = load i32, i32* %10
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %40
26: ; preds = %22
%27 = load i32**, i32*** %6
%28 = load i32, i32* %11
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32*, i32** %27, i64 %29
%31 = load i32*, i32** %30
%32 = load i32, i32* %12
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i32, i32* %31, i64 %33
%35 = load i32, i32* %34
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %35)
br label %37
37: ; preds = %26
%38 = load i32, i32* %12
%39 = add nsw i32 %38, 1
store i32 %39, i32* %12
br label %22
40: ; preds = %22
%41 = load i32**, i32*** %6
%42 = load i32, i32* %11
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i32*, i32** %41, i64 %43
%45 = load i32*, i32** %44
%46 = load i32, i32* %10
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i32, i32* %45, i64 %47
%49 = load i32, i32* %48
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %49)
br label %51
51: ; preds = %40
%52 = load i32, i32* %11
%53 = add nsw i32 %52, 1
store i32 %53, i32* %11
br label %15
54: ; preds = %15
%55 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 125)
ret void
}

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