struct dynamic_vector ***dynamic_vector_matrix(nrl, nrh, ncl, nch)
long nch, ncl, nrh, nrl;
{
  long i, nrow = nrh - nrl + 1, ncol = nch - ncl + 1;
  struct dynamic_vector ***m;
  m = (struct dynamic_vector ***)calloc(nrow + 1,
                                        sizeof(struct dynamic_vector **));
  m += 1 - nrl;
  m[nrl] = (struct dynamic_vector **)calloc(nrow * ncol + 1,
                                            sizeof(struct dynamic_vector *));
  m[nrl] += 1 - ncl;
  for (i = nrl + 1; i <= nrh; i++)
    m[i] = m[i - 1] + ncol;
  return m;
}


x86 assembly (clang, -O0):
<dynamic_vector_matrix>:
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    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
sub    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rdi
add    $0x1,%rdi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,-0x40(%rbp)
mov    $0x1,%eax
sub    -0x8(%rbp),%rax
shl    $0x3,%rax
add    -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rdi
imul   -0x38(%rbp),%rdi
add    $0x1,%rdi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,%rdx
mov    -0x40(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    $0x1,%edx
sub    -0x18(%rbp),%rdx
mov    -0x40(%rbp),%rax
mov    -0x8(%rbp),%rcx
shl    $0x3,%rdx
add    (%rax,%rcx,8),%rdx
mov    %rdx,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x10(%rbp),%rax
jg     1208 <dynamic_vector_matrix+0xf8>
mov    -0x40(%rbp),%rax
mov    -0x28(%rbp),%rcx
sub    $0x1,%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x38(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
mov    -0x40(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    11c2 <dynamic_vector_matrix+0xb2>
mov    -0x40(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dynamic_vector_matrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rcx,%r15
mov    %rdx,0x18(%rsp)
mov    %rsi,0x20(%rsp)
mov    %rdi,%rax
mov    %rdi,0x8(%rsp)
mov    %rsi,%rdi
sub    %rax,%rdi
lea    0x1(%rdi),%rbp
mov    %rcx,%r14
sub    %rdx,%r14
add    $0x1,%r14
add    $0x2,%rdi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
mov    $0x1,%r13d
mov    $0x1,%r12d
sub    0x8(%rsp),%r12
mov    %r14,0x10(%rsp)
imul   %r14,%rbp
add    $0x1,%rbp
mov    $0x8,%esi
mov    %rbp,%rdi
call   1030 <calloc@plt>
mov    0x20(%rsp),%r9
mov    0x8(%rsp),%r14
mov    0x18(%rsp),%r8
mov    %rax,%rcx
sub    %r8,%r13
lea    (%rbx,%r12,8),%rax
lea    (%rcx,%r13,8),%rcx
mov    %rcx,0x8(%rbx)
cmp    %r14,%r9
jle    1299 <dynamic_vector_matrix+0x189>
mov    0x8(%rbx),%rdx
mov    %r9d,%edi
sub    %r14d,%edi
mov    %r14,%rsi
not    %rsi
add    %r9,%rsi
and    $0x7,%rdi
je     11ff <dynamic_vector_matrix+0xef>
lea    0x0(,%r15,8),%rbp
lea    0x0(,%r8,8),%rcx
sub    %rcx,%rbp
add    $0x8,%rbp
xor    %ecx,%ecx
nop
add    %rbp,%rdx
mov    %rdx,0x10(%rbx,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%rdi
jne    11e0 <dynamic_vector_matrix+0xd0>
add    %r14,%rcx
cmp    $0x7,%rsi
jae    120c <dynamic_vector_matrix+0xfc>
jmp    1299 <dynamic_vector_matrix+0x189>
mov    %r14,%rcx
cmp    $0x7,%rsi
jb     1299 <dynamic_vector_matrix+0x189>
mov    0x10(%rsp),%rsi
lea    (%rdx,%rsi,8),%rdx
mov    %r15,%rsi
shl    $0x6,%rsi
mov    %r8,%rdi
shl    $0x6,%rdi
sub    %rdi,%rsi
add    $0x40,%rsi
shl    $0x3,%r14
sub    %r14,%rbx
add    $0x48,%rbx
shl    $0x3,%r15
shl    $0x3,%r8
sub    %r8,%r15
add    $0x8,%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rdx,-0x38(%rbx,%rcx,8)
lea    (%rdx,%r15,1),%rdi
mov    %rdi,-0x30(%rbx,%rcx,8)
add    %r15,%rdi
mov    %rdi,-0x28(%rbx,%rcx,8)
add    %r15,%rdi
mov    %rdi,-0x20(%rbx,%rcx,8)
add    %r15,%rdi
mov    %rdi,-0x18(%rbx,%rcx,8)
add    %r15,%rdi
mov    %rdi,-0x10(%rbx,%rcx,8)
add    %r15,%rdi
mov    %rdi,-0x8(%rbx,%rcx,8)
add    %r15,%rdi
mov    %rdi,(%rbx,%rcx,8)
add    $0x8,%rcx
add    %rsi,%rdx
cmp    %rcx,%r9
jne    1250 <dynamic_vector_matrix+0x140>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.dynamic_vector = type opaque
define %struct.dynamic_vector*** @dynamic_vector_matrix(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca %struct.dynamic_vector***
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%13 = load i64, i64* %6
%14 = load i64, i64* %5
%15 = sub nsw i64 %13, %14
%16 = add nsw i64 %15, 1
store i64 %16, i64* %10
%17 = load i64, i64* %8
%18 = load i64, i64* %7
%19 = sub nsw i64 %17, %18
%20 = add nsw i64 %19, 1
store i64 %20, i64* %11
%21 = load i64, i64* %10
%22 = add nsw i64 %21, 1
%23 = call i8* @calloc(i64 %22, i64 8)
%24 = bitcast i8* %23 to %struct.dynamic_vector***
store %struct.dynamic_vector*** %24, %struct.dynamic_vector**** %12
%25 = load i64, i64* %5
%26 = sub nsw i64 1, %25
%27 = load %struct.dynamic_vector***, %struct.dynamic_vector**** %12
%28 = getelementptr inbounds %struct.dynamic_vector**, %struct.dynamic_vector*** %27, i64 %26
store %struct.dynamic_vector*** %28, %struct.dynamic_vector**** %12
%29 = load i64, i64* %10
%30 = load i64, i64* %11
%31 = mul nsw i64 %29, %30
%32 = add nsw i64 %31, 1
%33 = call i8* @calloc(i64 %32, i64 8)
%34 = bitcast i8* %33 to %struct.dynamic_vector**
%35 = load %struct.dynamic_vector***, %struct.dynamic_vector**** %12
%36 = load i64, i64* %5
%37 = getelementptr inbounds %struct.dynamic_vector**, %struct.dynamic_vector*** %35, i64 %36
store %struct.dynamic_vector** %34, %struct.dynamic_vector*** %37
%38 = load i64, i64* %7
%39 = sub nsw i64 1, %38
%40 = load %struct.dynamic_vector***, %struct.dynamic_vector**** %12
%41 = load i64, i64* %5
%42 = getelementptr inbounds %struct.dynamic_vector**, %struct.dynamic_vector*** %40, i64 %41
%43 = load %struct.dynamic_vector**, %struct.dynamic_vector*** %42
%44 = getelementptr inbounds %struct.dynamic_vector*, %struct.dynamic_vector** %43, i64 %39
store %struct.dynamic_vector** %44, %struct.dynamic_vector*** %42
%45 = load i64, i64* %5
%46 = add nsw i64 %45, 1
store i64 %46, i64* %9
br label %47
47: ; preds = %62, %4
%48 = load i64, i64* %9
%49 = load i64, i64* %6
%50 = icmp sle i64 %48, %49
br i1 %50, label %51, label %65
51: ; preds = %47
%52 = load %struct.dynamic_vector***, %struct.dynamic_vector**** %12
%53 = load i64, i64* %9
%54 = sub nsw i64 %53, 1
%55 = getelementptr inbounds %struct.dynamic_vector**, %struct.dynamic_vector*** %52, i64 %54
%56 = load %struct.dynamic_vector**, %struct.dynamic_vector*** %55
%57 = load i64, i64* %11
%58 = getelementptr inbounds %struct.dynamic_vector*, %struct.dynamic_vector** %56, i64 %57
%59 = load %struct.dynamic_vector***, %struct.dynamic_vector**** %12
%60 = load i64, i64* %9
%61 = getelementptr inbounds %struct.dynamic_vector**, %struct.dynamic_vector*** %59, i64 %60
store %struct.dynamic_vector** %58, %struct.dynamic_vector*** %61
br label %62
62: ; preds = %51
%63 = load i64, i64* %9
%64 = add nsw i64 %63, 1
store i64 %64, i64* %9
br label %47
65: ; preds = %47
%66 = load %struct.dynamic_vector***, %struct.dynamic_vector**** %12
ret %struct.dynamic_vector*** %66
}

LLVM IR (-O2):
%struct.dynamic_vector = type opaque
define noalias %struct.dynamic_vector*** @dynamic_vector_matrix(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = sub nsw i64 %1, %0
%6 = add nsw i64 %5, 1
%7 = sub nsw i64 %3, %2
%8 = add nsw i64 %7, 1
%9 = add nsw i64 %5, 2
%10 = tail call i8* @calloc(i64 %9, i64 8)
%11 = bitcast i8* %10 to %struct.dynamic_vector***
%12 = sub nsw i64 1, %0
%13 = getelementptr inbounds %struct.dynamic_vector**, %struct.dynamic_vector*** %11, i64 %12
%14 = mul nsw i64 %8, %6
%15 = add nsw i64 %14, 1
%16 = tail call i8* @calloc(i64 %15, i64 8)
%17 = bitcast i8* %16 to %struct.dynamic_vector**
%18 = getelementptr inbounds %struct.dynamic_vector**, %struct.dynamic_vector*** %11, i64 1
%19 = sub nsw i64 1, %2
%20 = getelementptr inbounds %struct.dynamic_vector*, %struct.dynamic_vector** %17, i64 %19
store %struct.dynamic_vector** %20, %struct.dynamic_vector*** %18
%21 = icmp sgt i64 %1, %0
br i1 %21, label %22, label %71
22: ; preds = %4
%23 = getelementptr inbounds %struct.dynamic_vector**, %struct.dynamic_vector*** %11, i64 1
%24 = load %struct.dynamic_vector**, %struct.dynamic_vector*** %23
%25 = sub i64 %1, %0
%26 = xor i64 %0, -1
%27 = add i64 %26, %1
%28 = and i64 %25, 7
%29 = icmp eq i64 %28, 0
br i1 %29, label %39, label %30
30: ; preds = %22, %30
%31 = phi %struct.dynamic_vector** [ %35, %30 ], [ %24, %22 ]
%32 = phi i64 [ %34, %30 ], [ %0, %22 ]
%33 = phi i64 [ %37, %30 ], [ 0, %22 ]
%34 = add nsw i64 %32, 1
%35 = getelementptr inbounds %struct.dynamic_vector*, %struct.dynamic_vector** %31, i64 %8
%36 = getelementptr inbounds %struct.dynamic_vector**, %struct.dynamic_vector*** %13, i64 %34
store %struct.dynamic_vector** %35, %struct.dynamic_vector*** %36
%37 = add i64 %33, 1
%38 = icmp eq i64 %37, %28
br i1 %38, label %39, label %30
39: ; preds = %30, %22
%40 = phi %struct.dynamic_vector** [ %24, %22 ], [ %35, %30 ]
%41 = phi i64 [ %0, %22 ], [ %34, %30 ]
%42 = icmp ult i64 %27, 7
br i1 %42, label %71, label %43
43: ; preds = %39, %43
%44 = phi %struct.dynamic_vector** [ %68, %43 ], [ %40, %39 ]
%45 = phi i64 [ %67, %43 ], [ %41, %39 ]
%46 = add nsw i64 %45, 1
%47 = getelementptr inbounds %struct.dynamic_vector*, %struct.dynamic_vector** %44, i64 %8
%48 = getelementptr inbounds %struct.dynamic_vector**, %struct.dynamic_vector*** %13, i64 %46
store %struct.dynamic_vector** %47, %struct.dynamic_vector*** %48
%49 = add nsw i64 %45, 2
%50 = getelementptr inbounds %struct.dynamic_vector*, %struct.dynamic_vector** %47, i64 %8
%51 = getelementptr inbounds %struct.dynamic_vector**, %struct.dynamic_vector*** %13, i64 %49
store %struct.dynamic_vector** %50, %struct.dynamic_vector*** %51
%52 = add nsw i64 %45, 3
%53 = getelementptr inbounds %struct.dynamic_vector*, %struct.dynamic_vector** %50, i64 %8
%54 = getelementptr inbounds %struct.dynamic_vector**, %struct.dynamic_vector*** %13, i64 %52
store %struct.dynamic_vector** %53, %struct.dynamic_vector*** %54
%55 = add nsw i64 %45, 4
%56 = getelementptr inbounds %struct.dynamic_vector*, %struct.dynamic_vector** %53, i64 %8
%57 = getelementptr inbounds %struct.dynamic_vector**, %struct.dynamic_vector*** %13, i64 %55
store %struct.dynamic_vector** %56, %struct.dynamic_vector*** %57
%58 = add nsw i64 %45, 5
%59 = getelementptr inbounds %struct.dynamic_vector*, %struct.dynamic_vector** %56, i64 %8
%60 = getelementptr inbounds %struct.dynamic_vector**, %struct.dynamic_vector*** %13, i64 %58
store %struct.dynamic_vector** %59, %struct.dynamic_vector*** %60
%61 = add nsw i64 %45, 6
%62 = getelementptr inbounds %struct.dynamic_vector*, %struct.dynamic_vector** %59, i64 %8
%63 = getelementptr inbounds %struct.dynamic_vector**, %struct.dynamic_vector*** %13, i64 %61
store %struct.dynamic_vector** %62, %struct.dynamic_vector*** %63
%64 = add nsw i64 %45, 7
%65 = getelementptr inbounds %struct.dynamic_vector*, %struct.dynamic_vector** %62, i64 %8
%66 = getelementptr inbounds %struct.dynamic_vector**, %struct.dynamic_vector*** %13, i64 %64
store %struct.dynamic_vector** %65, %struct.dynamic_vector*** %66
%67 = add nsw i64 %45, 8
%68 = getelementptr inbounds %struct.dynamic_vector*, %struct.dynamic_vector** %65, i64 %8
%69 = getelementptr inbounds %struct.dynamic_vector**, %struct.dynamic_vector*** %13, i64 %67
store %struct.dynamic_vector** %68, %struct.dynamic_vector*** %69
%70 = icmp eq i64 %67, %1
br i1 %70, label %71, label %43
71: ; preds = %39, %43, %4
ret %struct.dynamic_vector*** %13
}