int **create_confusion_matrix() {
  int **l = (int **)calloc(2, sizeof(int *));
  assert(l);
  l[0] = (int *)calloc(2, sizeof(int));
  assert(l[0]);
  l[1] = (int *)calloc(2, sizeof(int));
  assert(l[1]);
  return l;
}


x86 assembly (clang, -O0):
<create_confusion_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <assert@plt>
mov    $0x2,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    $0x0,%al
call   1040 <assert@plt>
mov    $0x2,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_confusion_matrix>:
push   %rbx
mov    $0x2,%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %eax,%eax
call   1040 <assert@plt>
mov    $0x2,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,(%rbx)
mov    %rax,%rdi
xor    %eax,%eax
call   1040 <assert@plt>
mov    $0x2,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,0x8(%rbx)
mov    %rax,%rdi
xor    %eax,%eax
call   1040 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32** @create_confusion_matrix() {
%1 = alloca i32**
%2 = call i8* @calloc(i64 2, i64 8)
%3 = bitcast i8* %2 to i32**
store i32** %3, i32*** %1
%4 = load i32**, i32*** %1
%5 = call i32 (i32**, ...) bitcast (i32 (...)* @assert to i32 (i32**, ...)*)(i32** %4)
%6 = call i8* @calloc(i64 2, i64 4)
%7 = bitcast i8* %6 to i32*
%8 = load i32**, i32*** %1
%9 = getelementptr inbounds i32*, i32** %8, i64 0
store i32* %7, i32** %9
%10 = load i32**, i32*** %1
%11 = getelementptr inbounds i32*, i32** %10, i64 0
%12 = load i32*, i32** %11
%13 = call i32 (i32*, ...) bitcast (i32 (...)* @assert to i32 (i32*, ...)*)(i32* %12)
%14 = call i8* @calloc(i64 2, i64 4)
%15 = bitcast i8* %14 to i32*
%16 = load i32**, i32*** %1
%17 = getelementptr inbounds i32*, i32** %16, i64 1
store i32* %15, i32** %17
%18 = load i32**, i32*** %1
%19 = getelementptr inbounds i32*, i32** %18, i64 1
%20 = load i32*, i32** %19
%21 = call i32 (i32*, ...) bitcast (i32 (...)* @assert to i32 (i32*, ...)*)(i32* %20)
%22 = load i32**, i32*** %1
ret i32** %22
}

LLVM IR (-O2):
define i32** @create_confusion_matrix() {
%1 = tail call dereferenceable_or_null(16) i8* @calloc(i64 2, i64 8)
%2 = bitcast i8* %1 to i32**
%3 = tail call i32 (i32**, ...) bitcast (i32 (...)* @assert to i32 (i32**, ...)*)(i32** %2)
%4 = tail call dereferenceable_or_null(8) i8* @calloc(i64 2, i64 4)
%5 = bitcast i8* %4 to i32*
%6 = bitcast i8* %1 to i8**
store i8* %4, i8** %6
%7 = tail call i32 (i32*, ...) bitcast (i32 (...)* @assert to i32 (i32*, ...)*)(i32* %5)
%8 = tail call dereferenceable_or_null(8) i8* @calloc(i64 2, i64 4)
%9 = bitcast i8* %8 to i32*
%10 = getelementptr inbounds i32*, i32** %2, i64 1
%11 = bitcast i32** %10 to i8**
store i8* %8, i8** %11
%12 = tail call i32 (i32*, ...) bitcast (i32 (...)* @assert to i32 (i32*, ...)*)(i32* %9)
ret i32** %2
}