#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 *D3Q15_Reverse() {
  int *vel;
  vel = (int *)malloc(15 * sizeof(int));
  vel[0] = 0;
  vel[1] = 2;
  vel[2] = 1;
  vel[3] = 4;
  vel[4] = 3;
  vel[5] = 6;
  vel[6] = 5;
  vel[7] = 14;
  vel[8] = 13;
  vel[9] = 12;
  vel[10] = 11;
  vel[11] = 10;
  vel[12] = 9;
  vel[13] = 8;
  vel[14] = 7;
  return vel;
}


x86 assembly (clang, -O0):
<D3Q15_Reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3c,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x2,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0x4,0xc(%rax)
mov    -0x8(%rbp),%rax
movl   $0x3,0x10(%rax)
mov    -0x8(%rbp),%rax
movl   $0x6,0x14(%rax)
mov    -0x8(%rbp),%rax
movl   $0x5,0x18(%rax)
mov    -0x8(%rbp),%rax
movl   $0xe,0x1c(%rax)
mov    -0x8(%rbp),%rax
movl   $0xd,0x20(%rax)
mov    -0x8(%rbp),%rax
movl   $0xc,0x24(%rax)
mov    -0x8(%rbp),%rax
movl   $0xb,0x28(%rax)
mov    -0x8(%rbp),%rax
movl   $0xa,0x2c(%rax)
mov    -0x8(%rbp),%rax
movl   $0x9,0x30(%rax)
mov    -0x8(%rbp),%rax
movl   $0x8,0x34(%rax)
mov    -0x8(%rbp),%rax
movl   $0x7,0x38(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<D3Q15_Reverse>:
push   %rax
mov    $0x3c,%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)
movabs $0x800000009,%rcx
mov    %rcx,0x30(%rax)
movl   $0x7,0x38(%rax)
pop    %rcx
ret

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

LLVM IR (-O2):
define i32* @D3Q15_Reverse() {
%1 = tail call i64 @malloc(i32 60)
%2 = inttoptr i64 %1 to i32*
%3 = inttoptr i64 %1 to <4 x i32>*
store <4 x i32> <i32 0, i32 2, i32 1, i32 4>, <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 3, i32 6, i32 5, i32 14>, <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 13, i32 12, i32 11, i32 10>, <4 x i32>* %7
%8 = getelementptr inbounds i32, i32* %2, i64 12
store i32 9, i32* %8
%9 = getelementptr inbounds i32, i32* %2, i64 13
store i32 8, i32* %9
%10 = getelementptr inbounds i32, i32* %2, i64 14
store i32 7, i32* %10
ret i32* %2
}