#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);
char *buildNewBoard() {
  int i, idx;
  char *board = (char *)malloc(64);
  board[0] = 2;
  board[1] = 3;
  board[2] = 4;
  board[3] = 5;
  board[4] = 6;
  board[5] = 4;
  board[6] = 3;
  board[7] = 2;
  for (i = 0, idx = 8; i < 8; i++, idx++)
    board[idx] = 1;
  for (idx = 16; idx < 48; idx++)
    board[idx] = 0;
  for (i = 0, idx = 48; i < 8; i++, idx++)
    board[idx] = 1 + 50;
  board[56] = 2 + 50;
  board[57] = 3 + 50;
  board[58] = 4 + 50;
  board[59] = 5 + 50;
  board[60] = 6 + 50;
  board[61] = 4 + 50;
  board[62] = 3 + 50;
  board[63] = 2 + 50;
  return board;
}


x86 assembly (clang, -O0):
<buildNewBoard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x40,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x2,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x3,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0x4,0x2(%rax)
mov    -0x10(%rbp),%rax
movb   $0x5,0x3(%rax)
mov    -0x10(%rbp),%rax
movb   $0x6,0x4(%rax)
mov    -0x10(%rbp),%rax
movb   $0x4,0x5(%rax)
mov    -0x10(%rbp),%rax
movb   $0x3,0x6(%rax)
mov    -0x10(%rbp),%rax
movb   $0x2,0x7(%rax)
movl   $0x0,-0x4(%rbp)
movl   $0x8,-0x8(%rbp)
cmpl   $0x8,-0x4(%rbp)
jge    11a0 <buildNewBoard+0x90>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movb   $0x1,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1173 <buildNewBoard+0x63>
movl   $0x10,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jge    11cb <buildNewBoard+0xbb>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a7 <buildNewBoard+0x97>
movl   $0x0,-0x4(%rbp)
movl   $0x30,-0x8(%rbp)
cmpl   $0x8,-0x4(%rbp)
jge    1206 <buildNewBoard+0xf6>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movb   $0x33,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11d9 <buildNewBoard+0xc9>
mov    -0x10(%rbp),%rax
movb   $0x34,0x38(%rax)
mov    -0x10(%rbp),%rax
movb   $0x35,0x39(%rax)
mov    -0x10(%rbp),%rax
movb   $0x36,0x3a(%rax)
mov    -0x10(%rbp),%rax
movb   $0x37,0x3b(%rax)
mov    -0x10(%rbp),%rax
movb   $0x38,0x3c(%rax)
mov    -0x10(%rbp),%rax
movb   $0x36,0x3d(%rax)
mov    -0x10(%rbp),%rax
movb   $0x35,0x3e(%rax)
mov    -0x10(%rbp),%rax
movb   $0x34,0x3f(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buildNewBoard>:
push   %rax
mov    $0x40,%edi
call   1030 <malloc@plt>
movabs $0x203040605040302,%rcx
04 03 02
mov    %rcx,(%rax)
movabs $0x101010101010101,%rcx
01 01 01
mov    %rcx,0x8(%rax)
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rax)
movups %xmm0,0x20(%rax)
movabs $0x3333333333333333,%rcx
33 33 33
mov    %rcx,0x30(%rax)
movabs $0x3435363837363534,%rcx
36 35 34
mov    %rcx,0x38(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i8* @buildNewBoard() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = call i64 @malloc(i32 64)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
store i8 2, i8* %7
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8 3, i8* %9
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 2
store i8 4, i8* %11
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 3
store i8 5, i8* %13
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 4
store i8 6, i8* %15
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 5
store i8 4, i8* %17
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 6
store i8 3, i8* %19
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 7
store i8 2, i8* %21
store i32 0, i32* %1
store i32 8, i32* %2
br label %22
22: ; preds = %30, %0
%23 = load i32, i32* %1
%24 = icmp slt i32 %23, 8
br i1 %24, label %25, label %35
25: ; preds = %22
%26 = load i8*, i8** %3
%27 = load i32, i32* %2
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %26, i64 %28
store i8 1, i8* %29
br label %30
30: ; preds = %25
%31 = load i32, i32* %1
%32 = add nsw i32 %31, 1
store i32 %32, i32* %1
%33 = load i32, i32* %2
%34 = add nsw i32 %33, 1
store i32 %34, i32* %2
br label %22
35: ; preds = %22
store i32 16, i32* %2
br label %36
36: ; preds = %44, %35
%37 = load i32, i32* %2
%38 = icmp slt i32 %37, 48
br i1 %38, label %39, label %47
39: ; preds = %36
%40 = load i8*, i8** %3
%41 = load i32, i32* %2
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i8, i8* %40, i64 %42
store i8 0, i8* %43
br label %44
44: ; preds = %39
%45 = load i32, i32* %2
%46 = add nsw i32 %45, 1
store i32 %46, i32* %2
br label %36
47: ; preds = %36
store i32 0, i32* %1
store i32 48, i32* %2
br label %48
48: ; preds = %56, %47
%49 = load i32, i32* %1
%50 = icmp slt i32 %49, 8
br i1 %50, label %51, label %61
51: ; preds = %48
%52 = load i8*, i8** %3
%53 = load i32, i32* %2
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8, i8* %52, i64 %54
store i8 51, i8* %55
br label %56
56: ; preds = %51
%57 = load i32, i32* %1
%58 = add nsw i32 %57, 1
store i32 %58, i32* %1
%59 = load i32, i32* %2
%60 = add nsw i32 %59, 1
store i32 %60, i32* %2
br label %48
61: ; preds = %48
%62 = load i8*, i8** %3
%63 = getelementptr inbounds i8, i8* %62, i64 56
store i8 52, i8* %63
%64 = load i8*, i8** %3
%65 = getelementptr inbounds i8, i8* %64, i64 57
store i8 53, i8* %65
%66 = load i8*, i8** %3
%67 = getelementptr inbounds i8, i8* %66, i64 58
store i8 54, i8* %67
%68 = load i8*, i8** %3
%69 = getelementptr inbounds i8, i8* %68, i64 59
store i8 55, i8* %69
%70 = load i8*, i8** %3
%71 = getelementptr inbounds i8, i8* %70, i64 60
store i8 56, i8* %71
%72 = load i8*, i8** %3
%73 = getelementptr inbounds i8, i8* %72, i64 61
store i8 54, i8* %73
%74 = load i8*, i8** %3
%75 = getelementptr inbounds i8, i8* %74, i64 62
store i8 53, i8* %75
%76 = load i8*, i8** %3
%77 = getelementptr inbounds i8, i8* %76, i64 63
store i8 52, i8* %77
%78 = load i8*, i8** %3
ret i8* %78
}

LLVM IR (-O2):
define i8* @buildNewBoard() {
%1 = tail call i64 @malloc(i32 64)
%2 = inttoptr i64 %1 to i8*
store i8 2, i8* %2
%3 = getelementptr inbounds i8, i8* %2, i64 1
store i8 3, i8* %3
%4 = getelementptr inbounds i8, i8* %2, i64 2
store i8 4, i8* %4
%5 = getelementptr inbounds i8, i8* %2, i64 3
store i8 5, i8* %5
%6 = getelementptr inbounds i8, i8* %2, i64 4
store i8 6, i8* %6
%7 = getelementptr inbounds i8, i8* %2, i64 5
store i8 4, i8* %7
%8 = getelementptr inbounds i8, i8* %2, i64 6
store i8 3, i8* %8
%9 = getelementptr inbounds i8, i8* %2, i64 7
store i8 2, i8* %9
%10 = getelementptr i8, i8* %2, i64 8
%11 = bitcast i8* %10 to i64*
store i64 72340172838076673, i64* %11
%12 = getelementptr i8, i8* %2, i64 16
%13 = getelementptr i8, i8* %2, i64 48
%14 = bitcast i8* %13 to i64*
store i64 3689348814741910323, i64* %14
%15 = getelementptr inbounds i8, i8* %2, i64 56
store i8 52, i8* %15
%16 = getelementptr inbounds i8, i8* %2, i64 57
store i8 53, i8* %16
%17 = getelementptr inbounds i8, i8* %2, i64 58
store i8 54, i8* %17
%18 = getelementptr inbounds i8, i8* %2, i64 59
store i8 55, i8* %18
%19 = getelementptr inbounds i8, i8* %2, i64 60
store i8 56, i8* %19
%20 = getelementptr inbounds i8, i8* %2, i64 61
store i8 54, i8* %20
%21 = getelementptr inbounds i8, i8* %2, i64 62
store i8 53, i8* %21
%22 = getelementptr inbounds i8, i8* %2, i64 63
store i8 52, i8* %22
ret i8* %2
}