#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 */
scalar_t__ malloc(int);
long long int **buildConstantMatrix() {
  int i, j;
  long long int **ct = (long long int **)malloc(2);
  for (i = 0; i < 2; i++) {
    ct[i] = (long long int *)malloc(2);
  }
  ct[0][0] = 0;
  ct[0][1] = 1;
  ct[1][0] = 1;
  ct[1][1] = 1;
  return ct;
}


x86 assembly (clang, -O0):
<buildConstantMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    115e <buildConstantMatrix+0x4e>
mov    $0x2,%edi
call   1030 <malloc@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112d <buildConstantMatrix+0x1d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movq   $0x1,0x8(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movq   $0x1,(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movq   $0x1,0x8(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buildConstantMatrix>:
push   %rbx
mov    $0x2,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    $0x2,%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
mov    $0x2,%edi
call   1030 <malloc@plt>
mov    %rax,0x8(%rbx)
mov    (%rbx),%rcx
movaps 0xebd(%rip),%xmm0
movups %xmm0,(%rcx)
movaps 0xec3(%rip),%xmm0
movups %xmm0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64** @buildConstantMatrix() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64**
%4 = call i64 @malloc(i32 2)
%5 = inttoptr i64 %4 to i64**
store i64** %5, i64*** %3
store i32 0, i32* %1
br label %6
6: ; preds = %16, %0
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = call i64 @malloc(i32 2)
%11 = inttoptr i64 %10 to i64*
%12 = load i64**, i64*** %3
%13 = load i32, i32* %1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i64*, i64** %12, i64 %14
store i64* %11, i64** %15
br label %16
16: ; preds = %9
%17 = load i32, i32* %1
%18 = add nsw i32 %17, 1
store i32 %18, i32* %1
br label %6
19: ; preds = %6
%20 = load i64**, i64*** %3
%21 = getelementptr inbounds i64*, i64** %20, i64 0
%22 = load i64*, i64** %21
%23 = getelementptr inbounds i64, i64* %22, i64 0
store i64 0, i64* %23
%24 = load i64**, i64*** %3
%25 = getelementptr inbounds i64*, i64** %24, i64 0
%26 = load i64*, i64** %25
%27 = getelementptr inbounds i64, i64* %26, i64 1
store i64 1, i64* %27
%28 = load i64**, i64*** %3
%29 = getelementptr inbounds i64*, i64** %28, i64 1
%30 = load i64*, i64** %29
%31 = getelementptr inbounds i64, i64* %30, i64 0
store i64 1, i64* %31
%32 = load i64**, i64*** %3
%33 = getelementptr inbounds i64*, i64** %32, i64 1
%34 = load i64*, i64** %33
%35 = getelementptr inbounds i64, i64* %34, i64 1
store i64 1, i64* %35
%36 = load i64**, i64*** %3
ret i64** %36
}

LLVM IR (-O2):
define i64** @buildConstantMatrix() {
%1 = tail call i64 @malloc(i32 2)
%2 = inttoptr i64 %1 to i64**
%3 = tail call i64 @malloc(i32 2)
%4 = inttoptr i64 %3 to i64*
store i64* %4, i64** %2
%5 = tail call i64 @malloc(i32 2)
%6 = inttoptr i64 %5 to i64*
%7 = getelementptr inbounds i64*, i64** %2, i64 1
store i64* %6, i64** %7
%8 = inttoptr i64 %1 to <2 x i64>**
%9 = load <2 x i64>*, <2 x i64>** %8
store <2 x i64> <i64 0, i64 1>, <2 x i64>* %9
%10 = inttoptr i64 %5 to <2 x i64>*
store <2 x i64> <i64 1, i64 1>, <2 x i64>* %10
ret i64** %2
}