#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int getopt(int, char **, char *);
char *optarg;
int optind;
int /*<<< orphan*/ print_version();
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ *stdin;
int strlen(char *);
int /*<<< orphan*/ tm_init(char *, char *);
int /*<<< orphan*/ tm_lookup(char *, char *, unsigned char);
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  int ch;
  char *init_type = NULL;
  char *db_file = NULL, *lookup_file = NULL;
  unsigned char flags = 0;
  while ((ch = getopt(argc, argv, "ef:i:qV")) > 0) {
    switch (ch) {
    case 'e':
      flags |= 0x02;
      break;
    case 'f':
      lookup_file = optarg;
      break;
    case 'i':
      init_type = optarg;
      break;
    case 'q':
      flags |= 0x01;
      break;
    case 'V':
      print_version();
      exit(0);
    default:
      usage();
    }
  }
  if (optind + 1 > argc) {
    fprintf(stderr, "Error: You must provide a location\n");
    usage();
  }
  db_file = argv[optind++];
  if (init_type != NULL) {
    if (lookup_file != NULL) {
      fprintf(stderr, "'-f' flag can't be used with '-i'\n");
      usage();
    }
    if (flags & 0x01) {
      fprintf(stderr, "'-q' flag can't be used with '-i'\n");
      usage();
    }
    if (flags & 0x02) {
      fprintf(stderr, "'-e' flag can't be used with '-i'\n");
      usage();
    }
    tm_init(db_file, init_type);
  } else {
    if (optind < argc) {
      if ((optind + 1 < argc) && (flags & 0x01)) {
        fprintf(stderr,
                "Error: Only one hash can be given with quick option\n");
        exit(1);
      }
      if ((flags & 0x02) && (flags & 0x01)) {
        fprintf(stderr, "'-e' flag can't be used with '-q'\n");
        usage();
      }
      if (lookup_file != NULL) {
        fprintf(stderr, "Error: -f can't be used when hashes are also given\n");
        exit(1);
      }
      while (optind < argc) {
        tm_lookup(db_file, argv[optind++], flags);
      }
    } else {
      char buf[100];
      FILE *handle;
      if (lookup_file != NULL) {
        handle = fopen(lookup_file, "r");
        if (!handle) {
          fprintf(stderr, "Error opening hash file: %s\n", lookup_file);
          exit(1);
        }
      } else {
        handle = stdin;
      }
      while (1) {
        if (NULL == fgets(buf, 100, handle)) {
          break;
        }
        buf[strlen(buf) - 1] = '\0';
        tm_lookup(db_file, buf, flags);
        if (flags & 0x01)
          break;
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movb   $0x0,-0x31(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe8d(%rip),%rdx
call   10b0 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jle    1281 <main+0xe1>
mov    -0x14(%rbp),%eax
add    $0xffffffaa,%eax
mov    %eax,%ecx
mov    %rcx,-0xb0(%rbp)
sub    $0x1b,%eax
ja     1275 <main+0xd5>
mov    -0xb0(%rbp),%rax
lea    0xde6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movzbl -0x31(%rbp),%eax
or     $0x2,%eax
mov    %al,-0x31(%rbp)
jmp    127c <main+0xdc>
mov    0x2dbf(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
jmp    127c <main+0xdc>
mov    0x2dac(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    127c <main+0xdc>
movzbl -0x31(%rbp),%eax
or     $0x1,%eax
mov    %al,-0x31(%rbp)
jmp    127c <main+0xdc>
mov    $0x0,%al
call   1040 <print_version@plt>
xor    %edi,%edi
call   10c0 <exit@plt>
mov    $0x0,%al
call   1090 <usage@plt>
jmp    11d5 <main+0x35>
mov    0x2d50(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
cmp    -0x8(%rbp),%eax
jle    12b4 <main+0x114>
mov    0x2d2b(%rip),%rax
mov    (%rax),%edi
lea    0xdd2(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x0,%al
call   1090 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x2d19(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    0x2d0b(%rip),%rdx
mov    %esi,(%rdx)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     137c <main+0x1dc>
cmpq   $0x0,-0x30(%rbp)
je     130e <main+0x16e>
mov    0x2cd1(%rip),%rax
mov    (%rax),%edi
lea    0xd9c(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x0,%al
call   1090 <usage@plt>
movzbl -0x31(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     133c <main+0x19c>
mov    0x2ca3(%rip),%rax
mov    (%rax),%edi
lea    0xd91(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x0,%al
call   1090 <usage@plt>
movzbl -0x31(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     136a <main+0x1ca>
mov    0x2c75(%rip),%rax
mov    (%rax),%edi
lea    0xd86(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x0,%al
call   1090 <usage@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <tm_init@plt>
jmp    157a <main+0x3da>
mov    0x2c55(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jge    148e <main+0x2ee>
mov    0x2c43(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
cmp    -0x8(%rbp),%eax
jge    13d4 <main+0x234>
movzbl -0x31(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     13d4 <main+0x234>
mov    0x2c0e(%rip),%rax
mov    (%rax),%edi
lea    0xd42(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
movzbl -0x31(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1412 <main+0x272>
movzbl -0x31(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1412 <main+0x272>
mov    0x2bcd(%rip),%rax
mov    (%rax),%edi
lea    0xd36(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x0,%al
call   1090 <usage@plt>
cmpq   $0x0,-0x30(%rbp)
je     143e <main+0x29e>
mov    0x2ba4(%rip),%rax
mov    (%rax),%edi
lea    0xd30(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
jmp    1443 <main+0x2a3>
mov    0x2b8e(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jge    1489 <main+0x2e9>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x2b74(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    0x2b66(%rip),%rdx
mov    %esi,(%rdx)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
movzbl -0x31(%rbp),%edx
call   1050 <tm_lookup@plt>
jmp    1443 <main+0x2a3>
jmp    1575 <main+0x3d5>
cmpq   $0x0,-0x30(%rbp)
je     14e8 <main+0x348>
mov    -0x30(%rbp),%rdi
lea    0xced(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0xa8(%rbp)
cmpq   $0x0,-0xa8(%rbp)
jne    14e3 <main+0x343>
mov    0x2b03(%rip),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rdx
lea    0xcc1(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
jmp    14f9 <main+0x359>
mov    0x2af1(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0xa8(%rbp)
jmp    14fe <main+0x35e>
lea    -0xa0(%rbp),%rdi
mov    -0xa8(%rbp),%rdx
mov    $0x64,%esi
call   1070 <fgets@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1529 <main+0x389>
jmp    1570 <main+0x3d0>
lea    -0xa0(%rbp),%rdi
call   1060 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0xa0(%rbp,%rax,1)
mov    -0x28(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
movzbl -0x31(%rbp),%edx
call   1050 <tm_lookup@plt>
movzbl -0x31(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     156b <main+0x3cb>
jmp    1570 <main+0x3d0>
jmp    14fe <main+0x35e>
jmp    1575 <main+0x3d5>
jmp    157a <main+0x3da>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rsi,%r12
mov    %edi,%ebp
lea    0xeb6(%rip),%rdx
call   10b0 <getopt@plt>
test   %eax,%eax
jle    123e <main+0x9e>
lea    0xea6(%rip),%r14
lea    0xe2f(%rip),%rbx
xor    %r13d,%r13d
xor    %ecx,%ecx
mov    %rcx,0x8(%rsp)
xor    %r15d,%r15d
jmp    1201 <main+0x61>
or     $0x1,%r13b
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%edi
mov    %r12,%rsi
mov    %r14,%rdx
call   10b0 <getopt@plt>
test   %eax,%eax
jle    124b <main+0xab>
add    $0xffffffaa,%eax
cmp    $0x1b,%eax
ja     1235 <main+0x95>
movslq (%rbx,%rax,4),%rax
add    %rbx,%rax
jmp    *%rax
or     $0x2,%r13b
jmp    11f0 <main+0x50>
mov    0x2dd9(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x8(%rsp)
jmp    11f0 <main+0x50>
mov    0x2dc8(%rip),%rax
mov    (%rax),%r15
jmp    11f0 <main+0x50>
xor    %eax,%eax
call   1090 <usage@plt>
jmp    11f0 <main+0x50>
xor    %r15d,%r15d
xor    %eax,%eax
mov    %rax,0x8(%rsp)
xor    %r13d,%r13d
mov    0x2d86(%rip),%rbx
mov    (%rbx),%eax
cmp    %ebp,%eax
jl     1278 <main+0xd8>
mov    0x2d69(%rip),%rax
mov    (%rax),%edi
lea    0xe10(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
xor    %eax,%eax
call   1090 <usage@plt>
mov    (%rbx),%eax
lea    0x1(%rax),%ecx
mov    %ecx,(%rbx)
movslq %eax,%rdx
mov    (%r12,%rdx,8),%r14
test   %r15,%r15
je     1317 <main+0x177>
cmpq   $0x0,0x8(%rsp)
je     12b3 <main+0x113>
mov    0x2d2c(%rip),%rax
mov    (%rax),%edi
lea    0xdf7(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
xor    %eax,%eax
call   1090 <usage@plt>
test   $0x1,%r13b
je     12d7 <main+0x137>
mov    0x2d08(%rip),%rax
mov    (%rax),%edi
lea    0xdf6(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
xor    %eax,%eax
call   1090 <usage@plt>
test   $0x2,%r13b
je     12fb <main+0x15b>
mov    0x2ce4(%rip),%rax
mov    (%rax),%edi
lea    0xdf5(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
xor    %eax,%eax
call   1090 <usage@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <tm_init@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
cmp    %ebp,%ecx
jge    1391 <main+0x1f1>
add    $0x2,%eax
cmp    %ebp,%eax
jge    132d <main+0x18d>
mov    %r13d,%eax
and    $0x1,%al
jne    143d <main+0x29d>
mov    %r13d,%eax
not    %al
test   $0x3,%al
jne    1354 <main+0x1b4>
mov    0x2c8b(%rip),%rax
mov    (%rax),%edi
lea    0xdf4(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
xor    %eax,%eax
call   1090 <usage@plt>
cmpq   $0x0,0x8(%rsp)
jne    144f <main+0x2af>
mov    (%rbx),%eax
cmp    %ebp,%eax
jge    1306 <main+0x166>
movzbl %r13b,%r15d
nopw   0x0(%rax,%rax,1)
lea    0x1(%rax),%ecx
mov    %ecx,(%rbx)
cltq
mov    (%r12,%rax,8),%rsi
mov    %r14,%rdi
mov    %r15d,%edx
call   1050 <tm_lookup@plt>
mov    (%rbx),%eax
cmp    %ebp,%eax
jl     1370 <main+0x1d0>
jmp    1306 <main+0x166>
mov    0x8(%rsp),%rbx
test   %rbx,%rbx
je     13d6 <main+0x236>
lea    0xdef(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <fopen@plt>
mov    %rax,%r15
test   %rax,%rax
jne    13e0 <main+0x240>
mov    0x2c0f(%rip),%rax
mov    (%rax),%edi
lea    0xdd1(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    0x2c03(%rip),%rax
mov    (%rax),%r15
lea    0x10(%rsp),%rbp
movzbl %r13b,%ebx
nopl   0x0(%rax)
mov    %rbp,%rdi
mov    $0x64,%esi
mov    %r15,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     1306 <main+0x166>
mov    %rbp,%rdi
call   1060 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbp,1)
mov    %r14,%rdi
mov    %rbp,%rsi
mov    %ebx,%edx
call   1050 <tm_lookup@plt>
test   $0x1,%bl
je     13f0 <main+0x250>
jmp    1306 <main+0x166>
xor    %eax,%eax
call   1040 <print_version@plt>
xor    %edi,%edi
call   10c0 <exit@plt>
mov    0x2b84(%rip),%rax
mov    (%rax),%edi
lea    0xcb8(%rip),%rsi
jmp    145f <main+0x2bf>
mov    0x2b72(%rip),%rax
mov    (%rax),%edi
lea    0xcfe(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"ef:i:qV\00"
@optarg = global i8* null
@optind = global i32 0
@stderr = global i32 0
@.str.1 = [36 x i8] c"Error: You must provide a location\0A\00"
@.str.2 = [35 x i8] c"'-f' flag can't be used with '-i'\0A\00"
@.str.3 = [35 x i8] c"'-q' flag can't be used with '-i'\0A\00"
@.str.4 = [35 x i8] c"'-e' flag can't be used with '-i'\0A\00"
@.str.5 = [53 x i8] c"Error: Only one hash can be given with quick option\0A\00"
@.str.6 = [35 x i8] c"'-e' flag can't be used with '-q'\0A\00"
@.str.7 = [52 x i8] c"Error: -f can't be used when hashes are also given\0A\00"
@.str.8 = [2 x i8] c"r\00"
@.str.9 = [29 x i8] c"Error opening hash file: %s\0A\00"
@stdin = global i32* null
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*
%9 = alloca i8*
%10 = alloca i8
%11 = alloca [100 x i8]
%12 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %7
store i8* null, i8** %8
store i8* null, i8** %9
store i8 0, i8* %10
br label %13
13: ; preds = %39, %2
%14 = load i32, i32* %4
%15 = load i8**, i8*** %5
%16 = call i32 @getopt(i32 %14, i8** %15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 %16, i32* %6
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %40
18: ; preds = %13
%19 = load i32, i32* %6
switch i32 %19, label %37 [
i32 101, label %20
i32 102, label %25
i32 105, label %27
i32 113, label %29
i32 86, label %34
]
20: ; preds = %18
%21 = load i8, i8* %10
%22 = zext i8 %21 to i32
%23 = or i32 %22, 2
%24 = trunc i32 %23 to i8
store i8 %24, i8* %10
br label %39
25: ; preds = %18
%26 = load i8*, i8** @optarg
store i8* %26, i8** %9
br label %39
27: ; preds = %18
%28 = load i8*, i8** @optarg
store i8* %28, i8** %7
br label %39
29: ; preds = %18
%30 = load i8, i8* %10
%31 = zext i8 %30 to i32
%32 = or i32 %31, 1
%33 = trunc i32 %32 to i8
store i8 %33, i8* %10
br label %39
34: ; preds = %18
%35 = call i32 (...) @print_version()
%36 = call i32 @exit(i32 0)
unreachable
37: ; preds = %18
%38 = call i32 (...) @usage()
br label %39
39: ; preds = %37, %29, %27, %25, %20
br label %13
40: ; preds = %13
%41 = load i32, i32* @optind
%42 = add nsw i32 %41, 1
%43 = load i32, i32* %4
%44 = icmp sgt i32 %42, %43
br i1 %44, label %45, label %49
45: ; preds = %40
%46 = load i32, i32* @stderr
%47 = call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%48 = call i32 (...) @usage()
br label %49
49: ; preds = %45, %40
%50 = load i8**, i8*** %5
%51 = load i32, i32* @optind
%52 = add nsw i32 %51, 1
store i32 %52, i32* @optind
%53 = sext i32 %51 to i64
%54 = getelementptr inbounds i8*, i8** %50, i64 %53
%55 = load i8*, i8** %54
store i8* %55, i8** %8
%56 = load i8*, i8** %7
%57 = icmp ne i8* %56, null
br i1 %57, label %58, label %87
58: ; preds = %49
%59 = load i8*, i8** %9
%60 = icmp ne i8* %59, null
br i1 %60, label %61, label %65
61: ; preds = %58
%62 = load i32, i32* @stderr
%63 = call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%64 = call i32 (...) @usage()
br label %65
65: ; preds = %61, %58
%66 = load i8, i8* %10
%67 = zext i8 %66 to i32
%68 = and i32 %67, 1
%69 = icmp ne i32 %68, 0
br i1 %69, label %70, label %74
70: ; preds = %65
%71 = load i32, i32* @stderr
%72 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
%73 = call i32 (...) @usage()
br label %74
74: ; preds = %70, %65
%75 = load i8, i8* %10
%76 = zext i8 %75 to i32
%77 = and i32 %76, 2
%78 = icmp ne i32 %77, 0
br i1 %78, label %79, label %83
79: ; preds = %74
%80 = load i32, i32* @stderr
%81 = call i32 (i32, i8*, ...) @fprintf(i32 %80, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
%82 = call i32 (...) @usage()
br label %83
83: ; preds = %79, %74
%84 = load i8*, i8** %8
%85 = load i8*, i8** %7
%86 = call i32 @tm_init(i8* %84, i8* %85)
br label %183
87: ; preds = %49
%88 = load i32, i32* @optind
%89 = load i32, i32* %4
%90 = icmp slt i32 %88, %89
br i1 %90, label %91, label %142
91: ; preds = %87
%92 = load i32, i32* @optind
%93 = add nsw i32 %92, 1
%94 = load i32, i32* %4
%95 = icmp slt i32 %93, %94
br i1 %95, label %96, label %105
96: ; preds = %91
%97 = load i8, i8* %10
%98 = zext i8 %97 to i32
%99 = and i32 %98, 1
%100 = icmp ne i32 %99, 0
br i1 %100, label %101, label %105
101: ; preds = %96
%102 = load i32, i32* @stderr
%103 = call i32 (i32, i8*, ...) @fprintf(i32 %102, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.5, i64 0, i64 0))
%104 = call i32 @exit(i32 1)
unreachable
105: ; preds = %96, %91
%106 = load i8, i8* %10
%107 = zext i8 %106 to i32
%108 = and i32 %107, 2
%109 = icmp ne i32 %108, 0
br i1 %109, label %110, label %119
110: ; preds = %105
%111 = load i8, i8* %10
%112 = zext i8 %111 to i32
%113 = and i32 %112, 1
%114 = icmp ne i32 %113, 0
br i1 %114, label %115, label %119
115: ; preds = %110
%116 = load i32, i32* @stderr
%117 = call i32 (i32, i8*, ...) @fprintf(i32 %116, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0))
%118 = call i32 (...) @usage()
br label %119
119: ; preds = %115, %110, %105
%120 = load i8*, i8** %9
%121 = icmp ne i8* %120, null
br i1 %121, label %122, label %126
122: ; preds = %119
%123 = load i32, i32* @stderr
%124 = call i32 (i32, i8*, ...) @fprintf(i32 %123, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0))
%125 = call i32 @exit(i32 1)
unreachable
126: ; preds = %119
br label %127
127: ; preds = %131, %126
%128 = load i32, i32* @optind
%129 = load i32, i32* %4
%130 = icmp slt i32 %128, %129
br i1 %130, label %131, label %141
131: ; preds = %127
%132 = load i8*, i8** %8
%133 = load i8**, i8*** %5
%134 = load i32, i32* @optind
%135 = add nsw i32 %134, 1
store i32 %135, i32* @optind
%136 = sext i32 %134 to i64
%137 = getelementptr inbounds i8*, i8** %133, i64 %136
%138 = load i8*, i8** %137
%139 = load i8, i8* %10
%140 = call i32 @tm_lookup(i8* %132, i8* %138, i8 zeroext %139)
br label %127
141: ; preds = %127
br label %182
142: ; preds = %87
%143 = load i8*, i8** %9
%144 = icmp ne i8* %143, null
br i1 %144, label %145, label %156
145: ; preds = %142
%146 = load i8*, i8** %9
%147 = call i32* @fopen(i8* %146, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
store i32* %147, i32** %12
%148 = load i32*, i32** %12
%149 = icmp ne i32* %148, null
br i1 %149, label %155, label %150
150: ; preds = %145
%151 = load i32, i32* @stderr
%152 = load i8*, i8** %9
%153 = call i32 (i32, i8*, ...) @fprintf(i32 %151, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.9, i64 0, i64 0), i8* %152)
%154 = call i32 @exit(i32 1)
unreachable
155: ; preds = %145
br label %158
156: ; preds = %142
%157 = load i32*, i32** @stdin
store i32* %157, i32** %12
br label %158
158: ; preds = %156, %155
br label %159
159: ; preds = %158, %180
%160 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%161 = load i32*, i32** %12
%162 = call i32* @fgets(i8* %160, i32 100, i32* %161)
%163 = icmp eq i32* null, %162
br i1 %163, label %164, label %165
164: ; preds = %159
br label %181
165: ; preds = %159
%166 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%167 = call i32 @strlen(i8* %166)
%168 = sub nsw i32 %167, 1
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 %169
store i8 0, i8* %170
%171 = load i8*, i8** %8
%172 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%173 = load i8, i8* %10
%174 = call i32 @tm_lookup(i8* %171, i8* %172, i8 zeroext %173)
%175 = load i8, i8* %10
%176 = zext i8 %175 to i32
%177 = and i32 %176, 1
%178 = icmp ne i32 %177, 0
br i1 %178, label %179, label %180
179: ; preds = %165
br label %181
180: ; preds = %165
br label %159
181: ; preds = %179, %164
br label %182
182: ; preds = %181, %141
br label %183
183: ; preds = %182, %83
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"ef:i:qV\00"
@optarg = global i8* null
@optind = global i32 0
@stderr = global i32 0
@.str.1 = [36 x i8] c"Error: You must provide a location\0A\00"
@.str.2 = [35 x i8] c"'-f' flag can't be used with '-i'\0A\00"
@.str.3 = [35 x i8] c"'-q' flag can't be used with '-i'\0A\00"
@.str.4 = [35 x i8] c"'-e' flag can't be used with '-i'\0A\00"
@.str.5 = [53 x i8] c"Error: Only one hash can be given with quick option\0A\00"
@.str.6 = [35 x i8] c"'-e' flag can't be used with '-q'\0A\00"
@.str.7 = [52 x i8] c"Error: -f can't be used when hashes are also given\0A\00"
@.str.8 = [2 x i8] c"r\00"
@.str.9 = [29 x i8] c"Error opening hash file: %s\0A\00"
@stdin = global i32* null
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [100 x i8]
%4 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %30
6: ; preds = %2, %24
%7 = phi i32 [ %28, %24 ], [ %4, %2 ]
%8 = phi i8 [ %27, %24 ], [ 0, %2 ]
%9 = phi i8* [ %26, %24 ], [ null, %2 ]
%10 = phi i8* [ %25, %24 ], [ null, %2 ]
switch i32 %7, label %22 [
i32 101, label %11
i32 102, label %13
i32 105, label %15
i32 113, label %17
i32 86, label %19
]
11: ; preds = %6
%12 = or i8 %8, 2
br label %24
13: ; preds = %6
%14 = load i8*, i8** @optarg
br label %24
15: ; preds = %6
%16 = load i8*, i8** @optarg
br label %24
17: ; preds = %6
%18 = or i8 %8, 1
br label %24
19: ; preds = %6
%20 = tail call i32 (...) @print_version()
%21 = tail call i32 @exit(i32 0)
unreachable
22: ; preds = %6
%23 = tail call i32 (...) @usage()
br label %24
24: ; preds = %22, %17, %15, %13, %11
%25 = phi i8* [ %10, %22 ], [ %10, %17 ], [ %16, %15 ], [ %10, %13 ], [ %10, %11 ]
%26 = phi i8* [ %9, %22 ], [ %9, %17 ], [ %9, %15 ], [ %14, %13 ], [ %9, %11 ]
%27 = phi i8 [ %8, %22 ], [ %18, %17 ], [ %8, %15 ], [ %8, %13 ], [ %12, %11 ]
%28 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%29 = icmp sgt i32 %28, 0
br i1 %29, label %6, label %30
30: ; preds = %24, %2
%31 = phi i8* [ null, %2 ], [ %25, %24 ]
%32 = phi i8* [ null, %2 ], [ %26, %24 ]
%33 = phi i8 [ 0, %2 ], [ %27, %24 ]
%34 = load i32, i32* @optind
%35 = icmp slt i32 %34, %0
br i1 %35, label %41, label %36
36: ; preds = %30
%37 = load i32, i32* @stderr
%38 = tail call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%39 = tail call i32 (...) @usage()
%40 = load i32, i32* @optind
br label %41
41: ; preds = %36, %30
%42 = phi i32 [ %40, %36 ], [ %34, %30 ]
%43 = add nsw i32 %42, 1
store i32 %43, i32* @optind
%44 = sext i32 %42 to i64
%45 = getelementptr inbounds i8*, i8** %1, i64 %44
%46 = load i8*, i8** %45
%47 = icmp eq i8* %31, null
br i1 %47, label %71, label %48
48: ; preds = %41
%49 = icmp eq i8* %32, null
br i1 %49, label %54, label %50
50: ; preds = %48
%51 = load i32, i32* @stderr
%52 = tail call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%53 = tail call i32 (...) @usage()
br label %54
54: ; preds = %50, %48
%55 = zext i8 %33 to i32
%56 = and i32 %55, 1
%57 = icmp eq i32 %56, 0
br i1 %57, label %62, label %58
58: ; preds = %54
%59 = load i32, i32* @stderr
%60 = tail call i32 (i32, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
%61 = tail call i32 (...) @usage()
br label %62
62: ; preds = %58, %54
%63 = and i32 %55, 2
%64 = icmp eq i32 %63, 0
br i1 %64, label %69, label %65
65: ; preds = %62
%66 = load i32, i32* @stderr
%67 = tail call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
%68 = tail call i32 (...) @usage()
br label %69
69: ; preds = %65, %62
%70 = tail call i32 @tm_init(i8* %46, i8* %31)
br label %134
71: ; preds = %41
%72 = icmp slt i32 %43, %0
br i1 %72, label %73, label %108
73: ; preds = %71
%74 = add nsw i32 %42, 2
%75 = icmp sge i32 %74, %0
%76 = and i8 %33, 1
%77 = icmp eq i8 %76, 0
%78 = select i1 %75, i1 true, i1 %77
br i1 %78, label %83, label %79
79: ; preds = %73
%80 = load i32, i32* @stderr
%81 = tail call i32 (i32, i8*, ...) @fprintf(i32 %80, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.5, i64 0, i64 0))
%82 = tail call i32 @exit(i32 1)
unreachable
83: ; preds = %73
%84 = and i8 %33, 3
%85 = icmp eq i8 %84, 3
br i1 %85, label %86, label %90
86: ; preds = %83
%87 = load i32, i32* @stderr
%88 = tail call i32 (i32, i8*, ...) @fprintf(i32 %87, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0))
%89 = tail call i32 (...) @usage()
br label %90
90: ; preds = %86, %83
%91 = icmp eq i8* %32, null
br i1 %91, label %92, label %95
92: ; preds = %90
%93 = load i32, i32* @optind
%94 = icmp slt i32 %93, %0
br i1 %94, label %99, label %134
95: ; preds = %90
%96 = load i32, i32* @stderr
%97 = tail call i32 (i32, i8*, ...) @fprintf(i32 %96, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0))
%98 = tail call i32 @exit(i32 1)
unreachable
99: ; preds = %92, %99
%100 = phi i32 [ %106, %99 ], [ %93, %92 ]
%101 = add nsw i32 %100, 1
store i32 %101, i32* @optind
%102 = sext i32 %100 to i64
%103 = getelementptr inbounds i8*, i8** %1, i64 %102
%104 = load i8*, i8** %103
%105 = tail call i32 @tm_lookup(i8* %46, i8* %104, i8 zeroext %33)
%106 = load i32, i32* @optind
%107 = icmp slt i32 %106, %0
br i1 %107, label %99, label %134
108: ; preds = %71
%109 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%110 = icmp eq i8* %32, null
br i1 %110, label %118, label %111
111: ; preds = %108
%112 = tail call i32* @fopen(i8* %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%113 = icmp eq i32* %112, null
br i1 %113, label %114, label %120
114: ; preds = %111
%115 = load i32, i32* @stderr
%116 = tail call i32 (i32, i8*, ...) @fprintf(i32 %115, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.9, i64 0, i64 0), i8* %32)
%117 = tail call i32 @exit(i32 1)
unreachable
118: ; preds = %108
%119 = load i32*, i32** @stdin
br label %120
120: ; preds = %111, %118
%121 = phi i32* [ %112, %111 ], [ %119, %118 ]
%122 = and i8 %33, 1
%123 = icmp eq i8 %122, 0
br label %124
124: ; preds = %127, %120
%125 = call i32* @fgets(i8* %109, i32 100, i32* %121)
%126 = icmp eq i32* %125, null
br i1 %126, label %133, label %127
127: ; preds = %124
%128 = call i32 @strlen(i8* %109)
%129 = add nsw i32 %128, -1
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %130
store i8 0, i8* %131
%132 = call i32 @tm_lookup(i8* %46, i8* %109, i8 zeroext %33)
br i1 %123, label %124, label %133
133: ; preds = %127, %124
br label %134
134: ; preds = %99, %92, %133, %69
ret i32 0
}