#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 */
char **createChessBoard();
int /*<<< orphan*/ failwhale();
int /*<<< orphan*/ printChessBoard(char **);
int /*<<< orphan*/ printf(char *);
int main(void) {
  char **board = createChessBoard();
  if (board[0][3] != 'Q')
    failwhale();
  if (board[7][4] != 'k')
    failwhale();
  if (board[6][7] != 'p')
    failwhale();
  if (board[4][7] != ' ')
    failwhale();
  printChessBoard(board);
  printf("Hooray!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <createChessBoard@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl 0x3(%rax),%eax
cmp    $0x51,%eax
je     1175 <main+0x35>
mov    $0x0,%al
call   1030 <failwhale@plt>
mov    -0x10(%rbp),%rax
mov    0x38(%rax),%rax
movsbl 0x4(%rax),%eax
cmp    $0x6b,%eax
je     1191 <main+0x51>
mov    $0x0,%al
call   1030 <failwhale@plt>
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%rax
movsbl 0x7(%rax),%eax
cmp    $0x70,%eax
je     11ad <main+0x6d>
mov    $0x0,%al
call   1030 <failwhale@plt>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
movsbl 0x7(%rax),%eax
cmp    $0x20,%eax
je     11c9 <main+0x89>
mov    $0x0,%al
call   1030 <failwhale@plt>
mov    -0x10(%rbp),%rdi
call   1060 <printChessBoard@plt>
lea    0xe27(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <createChessBoard@plt>
mov    %rax,%rbx
mov    (%rax),%rax
cmpb   $0x51,0x3(%rax)
je     115b <main+0x1b>
xor    %eax,%eax
call   1040 <failwhale@plt>
mov    0x38(%rbx),%rax
cmpb   $0x6b,0x4(%rax)
je     116c <main+0x2c>
xor    %eax,%eax
call   1040 <failwhale@plt>
mov    0x30(%rbx),%rax
cmpb   $0x70,0x7(%rax)
je     117d <main+0x3d>
xor    %eax,%eax
call   1040 <failwhale@plt>
mov    0x20(%rbx),%rax
cmpb   $0x20,0x7(%rax)
je     118e <main+0x4e>
xor    %eax,%eax
call   1040 <failwhale@plt>
mov    %rbx,%rdi
call   1060 <printChessBoard@plt>
lea    0xe63(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Hooray!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8**
store i32 0, i32* %1
%3 = call i8** (...) @createChessBoard()
store i8** %3, i8*** %2
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8, i8* %6, i64 3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 81
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 (...) @failwhale()
br label %13
13: ; preds = %11, %0
%14 = load i8**, i8*** %2
%15 = getelementptr inbounds i8*, i8** %14, i64 7
%16 = load i8*, i8** %15
%17 = getelementptr inbounds i8, i8* %16, i64 4
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 107
br i1 %20, label %21, label %23
21: ; preds = %13
%22 = call i32 (...) @failwhale()
br label %23
23: ; preds = %21, %13
%24 = load i8**, i8*** %2
%25 = getelementptr inbounds i8*, i8** %24, i64 6
%26 = load i8*, i8** %25
%27 = getelementptr inbounds i8, i8* %26, i64 7
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp ne i32 %29, 112
br i1 %30, label %31, label %33
31: ; preds = %23
%32 = call i32 (...) @failwhale()
br label %33
33: ; preds = %31, %23
%34 = load i8**, i8*** %2
%35 = getelementptr inbounds i8*, i8** %34, i64 4
%36 = load i8*, i8** %35
%37 = getelementptr inbounds i8, i8* %36, i64 7
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp ne i32 %39, 32
br i1 %40, label %41, label %43
41: ; preds = %33
%42 = call i32 (...) @failwhale()
br label %43
43: ; preds = %41, %33
%44 = load i8**, i8*** %2
%45 = call i32 @printChessBoard(i8** %44)
%46 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"Hooray!\00"
define i32 @main() {
%1 = tail call i8** (...) @createChessBoard()
%2 = load i8*, i8** %1
%3 = getelementptr inbounds i8, i8* %2, i64 3
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 81
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = tail call i32 (...) @failwhale()
br label %8
8: ; preds = %6, %0
%9 = getelementptr inbounds i8*, i8** %1, i64 7
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8, i8* %10, i64 4
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 107
br i1 %13, label %16, label %14
14: ; preds = %8
%15 = tail call i32 (...) @failwhale()
br label %16
16: ; preds = %14, %8
%17 = getelementptr inbounds i8*, i8** %1, i64 6
%18 = load i8*, i8** %17
%19 = getelementptr inbounds i8, i8* %18, i64 7
%20 = load i8, i8* %19
%21 = icmp eq i8 %20, 112
br i1 %21, label %24, label %22
22: ; preds = %16
%23 = tail call i32 (...) @failwhale()
br label %24
24: ; preds = %22, %16
%25 = getelementptr inbounds i8*, i8** %1, i64 4
%26 = load i8*, i8** %25
%27 = getelementptr inbounds i8, i8* %26, i64 7
%28 = load i8, i8* %27
%29 = icmp eq i8 %28, 32
br i1 %29, label %32, label %30
30: ; preds = %24
%31 = tail call i32 (...) @failwhale()
br label %32
32: ; preds = %30, %24
%33 = tail call i32 @printChessBoard(i8** %1)
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}