#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 */
int getupperleft(int);
int *ai_vertsonhex(int hex, int sur[6]) {
  sur[0] = getupperleft(hex);
  sur[1] = sur[0] + 1;
  sur[2] = sur[0] + 6;
  sur[3] = sur[0] + 7;
  sur[4] = sur[0] + 12;
  sur[5] = sur[0] + 13;
  return sur;
}


x86 assembly (clang, -O0):
<ai_vertsonhex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <getupperleft@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x6,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x7,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0xc,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0xd,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x14(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ai_vertsonhex>:
push   %rbx
mov    %rsi,%rbx
call   1030 <getupperleft@plt>
movd   %eax,%xmm0
pshufd $0x0,%xmm0,%xmm0
paddd  0xed6(%rip),%xmm0
mov    %eax,(%rbx)
movdqu %xmm0,0x4(%rbx)
add    $0xd,%eax
mov    %eax,0x14(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32* @ai_vertsonhex(i32 %0, i32* returned %1) {
%3 = tail call i32 @getupperleft(i32 %0)
store i32 %3, i32* %1
%4 = getelementptr inbounds i32, i32* %1, i64 1
%5 = insertelement <4 x i32> poison, i32 %3, i64 0
%6 = shufflevector <4 x i32> %5, <4 x i32> poison, <4 x i32> zeroinitializer
%7 = add nsw <4 x i32> %6, <i32 1, i32 6, i32 7, i32 12>
%8 = bitcast i32* %4 to <4 x i32>*
store <4 x i32> %7, <4 x i32>* %8
%9 = add nsw i32 %3, 13
%10 = getelementptr inbounds i32, i32* %1, i64 5
store i32 %9, i32* %10
ret i32* %1
}