#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 */
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
int /*<<< orphan*/ clock();
int /*<<< orphan*/ help();
int /*<<< orphan*/ loadDictionary(char *, char *);
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ processListOfWordsFile(char *);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ system(char *);
scalar_t__ timediff(int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int i;
  char *dictionary = "short.dict";
  bool process = false, solve = false, customDictionary = false;
  int processPosition = 0, solvePosition = 0, customDictionaryPosition = 0;
  clock_t start = clock();
  if (argc <= 2)
    help();
  for (i = 0; i < argc; i++) {
    if (!strcmp(argv[i], "/p")) {
      if (i < argc) {
        process = true;
        processPosition = i + 1;
      }
    }
    if (!strcmp(argv[i], "/i")) {
      if (i < argc) {
        solve = true;
        solvePosition = i + 1;
      }
    }
    if (!strcmp(argv[i], "/d")) {
      if (i < argc) {
        customDictionary = true;
        customDictionaryPosition = i + 1;
      }
    }
  }
  if (process) {
    processListOfWordsFile(argv[processPosition]);
  }
  if (customDictionary) {
    dictionary = argv[customDictionaryPosition];
  }
  if (solve) {
    loadDictionary(argv[solvePosition], dictionary);
  }
  printf("Completed in: %ld ms\n", (long)timediff(start, clock()));
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe63(%rip),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
mov    $0x0,%al
call   1040 <clock@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x2,-0x8(%rbp)
jg     11e6 <main+0x66>
mov    $0x0,%al
call   1090 <help@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12d2 <main+0x152>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdff(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    123b <main+0xbb>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1236 <main+0xb6>
movl   $0x1,-0x24(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    123b <main+0xbb>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdc0(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    127d <main+0xfd>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1278 <main+0xf8>
movl   $0x1,-0x28(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    127d <main+0xfd>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd81(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    12bf <main+0x13f>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12ba <main+0x13a>
movl   $0x1,-0x2c(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    12bf <main+0x13f>
jmp    12c4 <main+0x144>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ed <main+0x6d>
cmpl   $0x0,-0x24(%rbp)
je     12ed <main+0x16d>
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1080 <processListOfWordsFile@plt>
cmpl   $0x0,-0x2c(%rbp)
je     1307 <main+0x187>
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0x28(%rbp)
je     1326 <main+0x1a6>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <loadDictionary@plt>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    $0x0,%al
call   1040 <clock@plt>
mov    -0x40(%rbp),%edi
mov    %eax,%esi
call   10a0 <timediff@plt>
mov    %rax,%rsi
lea    0xccd(%rip),%rdi
call   1060 <printf@plt>
lea    0xcd7(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <clock@plt>
mov    %eax,%ebx
cmp    $0x2,%ebp
jg     11b0 <main+0x30>
xor    %eax,%eax
call   1090 <help@plt>
test   %ebp,%ebp
jle    12ad <main+0x12d>
mov    %ebx,0x10(%rsp)
mov    %ebp,%eax
mov    %rax,0x20(%rsp)
mov    %r14,0x18(%rsp)
xor    %r14d,%r14d
movl   $0x0,0xc(%rsp)
xor    %r13d,%r13d
xor    %eax,%eax
xor    %r12d,%r12d
xor    %ebx,%ebx
xor    %r15d,%r15d
nopl   0x0(%rax,%rax,1)
mov    %eax,0x14(%rsp)
mov    0x18(%rsp),%rax
mov    (%rax,%r14,8),%rbp
mov    %rbp,%rdi
lea    0xe14(%rip),%rsi
call   1070 <strcmp@plt>
add    $0x1,%r14
test   %eax,%eax
mov    $0x1,%eax
cmove  %eax,%r15d
cmove  %r14d,%r13d
mov    %rbp,%rdi
lea    0xdf5(%rip),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
mov    $0x1,%eax
cmove  %eax,%ebx
mov    0xc(%rsp),%eax
cmove  %r14d,%eax
mov    %eax,0xc(%rsp)
mov    %rbp,%rdi
lea    0xdd3(%rip),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
mov    0x14(%rsp),%eax
mov    $0x1,%ecx
cmove  %ecx,%eax
cmove  %r14d,%r12d
cmp    %r14,0x20(%rsp)
jne    11e0 <main+0x60>
mov    %r13d,%ecx
mov    %ebx,%r14d
mov    0xc(%rsp),%r13d
test   %r15d,%r15d
mov    0x18(%rsp),%rbp
je     1282 <main+0x102>
mov    %eax,%ebx
movslq %ecx,%rax
mov    0x0(%rbp,%rax,8),%rdi
call   1080 <processListOfWordsFile@plt>
mov    %ebx,%eax
test   %eax,%eax
je     1290 <main+0x110>
movslq %r12d,%rax
mov    0x0(%rbp,%rax,8),%rsi
jmp    1297 <main+0x117>
lea    0xd69(%rip),%rsi
mov    0x10(%rsp),%ebx
test   %r14d,%r14d
je     12ad <main+0x12d>
movslq %r13d,%rax
mov    0x0(%rbp,%rax,8),%rdi
call   1030 <loadDictionary@plt>
xor    %eax,%eax
call   1040 <clock@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   10a0 <timediff@plt>
lea    0xd50(%rip),%rdi
mov    %rax,%rsi
call   1060 <printf@plt>
lea    0xd57(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"short.dict\00"
@.str.1 = [3 x i8] c"/p\00"
@.str.2 = [3 x i8] c"/i\00"
@.str.3 = [3 x i8] c"/d\00"
@.str.4 = [22 x i8] c"Completed in: %ld ms\0A\00"
@.str.5 = [6 x i8] c"pause\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 i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
store i32 0, i32* %13
%15 = call i32 (...) @clock()
store i32 %15, i32* %14
%16 = load i32, i32* %4
%17 = icmp sle i32 %16, 2
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = call i32 (...) @help()
br label %20
20: ; preds = %18, %2
store i32 0, i32* %6
br label %21
21: ; preds = %74, %20
%22 = load i32, i32* %6
%23 = load i32, i32* %4
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %77
25: ; preds = %21
%26 = load i8**, i8*** %5
%27 = load i32, i32* %6
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8*, i8** %26, i64 %28
%30 = load i8*, i8** %29
%31 = call i32 @strcmp(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%32 = icmp ne i32 %31, 0
br i1 %32, label %41, label %33
33: ; preds = %25
%34 = load i32, i32* %6
%35 = load i32, i32* %4
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %40
37: ; preds = %33
store i32 1, i32* %8
%38 = load i32, i32* %6
%39 = add nsw i32 %38, 1
store i32 %39, i32* %11
br label %40
40: ; preds = %37, %33
br label %41
41: ; preds = %40, %25
%42 = load i8**, i8*** %5
%43 = load i32, i32* %6
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8*, i8** %42, i64 %44
%46 = load i8*, i8** %45
%47 = call i32 @strcmp(i8* %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%48 = icmp ne i32 %47, 0
br i1 %48, label %57, label %49
49: ; preds = %41
%50 = load i32, i32* %6
%51 = load i32, i32* %4
%52 = icmp slt i32 %50, %51
br i1 %52, label %53, label %56
53: ; preds = %49
store i32 1, i32* %9
%54 = load i32, i32* %6
%55 = add nsw i32 %54, 1
store i32 %55, i32* %12
br label %56
56: ; preds = %53, %49
br label %57
57: ; preds = %56, %41
%58 = load i8**, i8*** %5
%59 = load i32, i32* %6
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i8*, i8** %58, i64 %60
%62 = load i8*, i8** %61
%63 = call i32 @strcmp(i8* %62, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%64 = icmp ne i32 %63, 0
br i1 %64, label %73, label %65
65: ; preds = %57
%66 = load i32, i32* %6
%67 = load i32, i32* %4
%68 = icmp slt i32 %66, %67
br i1 %68, label %69, label %72
69: ; preds = %65
store i32 1, i32* %10
%70 = load i32, i32* %6
%71 = add nsw i32 %70, 1
store i32 %71, i32* %13
br label %72
72: ; preds = %69, %65
br label %73
73: ; preds = %72, %57
br label %74
74: ; preds = %73
%75 = load i32, i32* %6
%76 = add nsw i32 %75, 1
store i32 %76, i32* %6
br label %21
77: ; preds = %21
%78 = load i32, i32* %8
%79 = icmp ne i32 %78, 0
br i1 %79, label %80, label %87
80: ; preds = %77
%81 = load i8**, i8*** %5
%82 = load i32, i32* %11
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds i8*, i8** %81, i64 %83
%85 = load i8*, i8** %84
%86 = call i32 @processListOfWordsFile(i8* %85)
br label %87
87: ; preds = %80, %77
%88 = load i32, i32* %10
%89 = icmp ne i32 %88, 0
br i1 %89, label %90, label %96
90: ; preds = %87
%91 = load i8**, i8*** %5
%92 = load i32, i32* %13
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i8*, i8** %91, i64 %93
%95 = load i8*, i8** %94
store i8* %95, i8** %7
br label %96
96: ; preds = %90, %87
%97 = load i32, i32* %9
%98 = icmp ne i32 %97, 0
br i1 %98, label %99, label %107
99: ; preds = %96
%100 = load i8**, i8*** %5
%101 = load i32, i32* %12
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds i8*, i8** %100, i64 %102
%104 = load i8*, i8** %103
%105 = load i8*, i8** %7
%106 = call i32 @loadDictionary(i8* %104, i8* %105)
br label %107
107: ; preds = %99, %96
%108 = load i32, i32* %14
%109 = call i32 (...) @clock()
%110 = call i64 @timediff(i32 %108, i32 %109)
%111 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i64 %110)
%112 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"short.dict\00"
@.str.1 = [3 x i8] c"/p\00"
@.str.2 = [3 x i8] c"/i\00"
@.str.3 = [3 x i8] c"/d\00"
@.str.4 = [22 x i8] c"Completed in: %ld ms\0A\00"
@.str.5 = [6 x i8] c"pause\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @clock()
%4 = icmp slt i32 %0, 3
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 (...) @help()
%7 = icmp sgt i32 %0, 0
br i1 %7, label %8, label %56
8: ; preds = %2, %5
%9 = zext i32 %0 to i64
br label %10
10: ; preds = %8, %10
%11 = phi i64 [ 0, %8 ], [ %22, %10 ]
%12 = phi i32 [ 0, %8 ], [ %33, %10 ]
%13 = phi i32 [ 0, %8 ], [ %29, %10 ]
%14 = phi i32 [ 0, %8 ], [ %25, %10 ]
%15 = phi i32 [ 0, %8 ], [ %32, %10 ]
%16 = phi i32 [ 0, %8 ], [ %28, %10 ]
%17 = phi i32 [ 0, %8 ], [ %23, %10 ]
%18 = getelementptr inbounds i8*, i8** %1, i64 %11
%19 = load i8*, i8** %18
%20 = tail call i32 @strcmp(i8* dereferenceable(1) %19, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp eq i32 %20, 0
%22 = add nuw nsw i64 %11, 1
%23 = select i1 %21, i32 1, i32 %17
%24 = trunc i64 %22 to i32
%25 = select i1 %21, i32 %24, i32 %14
%26 = tail call i32 @strcmp(i8* dereferenceable(1) %19, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%27 = icmp eq i32 %26, 0
%28 = select i1 %27, i32 1, i32 %16
%29 = select i1 %27, i32 %24, i32 %13
%30 = tail call i32 @strcmp(i8* dereferenceable(1) %19, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%31 = icmp eq i32 %30, 0
%32 = select i1 %31, i32 1, i32 %15
%33 = select i1 %31, i32 %24, i32 %12
%34 = icmp eq i64 %22, %9
br i1 %34, label %35, label %10
35: ; preds = %10
%36 = icmp eq i32 %23, 0
%37 = sext i32 %33 to i64
%38 = sext i32 %29 to i64
br i1 %36, label %44, label %39
39: ; preds = %35
%40 = sext i32 %25 to i64
%41 = getelementptr inbounds i8*, i8** %1, i64 %40
%42 = load i8*, i8** %41
%43 = tail call i32 @processListOfWordsFile(i8* %42)
br label %44
44: ; preds = %39, %35
%45 = icmp eq i32 %32, 0
br i1 %45, label %49, label %46
46: ; preds = %44
%47 = getelementptr inbounds i8*, i8** %1, i64 %37
%48 = load i8*, i8** %47
br label %49
49: ; preds = %46, %44
%50 = phi i8* [ %48, %46 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %44 ]
%51 = icmp eq i32 %28, 0
br i1 %51, label %56, label %52
52: ; preds = %49
%53 = getelementptr inbounds i8*, i8** %1, i64 %38
%54 = load i8*, i8** %53
%55 = tail call i32 @loadDictionary(i8* %54, i8* %50)
br label %56
56: ; preds = %5, %52, %49
%57 = tail call i32 (...) @clock()
%58 = tail call i64 @timediff(i32 %3, i32 %57)
%59 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i64 %58)
%60 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}