#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 */
struct option {
  char *member_0;
  int member_1;
  char member_3;
  int /*<<< orphan*/ *member_2;
};

/* Variables and functions */
int compare(char *, char *, char *, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int getopt_long(int, char **, char const *const, struct option const *,
                int /*<<< orphan*/ *);
scalar_t__ malloc(int);
char *optarg;
int optind;
int /*<<< orphan*/ show_usage(int /*<<< orphan*/, int, char *);
int /*<<< orphan*/ show_version(int /*<<< orphan*/, int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int strlen(char *);
int /*<<< orphan*/ strncat(char *, char *, int);
int main(int argc, char *argv[]) {
  char *dictionary = NULL;
  char *salt = NULL;
  bool verbose = false;
  int next_option;
  const char *const short_options = "hVn:Dd:v";
  const struct option long_options[] = {{"help", 0, NULL, 'h'},
                                        {"version", 0, NULL, 'V'},
                                        {"dictionary", 1, NULL, 'd'},
                                        {"verbose", 0, NULL, 'v'},
                                        {NULL, 0, NULL, 0}};
  do {
    next_option = getopt_long(argc, argv, short_options, long_options, NULL);
    switch (next_option) {
    case 'h':
      show_usage(stdout, 0, argv[0]);
      break;
    case 'V':
      show_version(stdout, 0, argv[0]);
      break;
    case 'd':
      dictionary = (char *)malloc(sizeof(char) * strlen(optarg));
      dictionary = optarg;
      break;
    case 'v':
      verbose = true;
      break;
    case -1:
      break;
    default:
      show_usage(stdout, 1, argv[0]);
    }
  } while (next_option != -1);
  if (dictionary == NULL) {
    show_usage(stdout, 1, argv[0]);
  }
  if (optind != argc) {
    salt = (char *)malloc(sizeof(char) * 2);
    strncat(salt, argv[optind], 2);
    if (compare(argv[optind], salt, dictionary, verbose) == false) {
      return false;
    }
    if (verbose) {
      fprintf(stdout, "Word not found :-(\n");
    }
    return true;
  } else {
    show_usage(stdout, 1, argv[0]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
lea    0xe39(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    -0xb0(%rbp),%rdi
lea    0x2bb7(%rip),%rsi
mov    $0x78,%edx
call   1080 <memcpy@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe0f(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r8d
lea    -0xb0(%rbp),%rcx
call   1050 <getopt_long@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0xb4(%rbp)
sub    $0xffffffff,%eax
je     12e3 <main+0x153>
jmp    121c <main+0x8c>
mov    -0xb4(%rbp),%eax
sub    $0x56,%eax
je     1288 <main+0xf8>
jmp    1230 <main+0xa0>
mov    -0xb4(%rbp),%eax
sub    $0x64,%eax
je     12a4 <main+0x114>
jmp    1244 <main+0xb4>
mov    -0xb4(%rbp),%eax
sub    $0x68,%eax
je     126c <main+0xdc>
jmp    1258 <main+0xc8>
mov    -0xb4(%rbp),%eax
sub    $0x76,%eax
je     12d7 <main+0x147>
jmp    12e8 <main+0x158>
mov    0x2d5d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
xor    %esi,%esi
call   10a0 <show_usage@plt>
jmp    1302 <main+0x172>
mov    0x2d41(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
xor    %esi,%esi
call   1030 <show_version@plt>
jmp    1302 <main+0x172>
mov    0x2d4d(%rip),%rax
mov    (%rax),%rdi
call   1040 <strlen@plt>
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    0x2d2d(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1302 <main+0x172>
movl   $0x1,-0x24(%rbp)
jmp    1302 <main+0x172>
jmp    1302 <main+0x172>
mov    0x2ce1(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    $0x1,%esi
call   10a0 <show_usage@plt>
jmp    1307 <main+0x177>
cmpl   $0xffffffff,-0x28(%rbp)
jne    11e3 <main+0x53>
cmpq   $0x0,-0x18(%rbp)
jne    1336 <main+0x1a6>
mov    0x2cad(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    $0x1,%esi
call   10a0 <show_usage@plt>
mov    0x2ca3(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
je     13d8 <main+0x248>
mov    $0x2,%edi
call   1090 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x2c7b(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rsi
mov    $0x2,%edx
call   1060 <strncat@plt>
mov    -0x10(%rbp),%rax
mov    0x2c5f(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   10b0 <compare@plt>
cmp    $0x0,%eax
jne    13ad <main+0x21d>
movl   $0x0,-0x4(%rbp)
jmp    13f2 <main+0x262>
cmpl   $0x0,-0x24(%rbp)
je     13cc <main+0x23c>
mov    0x2c12(%rip),%rax
mov    (%rax),%edi
lea    0xc62(%rip),%rsi
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13f2 <main+0x262>
mov    0x2bf1(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    $0x1,%esi
call   10a0 <show_usage@plt>
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2c63(%rip),%rax
mov    %rax,0x90(%rsp)
movaps 0x2c44(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0x2c25(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0x2c09(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0x2bed(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0x2bd1(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0x2bb5(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0x2b99(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
xor    %eax,%eax
mov    %rax,0x10(%rsp)
mov    $0x1,%al
mov    %eax,0xc(%rsp)
lea    0xe74(%rip),%r12
lea    0x20(%rsp),%r13
mov    0x2db4(%rip),%r14
lea    0xddd(%rip),%r15
xor    %eax,%eax
mov    %rax,0x18(%rsp)
jmp    123d <main+0xbd>
nopl   0x0(%rax)
mov    (%r14),%edi
mov    (%rbx),%rdx
xor    %esi,%esi
call   1030 <show_version@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
xor    %r8d,%r8d
call   1050 <getopt_long@plt>
lea    -0x56(%rax),%ecx
cmp    $0x20,%ecx
ja     1270 <main+0xf0>
movslq (%r15,%rcx,4),%rax
add    %r15,%rax
jmp    *%rax
mov    (%r14),%edi
mov    (%rbx),%rdx
xor    %esi,%esi
call   1090 <show_usage@plt>
jmp    123d <main+0xbd>
cmp    $0xffffffff,%eax
je     12c5 <main+0x145>
mov    (%r14),%edi
mov    (%rbx),%rdx
mov    $0x1,%esi
call   1090 <show_usage@plt>
jmp    123d <main+0xbd>
mov    0x2d6a(%rip),%rax
mov    (%rax),%rdi
call   1040 <strlen@plt>
mov    %eax,%edi
call   1080 <malloc@plt>
mov    0x2d54(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x18(%rsp)
jmp    123d <main+0xbd>
mov    $0x1,%eax
mov    %rax,0x10(%rsp)
movl   $0x0,0xc(%rsp)
jmp    123d <main+0xbd>
mov    0x18(%rsp),%r12
test   %r12,%r12
jne    12df <main+0x15f>
mov    (%r14),%edi
mov    (%rbx),%rdx
mov    $0x1,%esi
call   1090 <show_usage@plt>
mov    0x2cfa(%rip),%r15
cmp    %ebp,(%r15)
jne    12ff <main+0x17f>
mov    (%r14),%edi
mov    (%rbx),%rdx
mov    $0x1,%esi
call   1090 <show_usage@plt>
xor    %eax,%eax
jmp    1364 <main+0x1e4>
mov    $0x2,%edi
call   1080 <malloc@plt>
mov    %rax,%rbp
movslq (%r15),%rax
mov    (%rbx,%rax,8),%rsi
mov    %rbp,%rdi
mov    $0x2,%edx
call   1060 <strncat@plt>
movslq (%r15),%rax
mov    (%rbx,%rax,8),%rdi
mov    %rbp,%rsi
mov    %r12,%rdx
mov    0x10(%rsp),%rcx
call   10a0 <compare@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %cl
sete   %dl
or     0xc(%rsp),%dl
test   $0x1,%dl
je     1350 <main+0x1d0>
mov    %cl,%al
jmp    1364 <main+0x1e4>
mov    (%r14),%edi
lea    0xd53(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x1,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.option = type { i8*, i32, i8, i32* }
@.str = [9 x i8] c"hVn:Dd:v\00"
@.str.1 = [5 x i8] c"help\00"
@.str.2 = [8 x i8] c"version\00"
@.str.3 = [11 x i8] c"dictionary\00"
@.str.4 = [8 x i8] c"verbose\00"
@__const.main.long_options = [5 x %struct.option] [%struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i32 0, i8 0, i32* inttoptr (i64 104 to i32*) }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0), i32 0, i8 0, i32* inttoptr (i64 86 to i32*) }, %struct.option { i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i32 0, i32 0), i32 1, i8 0, i32* inttoptr (i64 100 to i32*) }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i32 0, i32 0), i32 0, i8 0, i32* inttoptr (i64 118 to i32*) }, %struct.option zeroinitializer]
@stdout = global i32 0
@optarg = global i8* null
@optind = global i32 0
@.str.5 = [20 x i8] c"Word not found :-(\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca [5 x %struct.option]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
store i8* null, i8** %7
store i32 0, i32* %8
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %10
%12 = bitcast [5 x %struct.option]* %11 to i8*
br label %13
13: ; preds = %49, %2
%14 = load i32, i32* %4
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds [5 x %struct.option], [5 x %struct.option]* %11, i64 0, i64 0
%17 = call i32 @getopt_long(i32 %14, i8** %15, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), %struct.option* %16, i32* null)
store i32 %17, i32* %9
%18 = load i32, i32* %9
switch i32 %18, label %42 [
i32 104, label %19
i32 86, label %25
i32 100, label %31
i32 118, label %40
i32 -1, label %41
]
19: ; preds = %13
%20 = load i32, i32* @stdout
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 0
%23 = load i8*, i8** %22
%24 = call i32 @show_usage(i32 %20, i32 0, i8* %23)
br label %48
25: ; preds = %13
%26 = load i32, i32* @stdout
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 0
%29 = load i8*, i8** %28
%30 = call i32 @show_version(i32 %26, i32 0, i8* %29)
br label %48
31: ; preds = %13
%32 = load i8*, i8** @optarg
%33 = call i32 @strlen(i8* %32)
%34 = sext i32 %33 to i64
%35 = mul i64 1, %34
%36 = trunc i64 %35 to i32
%37 = call i64 @malloc(i32 %36)
%38 = inttoptr i64 %37 to i8*
store i8* %38, i8** %6
%39 = load i8*, i8** @optarg
store i8* %39, i8** %6
br label %48
40: ; preds = %13
store i32 1, i32* %8
br label %48
41: ; preds = %13
br label %48
42: ; preds = %13
%43 = load i32, i32* @stdout
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 0
%46 = load i8*, i8** %45
%47 = call i32 @show_usage(i32 %43, i32 1, i8* %46)
br label %48
48: ; preds = %42, %41, %40, %31, %25, %19
br label %49
49: ; preds = %48
%50 = load i32, i32* %9
%51 = icmp ne i32 %50, -1
br i1 %51, label %13, label %52
52: ; preds = %49
%53 = load i8*, i8** %6
%54 = icmp eq i8* %53, null
br i1 %54, label %55, label %61
55: ; preds = %52
%56 = load i32, i32* @stdout
%57 = load i8**, i8*** %5
%58 = getelementptr inbounds i8*, i8** %57, i64 0
%59 = load i8*, i8** %58
%60 = call i32 @show_usage(i32 %56, i32 1, i8* %59)
br label %61
61: ; preds = %55, %52
%62 = load i32, i32* @optind
%63 = load i32, i32* %4
%64 = icmp ne i32 %62, %63
br i1 %64, label %65, label %93
65: ; preds = %61
%66 = call i64 @malloc(i32 2)
%67 = inttoptr i64 %66 to i8*
store i8* %67, i8** %7
%68 = load i8*, i8** %7
%69 = load i8**, i8*** %5
%70 = load i32, i32* @optind
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i8*, i8** %69, i64 %71
%73 = load i8*, i8** %72
%74 = call i32 @strncat(i8* %68, i8* %73, i32 2)
%75 = load i8**, i8*** %5
%76 = load i32, i32* @optind
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i8*, i8** %75, i64 %77
%79 = load i8*, i8** %78
%80 = load i8*, i8** %7
%81 = load i8*, i8** %6
%82 = load i32, i32* %8
%83 = call i32 @compare(i8* %79, i8* %80, i8* %81, i32 %82)
%84 = icmp eq i32 %83, 0
br i1 %84, label %85, label %86
85: ; preds = %65
store i32 0, i32* %3
br label %99
86: ; preds = %65
%87 = load i32, i32* %8
%88 = icmp ne i32 %87, 0
br i1 %88, label %89, label %92
89: ; preds = %86
%90 = load i32, i32* @stdout
%91 = call i32 @fprintf(i32 %90, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
br label %92
92: ; preds = %89, %86
store i32 1, i32* %3
br label %99
93: ; preds = %61
%94 = load i32, i32* @stdout
%95 = load i8**, i8*** %5
%96 = getelementptr inbounds i8*, i8** %95, i64 0
%97 = load i8*, i8** %96
%98 = call i32 @show_usage(i32 %94, i32 1, i8* %97)
br label %99
99: ; preds = %85, %92, %93
%100 = load i32, i32* %3
ret i32 %100
}

LLVM IR (-O2):
%struct.option = type { i8*, i32, i8, i32* }
@.str = [9 x i8] c"hVn:Dd:v\00"
@.str.1 = [5 x i8] c"help\00"
@.str.2 = [8 x i8] c"version\00"
@.str.3 = [11 x i8] c"dictionary\00"
@.str.4 = [8 x i8] c"verbose\00"
@__const.main.long_options = [5 x %struct.option] [%struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i32 0, i8 0, i32* inttoptr (i64 104 to i32*) }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0), i32 0, i8 0, i32* inttoptr (i64 86 to i32*) }, %struct.option { i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i32 0, i32 0), i32 1, i8 0, i32* inttoptr (i64 100 to i32*) }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i32 0, i32 0), i32 0, i8 0, i32* inttoptr (i64 118 to i32*) }, %struct.option zeroinitializer]
@stdout = global i32 0
@optarg = global i8* null
@optind = global i32 0
@.str.5 = [20 x i8] c"Word not found :-(\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [5 x %struct.option]
%4 = bitcast [5 x %struct.option]* %3 to i8*
%5 = getelementptr inbounds [5 x %struct.option], [5 x %struct.option]* %3, i64 0, i64 0
br label %6
6: ; preds = %12, %2
%7 = phi i1 [ true, %2 ], [ false, %12 ]
%8 = phi i32 [ 0, %2 ], [ 1, %12 ]
%9 = phi i8* [ null, %2 ], [ %11, %12 ]
br label %10
10: ; preds = %6, %23
%11 = phi i8* [ %9, %6 ], [ %27, %23 ]
br label %12
12: ; preds = %18, %10
%13 = call i32 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.option* %5, i32* null)
switch i32 %13, label %28 [
i32 104, label %14
i32 86, label %19
i32 100, label %23
i32 118, label %6
i32 -1, label %32
]
14: ; preds = %12
%15 = load i32, i32* @stdout
%16 = load i8*, i8** %1
%17 = call i32 @show_usage(i32 %15, i32 0, i8* %16)
br label %18
18: ; preds = %14, %19, %28
br label %12
19: ; preds = %12
%20 = load i32, i32* @stdout
%21 = load i8*, i8** %1
%22 = call i32 @show_version(i32 %20, i32 0, i8* %21)
br label %18
23: ; preds = %12
%24 = load i8*, i8** @optarg
%25 = call i32 @strlen(i8* %24)
%26 = call i64 @malloc(i32 %25)
%27 = load i8*, i8** @optarg
br label %10
28: ; preds = %12
%29 = load i32, i32* @stdout
%30 = load i8*, i8** %1
%31 = call i32 @show_usage(i32 %29, i32 1, i8* %30)
br label %18
32: ; preds = %12
%33 = icmp eq i8* %11, null
br i1 %33, label %34, label %38
34: ; preds = %32
%35 = load i32, i32* @stdout
%36 = load i8*, i8** %1
%37 = call i32 @show_usage(i32 %35, i32 1, i8* %36)
br label %38
38: ; preds = %34, %32
%39 = load i32, i32* @optind
%40 = icmp eq i32 %39, %0
br i1 %40, label %60, label %41
41: ; preds = %38
%42 = call i64 @malloc(i32 2)
%43 = inttoptr i64 %42 to i8*
%44 = load i32, i32* @optind
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i8*, i8** %1, i64 %45
%47 = load i8*, i8** %46
%48 = call i32 @strncat(i8* %43, i8* %47, i32 2)
%49 = load i32, i32* @optind
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8*, i8** %1, i64 %50
%52 = load i8*, i8** %51
%53 = call i32 @compare(i8* %52, i8* %43, i8* %11, i32 %8)
%54 = icmp eq i32 %53, 0
%55 = or i1 %54, %7
%56 = select i1 %54, i32 0, i32 1
br i1 %55, label %64, label %57
57: ; preds = %41
%58 = load i32, i32* @stdout
%59 = call i32 @fprintf(i32 %58, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
br label %64
60: ; preds = %38
%61 = load i32, i32* @stdout
%62 = load i8*, i8** %1
%63 = call i32 @show_usage(i32 %61, i32 1, i8* %62)
br label %64
64: ; preds = %41, %57, %60
%65 = phi i32 [ 0, %60 ], [ %56, %41 ], [ 1, %57 ]
ret i32 %65
}