#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 /*<<< orphan*/ doDetailedSearch();
int /*<<< orphan*/ loadDict(char *);
int /*<<< orphan*/ setBd(char *);
int strlen(char *);
char *strstr(char *, char *);
int /*<<< orphan*/ usage_and_die(int, char **);
int main(int argc, char **argv) {
  if (argc != 3)
    usage_and_die(argc, argv);
  int board_len = strlen(argv[2]);
  char *qu = strstr(argv[2], "qu");
  char *qu2 = qu ? strstr(qu + 1, "qu") : NULL;
  if (!((board_len == 16 && !qu) || (board_len == 17 && qu && !qu2))) {
    usage_and_die(argc, argv);
  }
  loadDict(argv[1]);
  setBd(argv[2]);
  doDetailedSearch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     118c <main+0x2c>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1080 <usage_and_die@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe55(%rip),%rsi
call   1060 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     11dc <main+0x7c>
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
lea    0xe32(%rip),%rsi
call   1060 <strstr@plt>
mov    %rax,-0x30(%rbp)
jmp    11e7 <main+0x87>
xor    %eax,%eax
mov    %rax,-0x30(%rbp)
jmp    11e7 <main+0x87>
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpl   $0x10,-0x14(%rbp)
jne    1204 <main+0xa4>
cmpq   $0x0,-0x20(%rbp)
je     1230 <main+0xd0>
cmpl   $0x11,-0x14(%rbp)
jne    1224 <main+0xc4>
cmpq   $0x0,-0x20(%rbp)
je     1224 <main+0xc4>
cmpq   $0x0,-0x28(%rbp)
je     1230 <main+0xd0>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1080 <usage_and_die@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <loadDict@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1070 <setBd@plt>
mov    $0x0,%al
call   1050 <doDetailedSearch@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%r14d
cmp    $0x3,%edi
je     117a <main+0x1a>
mov    %r14d,%edi
mov    %rbx,%rsi
call   1080 <usage_and_die@plt>
mov    0x10(%rbx),%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
lea    0xe70(%rip),%rsi
call   1060 <strstr@plt>
test   %rax,%rax
je     11b9 <main+0x59>
add    $0x1,%rax
lea    0xe5b(%rip),%rsi
mov    %rax,%rdi
call   1060 <strstr@plt>
cmp    $0x11,%ebp
jne    11be <main+0x5e>
test   %rax,%rax
je     11c9 <main+0x69>
jmp    11be <main+0x5e>
cmp    $0x10,%ebp
je     11c9 <main+0x69>
mov    %r14d,%edi
mov    %rbx,%rsi
call   1080 <usage_and_die@plt>
mov    0x8(%rbx),%rdi
call   1040 <loadDict@plt>
mov    0x10(%rbx),%rdi
call   1070 <setBd@plt>
xor    %eax,%eax
call   1050 <doDetailedSearch@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"qu\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 3
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i8**, i8*** %5
%14 = call i32 @usage_and_die(i32 %12, i8** %13)
br label %15
15: ; preds = %11, %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 2
%18 = load i8*, i8** %17
%19 = call i32 @strlen(i8* %18)
store i32 %19, i32* %6
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 2
%22 = load i8*, i8** %21
%23 = call i8* @strstr(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %23, i8** %7
%24 = load i8*, i8** %7
%25 = icmp ne i8* %24, null
br i1 %25, label %26, label %30
26: ; preds = %15
%27 = load i8*, i8** %7
%28 = getelementptr inbounds i8, i8* %27, i64 1
%29 = call i8* @strstr(i8* %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %31
30: ; preds = %15
br label %31
31: ; preds = %30, %26
%32 = phi i8* [ %29, %26 ], [ null, %30 ]
store i8* %32, i8** %8
%33 = load i32, i32* %6
%34 = icmp eq i32 %33, 16
br i1 %34, label %35, label %38
35: ; preds = %31
%36 = load i8*, i8** %7
%37 = icmp ne i8* %36, null
br i1 %37, label %38, label %51
38: ; preds = %35, %31
%39 = load i32, i32* %6
%40 = icmp eq i32 %39, 17
br i1 %40, label %41, label %47
41: ; preds = %38
%42 = load i8*, i8** %7
%43 = icmp ne i8* %42, null
br i1 %43, label %44, label %47
44: ; preds = %41
%45 = load i8*, i8** %8
%46 = icmp ne i8* %45, null
br i1 %46, label %47, label %51
47: ; preds = %44, %41, %38
%48 = load i32, i32* %4
%49 = load i8**, i8*** %5
%50 = call i32 @usage_and_die(i32 %48, i8** %49)
br label %51
51: ; preds = %47, %44, %35
%52 = load i8**, i8*** %5
%53 = getelementptr inbounds i8*, i8** %52, i64 1
%54 = load i8*, i8** %53
%55 = call i32 @loadDict(i8* %54)
%56 = load i8**, i8*** %5
%57 = getelementptr inbounds i8*, i8** %56, i64 2
%58 = load i8*, i8** %57
%59 = call i32 @setBd(i8* %58)
%60 = call i32 (...) @doDetailedSearch()
%61 = load i32, i32* %3
ret i32 %61
}

LLVM IR (-O2):
@.str = [3 x i8] c"qu\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @usage_and_die(i32 %0, i8** %1)
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call i32 @strlen(i8* %8)
%10 = load i8*, i8** %7
%11 = tail call i8* @strstr(i8* dereferenceable(1) %10, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %6
%14 = icmp eq i32 %9, 16
br i1 %14, label %23, label %21
15: ; preds = %6
%16 = getelementptr inbounds i8, i8* %11, i64 1
%17 = tail call i8* @strstr(i8* %16, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%18 = icmp ne i32 %9, 17
%19 = icmp ne i8* %17, null
%20 = select i1 %18, i1 true, i1 %19
br i1 %20, label %21, label %23
21: ; preds = %13, %15
%22 = tail call i32 @usage_and_die(i32 %0, i8** %1)
br label %23
23: ; preds = %15, %13, %21
%24 = getelementptr inbounds i8*, i8** %1, i64 1
%25 = load i8*, i8** %24
%26 = tail call i32 @loadDict(i8* %25)
%27 = load i8*, i8** %7
%28 = tail call i32 @setBd(i8* %27)
%29 = tail call i32 (...) @doDetailedSearch()
ret i32 0
}