#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 can_make_words(char **, char *);
int /*<<< orphan*/ printf(char *, char *, int);
int main(void) {
  char *blocks[] = {"BO", "XK", "DQ", "CP", "NA", "GT", "RE",
                    "TG", "QD", "FS", "JW", "HU", "VI", "AN",
                    "OB", "ER", "FS", "LY", "PC", "ZM", 0};
  char *words[] = {"",       "A",     "BARK",    "BOOK", "TREAT",
                   "COMMON", "SQUAD", "Confuse", 0};
  char **w;
  for (w = words; *w; w++)
    printf("%s\t%d\n", *w, can_make_words(blocks, *w));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xb0(%rbp),%rdi
lea    0x2bd0(%rip),%rsi
mov    $0xa8,%edx
call   1050 <memcpy@plt>
lea    -0x100(%rbp),%rdi
lea    0x2c68(%rip),%rsi
mov    $0x48,%edx
call   1050 <memcpy@plt>
lea    -0x100(%rbp),%rax
mov    %rax,-0x108(%rbp)
mov    -0x108(%rbp),%rax
cmpq   $0x0,(%rax)
je     11e4 <main+0xb4>
mov    -0x108(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x110(%rbp)
lea    -0xb0(%rbp),%rdi
mov    -0x108(%rbp),%rax
mov    (%rax),%rsi
call   1030 <can_make_words@plt>
mov    -0x110(%rbp),%rsi
mov    %eax,%edx
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
mov    -0x108(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x108(%rbp)
jmp    1180 <main+0x50>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xf8,%rsp
lea    0x2bdb(%rip),%rsi
lea    0x50(%rsp),%r14
mov    $0xa8,%edx
mov    %r14,%rdi
call   1050 <memcpy@plt>
mov    0x2cb2(%rip),%rax
mov    %rax,0x40(%rsp)
movaps 0x2c96(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0x2c7a(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0x2c5e(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0x2c42(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x8(%rsp),%rbx
lea    0xec6(%rip),%r12
lea    0xeb9(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %r12,%rsi
call   1030 <can_make_words@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
mov    (%rbx),%r12
add    $0x8,%rbx
test   %r12,%r12
jne    11b0 <main+0x80>
xor    %eax,%eax
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"BO\00"
@.str.1 = [3 x i8] c"XK\00"
@.str.2 = [3 x i8] c"DQ\00"
@.str.3 = [3 x i8] c"CP\00"
@.str.4 = [3 x i8] c"NA\00"
@.str.5 = [3 x i8] c"GT\00"
@.str.6 = [3 x i8] c"RE\00"
@.str.7 = [3 x i8] c"TG\00"
@.str.8 = [3 x i8] c"QD\00"
@.str.9 = [3 x i8] c"FS\00"
@.str.10 = [3 x i8] c"JW\00"
@.str.11 = [3 x i8] c"HU\00"
@.str.12 = [3 x i8] c"VI\00"
@.str.13 = [3 x i8] c"AN\00"
@.str.14 = [3 x i8] c"OB\00"
@.str.15 = [3 x i8] c"ER\00"
@.str.16 = [3 x i8] c"LY\00"
@.str.17 = [3 x i8] c"PC\00"
@.str.18 = [3 x i8] c"ZM\00"
@__const.main.blocks = [21 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i32 0, i32 0), i8* null]
@.str.19 = [1 x i8] zeroinitializer
@.str.20 = [2 x i8] c"A\00"
@.str.21 = [5 x i8] c"BARK\00"
@.str.22 = [5 x i8] c"BOOK\00"
@.str.23 = [6 x i8] c"TREAT\00"
@.str.24 = [7 x i8] c"COMMON\00"
@.str.25 = [6 x i8] c"SQUAD\00"
@.str.26 = [8 x i8] c"Confuse\00"
@__const.main.words = [9 x i8*] [i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.26, i32 0, i32 0), i8* null]
@.str.27 = [7 x i8] c"%s\09%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [21 x i8*]
%3 = alloca [9 x i8*]
%4 = alloca i8**
store i32 0, i32* %1
%5 = bitcast [21 x i8*]* %2 to i8*
%6 = bitcast [9 x i8*]* %3 to i8*
%7 = getelementptr inbounds [9 x i8*], [9 x i8*]* %3, i64 0, i64 0
store i8** %7, i8*** %4
br label %8
8: ; preds = %20, %0
%9 = load i8**, i8*** %4
%10 = load i8*, i8** %9
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load i8**, i8*** %4
%14 = load i8*, i8** %13
%15 = getelementptr inbounds [21 x i8*], [21 x i8*]* %2, i64 0, i64 0
%16 = load i8**, i8*** %4
%17 = load i8*, i8** %16
%18 = call i32 @can_make_words(i8** %15, i8* %17)
%19 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.27, i64 0, i64 0), i8* %14, i32 %18)
br label %20
20: ; preds = %12
%21 = load i8**, i8*** %4
%22 = getelementptr inbounds i8*, i8** %21, i32 1
store i8** %22, i8*** %4
br label %8
23: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"BO\00"
@.str.1 = [3 x i8] c"XK\00"
@.str.2 = [3 x i8] c"DQ\00"
@.str.3 = [3 x i8] c"CP\00"
@.str.4 = [3 x i8] c"NA\00"
@.str.5 = [3 x i8] c"GT\00"
@.str.6 = [3 x i8] c"RE\00"
@.str.7 = [3 x i8] c"TG\00"
@.str.8 = [3 x i8] c"QD\00"
@.str.9 = [3 x i8] c"FS\00"
@.str.10 = [3 x i8] c"JW\00"
@.str.11 = [3 x i8] c"HU\00"
@.str.12 = [3 x i8] c"VI\00"
@.str.13 = [3 x i8] c"AN\00"
@.str.14 = [3 x i8] c"OB\00"
@.str.15 = [3 x i8] c"ER\00"
@.str.16 = [3 x i8] c"LY\00"
@.str.17 = [3 x i8] c"PC\00"
@.str.18 = [3 x i8] c"ZM\00"
@__const.main.blocks = [21 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i32 0, i32 0), i8* null]
@.str.19 = [1 x i8] zeroinitializer
@.str.20 = [2 x i8] c"A\00"
@.str.21 = [5 x i8] c"BARK\00"
@.str.22 = [5 x i8] c"BOOK\00"
@.str.23 = [6 x i8] c"TREAT\00"
@.str.24 = [7 x i8] c"COMMON\00"
@.str.25 = [6 x i8] c"SQUAD\00"
@.str.26 = [8 x i8] c"Confuse\00"
@__const.main.words = [9 x i8*] [i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.26, i32 0, i32 0), i8* null]
@.str.27 = [7 x i8] c"%s\09%d\0A\00"
define i32 @main() {
%1 = alloca [21 x i8*]
%2 = alloca [9 x i8*]
%3 = bitcast [21 x i8*]* %1 to i8*
%4 = bitcast [9 x i8*]* %2 to i8*
%5 = getelementptr inbounds [9 x i8*], [9 x i8*]* %2, i64 0, i64 0
%6 = getelementptr inbounds [21 x i8*], [21 x i8*]* %1, i64 0, i64 0
br label %7
7: ; preds = %0, %7
%8 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.19, i64 0, i64 0), %0 ], [ %13, %7 ]
%9 = phi i8** [ %5, %0 ], [ %12, %7 ]
%10 = call i32 @can_make_words(i8** %6, i8* %8)
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.27, i64 0, i64 0), i8* %8, i32 %10)
%12 = getelementptr inbounds i8*, i8** %9, i64 1
%13 = load i8*, i8** %12
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %7
15: ; preds = %7
ret i32 0
}