#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);
int *get_adjmatrix() {
  int adest[][6] = {
      {0, 9999, 9999, 1, 8, 2},       {9999, 0, 2, 9999, 9999, 9999},
      {4, 9999, 0, 22, 9999, 9999},   {9999, 2, 9999, 0, 9999, 9999},
      {9999, 9999, 9999, 9, 0, 9999}, {9999, 9999, 9999, 9, 9999, 0},
  };
  int *vertex_matrix = (int *)malloc(6 * 6 * sizeof(int *));
  int i, j;
  for (i = 0; i != 6; ++i) {
    for (j = 0; j != 6; ++j)
      *(vertex_matrix + i * 6 + j) = adest[i][j];
  }
  return vertex_matrix;
}


x86 assembly (clang, -O0):
<get_adjmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
lea    -0x90(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x90,%edx
call   1030 <memcpy@plt>
mov    $0x120,%edi
call   1040 <malloc@plt>
mov    %rax,-0x98(%rbp)
movl   $0x0,-0x9c(%rbp)
cmpl   $0x6,-0x9c(%rbp)
je     11f0 <get_adjmatrix+0xd0>
movl   $0x0,-0xa0(%rbp)
cmpl   $0x6,-0xa0(%rbp)
je     11d7 <get_adjmatrix+0xb7>
movslq -0x9c(%rbp),%rcx
lea    -0x90(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0xa0(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x98(%rbp),%rax
imul   $0x6,-0x9c(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0xa0(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa0(%rbp)
jmp    1175 <get_adjmatrix+0x55>
jmp    11dc <get_adjmatrix+0xbc>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    115e <get_adjmatrix+0x3e>
mov    -0x98(%rbp),%rax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_adjmatrix>:
push   %rax
mov    $0x120,%edi
call   1030 <malloc@plt>
movaps 0xede(%rip),%xmm0
movups %xmm0,(%rax)
movaps 0xee4(%rip),%xmm0
movups %xmm0,0x10(%rax)
movaps 0xee9(%rip),%xmm0
movups %xmm0,0x20(%rax)
movaps 0xeee(%rip),%xmm0
movups %xmm0,0x30(%rax)
movaps 0xef3(%rip),%xmm0
movups %xmm0,0x40(%rax)
movaps 0xef8(%rip),%xmm0
movups %xmm0,0x50(%rax)
movaps 0xefd(%rip),%xmm0
movups %xmm0,0x60(%rax)
movaps 0xf02(%rip),%xmm0
movups %xmm0,0x70(%rax)
movaps 0xf07(%rip),%xmm0
movups %xmm0,0x80(%rax)
pop    %rcx
ret

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

LLVM IR (-O2):
define i32* @get_adjmatrix() {
%1 = tail call i64 @malloc(i32 288)
%2 = inttoptr i64 %1 to i32*
%3 = inttoptr i64 %1 to <4 x i32>*
store <4 x i32> <i32 0, i32 9999, i32 9999, i32 1>, <4 x i32>* %3
%4 = getelementptr inbounds i32, i32* %2, i64 4
%5 = bitcast i32* %4 to <4 x i32>*
store <4 x i32> <i32 8, i32 2, i32 9999, i32 0>, <4 x i32>* %5
%6 = getelementptr inbounds i32, i32* %2, i64 8
%7 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> <i32 2, i32 9999, i32 9999, i32 9999>, <4 x i32>* %7
%8 = getelementptr inbounds i32, i32* %2, i64 12
%9 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> <i32 4, i32 9999, i32 0, i32 22>, <4 x i32>* %9
%10 = getelementptr inbounds i32, i32* %2, i64 16
%11 = bitcast i32* %10 to <4 x i32>*
store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 2>, <4 x i32>* %11
%12 = getelementptr inbounds i32, i32* %2, i64 20
%13 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> <i32 9999, i32 0, i32 9999, i32 9999>, <4 x i32>* %13
%14 = getelementptr inbounds i32, i32* %2, i64 24
%15 = bitcast i32* %14 to <4 x i32>*
store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9>, <4 x i32>* %15
%16 = getelementptr inbounds i32, i32* %2, i64 28
%17 = bitcast i32* %16 to <4 x i32>*
store <4 x i32> <i32 0, i32 9999, i32 9999, i32 9999>, <4 x i32>* %17
%18 = getelementptr inbounds i32, i32* %2, i64 32
%19 = bitcast i32* %18 to <4 x i32>*
store <4 x i32> <i32 9999, i32 9, i32 9999, i32 0>, <4 x i32>* %19
ret i32* %2
}