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

/* Variables and functions */
int /*<<< orphan*/ batch_process(int /*<<< orphan*/ *);
int /*<<< orphan*/ check_for_db(int /*<<< orphan*/ **, char *, int, int);
int /*<<< orphan*/ export_cowpatty(int /*<<< orphan*/ *, char *, char *);
int getopt_long(int, char **, char *, struct option *, int *);
int /*<<< orphan*/ import_ascii(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ import_cowpatty(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ print_help(char *);
int /*<<< orphan*/ show_stats(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sql_stdout(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ sqlite3_close(int /*<<< orphan*/ *);
int /*<<< orphan*/ strcasecmp(char *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ vacuum(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ verify(int /*<<< orphan*/ *, int);
int main(int argc, char **argv) {
  sqlite3 *db;
  int option_index, option;
  if (argc < 3) {
    print_help(NULL);
    return 1;
  }
  db = NULL;
  option_index = 0;
  static struct option long_options[] = {
      {"batch", 0, 0, 'b'},  {"clean", 2, 0, 'c'},  {"export", 2, 0, 'e'},
      {"h", 0, 0, 'h'},      {"help", 0, 0, 'h'},   {"import", 2, 0, 'i'},
      {"sql", 1, 0, 's'},    {"stats", 2, 0, 't'},  {"statistics", 2, 0, 't'},
      {"verify", 2, 0, 'v'}, {"vacuum", 2, 0, 'c'}, {"essid", 1, 0, 'd'},
      {0, 0, 0, 0}};
  option =
      getopt_long(argc, argv, "bc:d:e:hi:s:t:v:", long_options, &option_index);
  if (option > 0) {
    switch (option) {
    case 'b':
      if (check_for_db(&db, argv[1], 0, 1)) {
        return 1;
      }
      batch_process(db);
      break;
    case 'c':
      if (check_for_db(&db, argv[1], 0, 0)) {
        return 1;
      }
      vacuum(db, (argc > 3 && strcasecmp(argv[3], "all") == 0) ? 1 : 0);
      break;
    case 'e':
      if (argc < 4) {
        print_help("You must specify an export format.");
      } else if (strcmp(argv[3], "cowpatty") == 0) {
        if (argc < 6) {
          print_help("You must specify essid and output file.");
        } else {
          if (check_for_db(&db, argv[1], 0, 0)) {
            return 1;
          }
          export_cowpatty(db, argv[4], argv[5]);
        }
      } else {
        print_help("Invalid export format specified.");
      }
      break;
    case ':':
    case '?':
    case 'h':
      print_help(NULL);
      break;
    case 'i':
      if (argc < 5) {
        print_help("You must specifiy an import format and a file.");
      } else if (strcasecmp(argv[3], "cowpatty") == 0) {
        if (check_for_db(&db, argv[1], 1, 0)) {
          return 1;
        }
        import_cowpatty(db, argv[4]);
      } else if (strcasecmp(argv[3], "essid") == 0) {
        if (check_for_db(&db, argv[1], 1, 0)) {
          return 1;
        }
        import_ascii(db, "essid", argv[4]);
      } else if (strcasecmp(argv[3], "passwd") == 0 ||
                 strcasecmp(argv[3], "password") == 0) {
        if (check_for_db(&db, argv[1], 1, 0)) {
          return 1;
        }
        import_ascii(db, "passwd", argv[4]);
      } else {
        print_help("Invalid import format specified.");
        return 1;
      }
      break;
    case 's':
      if (check_for_db(&db, argv[1], 0, 0)) {
        return 1;
      }
      sql_stdout(db, argv[3], 0);
      break;
    case 't':
      if (check_for_db(&db, argv[1], 0, 1)) {
        return 1;
      }
      show_stats(db, (argv[3] == NULL) ? 0 : 1);
      break;
    case 'v':
      if (check_for_db(&db, argv[1], 0,
                       (argc > 3 && strcasecmp(argv[3], "all") == 0) ? 0 : 1)) {
        return 1;
      }
      verify(db, (argc > 3 && strcasecmp(argv[3], "all") == 0) ? 1 : 0);
      break;
    default:
      print_help("Invalid option");
      break;
    }
  } else {
    print_help(NULL);
  }
  if (db)
    sqlite3_close(db);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1215 <main+0x35>
xor    %eax,%eax
mov    %eax,%edi
call   10e0 <print_help@plt>
movl   $0x1,-0x4(%rbp)
jmp    1706 <main+0x526>
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xf0a(%rip),%rdx
lea    0x2e67(%rip),%rcx
lea    -0x1c(%rbp),%r8
call   1050 <getopt_long@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jle    16e2 <main+0x502>
mov    -0x20(%rbp),%eax
add    $0xffffffc6,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0x3c,%eax
ja     16d1 <main+0x4f1>
mov    -0x28(%rbp),%rax
lea    0xd91(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    -0x18(%rbp),%rdi
xor    %edx,%edx
mov    $0x1,%ecx
call   1100 <check_for_db@plt>
cmp    $0x0,%eax
je     12a5 <main+0xc5>
movl   $0x1,-0x4(%rbp)
jmp    1706 <main+0x526>
mov    -0x18(%rbp),%rdi
call   1070 <batch_process@plt>
jmp    16dd <main+0x4fd>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    -0x18(%rbp),%rdi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1100 <check_for_db@plt>
cmp    $0x0,%eax
je     12dd <main+0xfd>
movl   $0x1,-0x4(%rbp)
jmp    1706 <main+0x526>
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
xor    %eax,%eax
cmpl   $0x3,-0x8(%rbp)
mov    %al,-0x29(%rbp)
jle    1311 <main+0x131>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xe4a(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
sete   %al
mov    %al,-0x29(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x29(%rbp),%cl
xor    %esi,%esi
mov    $0x1,%eax
test   $0x1,%cl
cmovne %eax,%esi
call   10b0 <vacuum@plt>
jmp    16dd <main+0x4fd>
cmpl   $0x4,-0x8(%rbp)
jge    134a <main+0x16a>
lea    0xe11(%rip),%rdi
call   10e0 <print_help@plt>
jmp    13db <main+0x1fb>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xe1b(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    13ca <main+0x1ea>
cmpl   $0x6,-0x8(%rbp)
jge    1382 <main+0x1a2>
lea    0xe05(%rip),%rdi
call   10e0 <print_help@plt>
jmp    13c5 <main+0x1e5>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    -0x18(%rbp),%rdi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1100 <check_for_db@plt>
cmp    $0x0,%eax
je     13ac <main+0x1cc>
movl   $0x1,-0x4(%rbp)
jmp    1706 <main+0x526>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdx
call   1060 <export_cowpatty@plt>
jmp    13d6 <main+0x1f6>
lea    0xdd4(%rip),%rdi
call   10e0 <print_help@plt>
jmp    13db <main+0x1fb>
jmp    16dd <main+0x4fd>
xor    %eax,%eax
mov    %eax,%edi
call   10e0 <print_help@plt>
jmp    16dd <main+0x4fd>
cmpl   $0x5,-0x8(%rbp)
jge    1409 <main+0x229>
lea    0xdc7(%rip),%rdi
call   10e0 <print_help@plt>
jmp    157b <main+0x39b>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xd5c(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1469 <main+0x289>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    -0x18(%rbp),%rdi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1100 <check_for_db@plt>
cmp    $0x0,%eax
je     1453 <main+0x273>
movl   $0x1,-0x4(%rbp)
jmp    1706 <main+0x526>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rsi
call   1040 <import_cowpatty@plt>
jmp    1576 <main+0x396>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xcbe(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    14d0 <main+0x2f0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    -0x18(%rbp),%rdi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1100 <check_for_db@plt>
cmp    $0x0,%eax
je     14b3 <main+0x2d3>
movl   $0x1,-0x4(%rbp)
jmp    1706 <main+0x526>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdx
lea    0xc70(%rip),%rsi
call   1090 <import_ascii@plt>
jmp    1571 <main+0x391>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xd16(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
je     150a <main+0x32a>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xd00(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1554 <main+0x374>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    -0x18(%rbp),%rdi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1100 <check_for_db@plt>
cmp    $0x0,%eax
je     1537 <main+0x357>
movl   $0x1,-0x4(%rbp)
jmp    1706 <main+0x526>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdx
lea    0xcab(%rip),%rsi
call   1090 <import_ascii@plt>
jmp    156c <main+0x38c>
lea    0xcaa(%rip),%rdi
call   10e0 <print_help@plt>
movl   $0x1,-0x4(%rbp)
jmp    1706 <main+0x526>
jmp    1571 <main+0x391>
jmp    1576 <main+0x396>
jmp    157b <main+0x39b>
jmp    16dd <main+0x4fd>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    -0x18(%rbp),%rdi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1100 <check_for_db@plt>
cmp    $0x0,%eax
je     15aa <main+0x3ca>
movl   $0x1,-0x4(%rbp)
jmp    1706 <main+0x526>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
xor    %edx,%edx
call   10d0 <sql_stdout@plt>
jmp    16dd <main+0x4fd>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    -0x18(%rbp),%rdi
xor    %edx,%edx
mov    $0x1,%ecx
call   1100 <check_for_db@plt>
cmp    $0x0,%eax
je     15ef <main+0x40f>
movl   $0x1,-0x4(%rbp)
jmp    1706 <main+0x526>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rcx
mov    $0x1,%esi
xor    %eax,%eax
cmp    $0x0,%rcx
cmove  %eax,%esi
call   10f0 <show_stats@plt>
jmp    16dd <main+0x4fd>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x48(%rbp)
xor    %eax,%eax
cmpl   $0x3,-0x8(%rbp)
mov    %al,-0x39(%rbp)
jle    164b <main+0x46b>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xb10(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
sete   %al
mov    %al,-0x39(%rbp)
mov    -0x48(%rbp),%rsi
mov    -0x39(%rbp),%dl
mov    $0x1,%ecx
xor    %eax,%eax
test   $0x1,%dl
cmovne %eax,%ecx
lea    -0x18(%rbp),%rdi
xor    %edx,%edx
call   1100 <check_for_db@plt>
cmp    $0x0,%eax
je     167f <main+0x49f>
movl   $0x1,-0x4(%rbp)
jmp    1706 <main+0x526>
mov    -0x18(%rbp),%rax
mov    %rax,-0x58(%rbp)
xor    %eax,%eax
cmpl   $0x3,-0x8(%rbp)
mov    %al,-0x49(%rbp)
jle    16b3 <main+0x4d3>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xaa8(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
sete   %al
mov    %al,-0x49(%rbp)
mov    -0x58(%rbp),%rdi
mov    -0x49(%rbp),%cl
xor    %esi,%esi
mov    $0x1,%eax
test   $0x1,%cl
cmovne %eax,%esi
call   10c0 <verify@plt>
jmp    16dd <main+0x4fd>
lea    0xb4e(%rip),%rdi
call   10e0 <print_help@plt>
jmp    16eb <main+0x50b>
xor    %eax,%eax
mov    %eax,%edi
call   10e0 <print_help@plt>
cmpq   $0x0,-0x18(%rbp)
je     16ff <main+0x51f>
mov    -0x18(%rbp),%rdi
call   10a0 <sqlite3_close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
cmp    $0x2,%edi
jg     11fd <main+0x1d>
xor    %edi,%edi
call   10e0 <print_help@plt>
mov    $0x1,%ebp
jmp    125f <main+0x7f>
mov    %rsi,%r14
mov    %edi,%ebx
movq   $0x0,0x8(%rsp)
movl   $0x0,0x14(%rsp)
lea    0xf22(%rip),%rdx
lea    0x2e7f(%rip),%rcx
lea    0x14(%rsp),%r8
call   1050 <getopt_long@plt>
test   %eax,%eax
jle    1247 <main+0x67>
add    $0xffffffc6,%eax
cmp    $0x3c,%eax
ja     126c <main+0x8c>
lea    0xdc2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %edi,%edi
call   10e0 <print_help@plt>
mov    0x8(%rsp),%rdi
xor    %ebp,%ebp
test   %rdi,%rdi
je     125f <main+0x7f>
call   10a0 <sqlite3_close@plt>
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xfb3(%rip),%rdi
jmp    1249 <main+0x69>
mov    0x8(%r14),%rsi
lea    0x8(%rsp),%rdi
mov    $0x1,%ebp
xor    %edx,%edx
mov    $0x1,%ecx
call   1100 <check_for_db@plt>
test   %eax,%eax
jne    125f <main+0x7f>
mov    0x8(%rsp),%rdi
call   1070 <batch_process@plt>
jmp    124e <main+0x6e>
mov    0x8(%r14),%rsi
lea    0x8(%rsp),%rdi
xor    %r15d,%r15d
xor    %edx,%edx
xor    %ecx,%ecx
call   1100 <check_for_db@plt>
mov    $0x1,%ebp
test   %eax,%eax
jne    125f <main+0x7f>
mov    0x8(%rsp),%rbp
cmp    $0x4,%ebx
jb     12e0 <main+0x100>
mov    0x18(%r14),%rdi
lea    0xe7b(%rip),%rsi
call   1030 <strcasecmp@plt>
xor    %r15d,%r15d
test   %eax,%eax
sete   %r15b
mov    %rbp,%rdi
mov    %r15d,%esi
call   10b0 <vacuum@plt>
jmp    124e <main+0x6e>
cmp    $0x3,%ebx
ja     13e6 <main+0x206>
lea    0xe51(%rip),%rdi
jmp    1249 <main+0x69>
cmp    $0x4,%ebx
ja     140a <main+0x22a>
lea    0xeb1(%rip),%rdi
jmp    1249 <main+0x69>
mov    0x8(%r14),%rsi
lea    0x8(%rsp),%rdi
xor    %edx,%edx
xor    %ecx,%ecx
call   1100 <check_for_db@plt>
mov    $0x1,%ebp
test   %eax,%eax
jne    125f <main+0x7f>
mov    0x8(%rsp),%rdi
mov    0x18(%r14),%rsi
xor    %edx,%edx
call   10d0 <sql_stdout@plt>
jmp    124e <main+0x6e>
mov    0x8(%r14),%rsi
lea    0x8(%rsp),%rdi
mov    $0x1,%ebp
xor    %edx,%edx
mov    $0x1,%ecx
call   1100 <check_for_db@plt>
test   %eax,%eax
jne    125f <main+0x7f>
mov    0x8(%rsp),%rdi
xor    %esi,%esi
cmpq   $0x0,0x18(%r14)
setne  %sil
call   10f0 <show_stats@plt>
jmp    124e <main+0x6e>
mov    0x8(%r14),%r15
cmp    $0x4,%ebx
jb     1476 <main+0x296>
mov    0x18(%r14),%rdi
lea    0xdab(%rip),%rsi
call   1030 <strcasecmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
lea    0x8(%rsp),%rdi
mov    %r15,%rsi
xor    %edx,%edx
call   1100 <check_for_db@plt>
mov    $0x1,%ebp
test   %eax,%eax
jne    125f <main+0x7f>
mov    0x18(%r14),%rdi
lea    0xd78(%rip),%rsi
call   1030 <strcasecmp@plt>
xor    %ebx,%ebx
test   %eax,%eax
sete   %bl
jmp    1499 <main+0x2b9>
mov    0x18(%r14),%rdi
lea    0xd83(%rip),%rsi
call   1080 <strcmp@plt>
test   %eax,%eax
je     14aa <main+0x2ca>
lea    0xda0(%rip),%rdi
jmp    1249 <main+0x69>
mov    0x18(%r14),%rbx
lea    0xd5f(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     14bf <main+0x2df>
lea    0xd0a(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1530 <main+0x350>
lea    0xdb2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     14f4 <main+0x314>
lea    0xda2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     14f4 <main+0x314>
lea    0xd94(%rip),%rdi
jmp    11f1 <main+0x11>
lea    0x8(%rsp),%rdi
xor    %ebx,%ebx
mov    $0x1,%ebp
mov    %r15,%rsi
xor    %edx,%edx
mov    $0x1,%ecx
call   1100 <check_for_db@plt>
test   %eax,%eax
jne    125f <main+0x7f>
mov    0x8(%rsp),%rdi
mov    %ebx,%esi
call   10c0 <verify@plt>
jmp    124e <main+0x6e>
cmp    $0x5,%ebx
ja     156c <main+0x38c>
lea    0xcc3(%rip),%rdi
jmp    1249 <main+0x69>
mov    0x8(%r14),%rsi
lea    0x8(%rsp),%rdi
mov    $0x1,%ebp
mov    $0x1,%edx
xor    %ecx,%ecx
call   1100 <check_for_db@plt>
test   %eax,%eax
jne    125f <main+0x7f>
mov    0x8(%rsp),%rdi
mov    0x20(%r14),%rsi
call   1040 <import_cowpatty@plt>
jmp    124e <main+0x6e>
mov    0x8(%r14),%rsi
lea    0x8(%rsp),%rdi
mov    $0x1,%ebp
mov    $0x1,%edx
xor    %ecx,%ecx
call   1100 <check_for_db@plt>
test   %eax,%eax
jne    125f <main+0x7f>
mov    0x8(%rsp),%rdi
mov    0x20(%r14),%rdx
lea    0xccf(%rip),%rsi
call   1090 <import_ascii@plt>
jmp    124e <main+0x6e>
mov    0x8(%r14),%rsi
lea    0x8(%rsp),%rdi
mov    $0x1,%ebp
mov    $0x1,%edx
xor    %ecx,%ecx
call   1100 <check_for_db@plt>
test   %eax,%eax
jne    125f <main+0x7f>
mov    0x8(%rsp),%rdi
mov    0x20(%r14),%rdx
lea    0xbd4(%rip),%rsi
call   1090 <import_ascii@plt>
jmp    124e <main+0x6e>
mov    0x8(%r14),%rsi
lea    0x8(%rsp),%rdi
xor    %edx,%edx
xor    %ecx,%ecx
call   1100 <check_for_db@plt>
mov    $0x1,%ebp
test   %eax,%eax
jne    125f <main+0x7f>
mov    0x8(%rsp),%rdi
mov    0x20(%r14),%rsi
mov    0x28(%r14),%rdx
call   1060 <export_cowpatty@plt>
jmp    124e <main+0x6e>

LLVM IR (-O0):
%struct.option = type { i8*, i32, i8, i32 }
@main.long_options = internal global [13 x %struct.option] [%struct.option { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i32 0, i8 0, i32 98 }, %struct.option { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i32 2, i8 0, i32 99 }, %struct.option { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i32 0, i32 0), i32 2, i8 0, i32 101 }, %struct.option { i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i32 0, i32 0), i32 0, i8 0, i32 104 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i32 0, i8 0, i32 104 }, %struct.option { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i32 0, i32 0), i32 2, i8 0, i32 105 }, %struct.option { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i32 1, i8 0, i32 115 }, %struct.option { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i32 0, i32 0), i32 2, i8 0, i32 116 }, %struct.option { i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i32 0, i32 0), i32 2, i8 0, i32 116 }, %struct.option { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i32 0, i32 0), i32 2, i8 0, i32 118 }, %struct.option { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i32 0, i32 0), i32 2, i8 0, i32 99 }, %struct.option { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i32 0, i32 0), i32 1, i8 0, i32 100 }, %struct.option zeroinitializer]
@.str = [6 x i8] c"batch\00"
@.str.1 = [6 x i8] c"clean\00"
@.str.2 = [7 x i8] c"export\00"
@.str.3 = [2 x i8] c"h\00"
@.str.4 = [5 x i8] c"help\00"
@.str.5 = [7 x i8] c"import\00"
@.str.6 = [4 x i8] c"sql\00"
@.str.7 = [6 x i8] c"stats\00"
@.str.8 = [11 x i8] c"statistics\00"
@.str.9 = [7 x i8] c"verify\00"
@.str.10 = [7 x i8] c"vacuum\00"
@.str.11 = [6 x i8] c"essid\00"
@.str.12 = [17 x i8] c"bc:d:e:hi:s:t:v:\00"
@.str.13 = [4 x i8] c"all\00"
@.str.14 = [35 x i8] c"You must specify an export format.\00"
@.str.15 = [9 x i8] c"cowpatty\00"
@.str.16 = [40 x i8] c"You must specify essid and output file.\00"
@.str.17 = [33 x i8] c"Invalid export format specified.\00"
@.str.18 = [47 x i8] c"You must specifiy an import format and a file.\00"
@.str.19 = [7 x i8] c"passwd\00"
@.str.20 = [9 x i8] c"password\00"
@.str.21 = [33 x i8] c"Invalid import format specified.\00"
@.str.22 = [15 x i8] c"Invalid option\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 3
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @print_help(i8* null)
store i32 1, i32* %3
br label %241
13: ; preds = %2
store i32* null, i32** %6
store i32 0, i32* %7
%14 = load i32, i32* %4
%15 = load i8**, i8*** %5
%16 = call i32 @getopt_long(i32 %14, i8** %15, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0), %struct.option* getelementptr inbounds ([13 x %struct.option], [13 x %struct.option]* @main.long_options, i64 0, i64 0), i32* %7)
store i32 %16, i32* %8
%17 = load i32, i32* %8
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %232
19: ; preds = %13
%20 = load i32, i32* %8
switch i32 %20, label %229 [
i32 98, label %21
i32 99, label %31
i32 101, label %53
i32 58, label %90
i32 63, label %90
i32 104, label %90
i32 105, label %92
i32 115, label %166
i32 116, label %179
i32 118, label %195
]
21: ; preds = %19
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i32 @check_for_db(i32** %6, i8* %24, i32 0, i32 1)
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %21
store i32 1, i32* %3
br label %241
28: ; preds = %21
%29 = load i32*, i32** %6
%30 = call i32 @batch_process(i32* %29)
br label %231
31: ; preds = %19
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = call i32 @check_for_db(i32** %6, i8* %34, i32 0, i32 0)
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %38
37: ; preds = %31
store i32 1, i32* %3
br label %241
38: ; preds = %31
%39 = load i32*, i32** %6
%40 = load i32, i32* %4
%41 = icmp sgt i32 %40, 3
br i1 %41, label %42, label %48
42: ; preds = %38
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 3
%45 = load i8*, i8** %44
%46 = call i32 @strcasecmp(i8* %45, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%47 = icmp eq i32 %46, 0
br label %48
48: ; preds = %42, %38
%49 = phi i1 [ false, %38 ], [ %47, %42 ]
%50 = zext i1 %49 to i64
%51 = select i1 %49, i32 1, i32 0
%52 = call i32 @vacuum(i32* %39, i32 %51)
br label %231
53: ; preds = %19
%54 = load i32, i32* %4
%55 = icmp slt i32 %54, 4
br i1 %55, label %56, label %58
56: ; preds = %53
%57 = call i32 @print_help(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.14, i64 0, i64 0))
br label %89
58: ; preds = %53
%59 = load i8**, i8*** %5
%60 = getelementptr inbounds i8*, i8** %59, i64 3
%61 = load i8*, i8** %60
%62 = call i32 @strcmp(i8* %61, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0))
%63 = icmp eq i32 %62, 0
br i1 %63, label %64, label %86
64: ; preds = %58
%65 = load i32, i32* %4
%66 = icmp slt i32 %65, 6
br i1 %66, label %67, label %69
67: ; preds = %64
%68 = call i32 @print_help(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.16, i64 0, i64 0))
br label %85
69: ; preds = %64
%70 = load i8**, i8*** %5
%71 = getelementptr inbounds i8*, i8** %70, i64 1
%72 = load i8*, i8** %71
%73 = call i32 @check_for_db(i32** %6, i8* %72, i32 0, i32 0)
%74 = icmp ne i32 %73, 0
br i1 %74, label %75, label %76
75: ; preds = %69
store i32 1, i32* %3
br label %241
76: ; preds = %69
%77 = load i32*, i32** %6
%78 = load i8**, i8*** %5
%79 = getelementptr inbounds i8*, i8** %78, i64 4
%80 = load i8*, i8** %79
%81 = load i8**, i8*** %5
%82 = getelementptr inbounds i8*, i8** %81, i64 5
%83 = load i8*, i8** %82
%84 = call i32 @export_cowpatty(i32* %77, i8* %80, i8* %83)
br label %85
85: ; preds = %76, %67
br label %88
86: ; preds = %58
%87 = call i32 @print_help(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.17, i64 0, i64 0))
br label %88
88: ; preds = %86, %85
br label %89
89: ; preds = %88, %56
br label %231
90: ; preds = %19, %19, %19
%91 = call i32 @print_help(i8* null)
br label %231
92: ; preds = %19
%93 = load i32, i32* %4
%94 = icmp slt i32 %93, 5
br i1 %94, label %95, label %97
95: ; preds = %92
%96 = call i32 @print_help(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.18, i64 0, i64 0))
br label %165
97: ; preds = %92
%98 = load i8**, i8*** %5
%99 = getelementptr inbounds i8*, i8** %98, i64 3
%100 = load i8*, i8** %99
%101 = call i32 @strcasecmp(i8* %100, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0))
%102 = icmp eq i32 %101, 0
br i1 %102, label %103, label %116
103: ; preds = %97
%104 = load i8**, i8*** %5
%105 = getelementptr inbounds i8*, i8** %104, i64 1
%106 = load i8*, i8** %105
%107 = call i32 @check_for_db(i32** %6, i8* %106, i32 1, i32 0)
%108 = icmp ne i32 %107, 0
br i1 %108, label %109, label %110
109: ; preds = %103
store i32 1, i32* %3
br label %241
110: ; preds = %103
%111 = load i32*, i32** %6
%112 = load i8**, i8*** %5
%113 = getelementptr inbounds i8*, i8** %112, i64 4
%114 = load i8*, i8** %113
%115 = call i32 @import_cowpatty(i32* %111, i8* %114)
br label %164
116: ; preds = %97
%117 = load i8**, i8*** %5
%118 = getelementptr inbounds i8*, i8** %117, i64 3
%119 = load i8*, i8** %118
%120 = call i32 @strcasecmp(i8* %119, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0))
%121 = icmp eq i32 %120, 0
br i1 %121, label %122, label %135
122: ; preds = %116
%123 = load i8**, i8*** %5
%124 = getelementptr inbounds i8*, i8** %123, i64 1
%125 = load i8*, i8** %124
%126 = call i32 @check_for_db(i32** %6, i8* %125, i32 1, i32 0)
%127 = icmp ne i32 %126, 0
br i1 %127, label %128, label %129
128: ; preds = %122
store i32 1, i32* %3
br label %241
129: ; preds = %122
%130 = load i32*, i32** %6
%131 = load i8**, i8*** %5
%132 = getelementptr inbounds i8*, i8** %131, i64 4
%133 = load i8*, i8** %132
%134 = call i32 @import_ascii(i32* %130, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i8* %133)
br label %163
135: ; preds = %116
%136 = load i8**, i8*** %5
%137 = getelementptr inbounds i8*, i8** %136, i64 3
%138 = load i8*, i8** %137
%139 = call i32 @strcasecmp(i8* %138, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0))
%140 = icmp eq i32 %139, 0
br i1 %140, label %147, label %141
141: ; preds = %135
%142 = load i8**, i8*** %5
%143 = getelementptr inbounds i8*, i8** %142, i64 3
%144 = load i8*, i8** %143
%145 = call i32 @strcasecmp(i8* %144, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.20, i64 0, i64 0))
%146 = icmp eq i32 %145, 0
br i1 %146, label %147, label %160
147: ; preds = %141, %135
%148 = load i8**, i8*** %5
%149 = getelementptr inbounds i8*, i8** %148, i64 1
%150 = load i8*, i8** %149
%151 = call i32 @check_for_db(i32** %6, i8* %150, i32 1, i32 0)
%152 = icmp ne i32 %151, 0
br i1 %152, label %153, label %154
153: ; preds = %147
store i32 1, i32* %3
br label %241
154: ; preds = %147
%155 = load i32*, i32** %6
%156 = load i8**, i8*** %5
%157 = getelementptr inbounds i8*, i8** %156, i64 4
%158 = load i8*, i8** %157
%159 = call i32 @import_ascii(i32* %155, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0), i8* %158)
br label %162
160: ; preds = %141
%161 = call i32 @print_help(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.21, i64 0, i64 0))
store i32 1, i32* %3
br label %241
162: ; preds = %154
br label %163
163: ; preds = %162, %129
br label %164
164: ; preds = %163, %110
br label %165
165: ; preds = %164, %95
br label %231
166: ; preds = %19
%167 = load i8**, i8*** %5
%168 = getelementptr inbounds i8*, i8** %167, i64 1
%169 = load i8*, i8** %168
%170 = call i32 @check_for_db(i32** %6, i8* %169, i32 0, i32 0)
%171 = icmp ne i32 %170, 0
br i1 %171, label %172, label %173
172: ; preds = %166
store i32 1, i32* %3
br label %241
173: ; preds = %166
%174 = load i32*, i32** %6
%175 = load i8**, i8*** %5
%176 = getelementptr inbounds i8*, i8** %175, i64 3
%177 = load i8*, i8** %176
%178 = call i32 @sql_stdout(i32* %174, i8* %177, i32 0)
br label %231
179: ; preds = %19
%180 = load i8**, i8*** %5
%181 = getelementptr inbounds i8*, i8** %180, i64 1
%182 = load i8*, i8** %181
%183 = call i32 @check_for_db(i32** %6, i8* %182, i32 0, i32 1)
%184 = icmp ne i32 %183, 0
br i1 %184, label %185, label %186
185: ; preds = %179
store i32 1, i32* %3
br label %241
186: ; preds = %179
%187 = load i32*, i32** %6
%188 = load i8**, i8*** %5
%189 = getelementptr inbounds i8*, i8** %188, i64 3
%190 = load i8*, i8** %189
%191 = icmp eq i8* %190, null
%192 = zext i1 %191 to i64
%193 = select i1 %191, i32 0, i32 1
%194 = call i32 @show_stats(i32* %187, i32 %193)
br label %231
195: ; preds = %19
%196 = load i8**, i8*** %5
%197 = getelementptr inbounds i8*, i8** %196, i64 1
%198 = load i8*, i8** %197
%199 = load i32, i32* %4
%200 = icmp sgt i32 %199, 3
br i1 %200, label %201, label %207
201: ; preds = %195
%202 = load i8**, i8*** %5
%203 = getelementptr inbounds i8*, i8** %202, i64 3
%204 = load i8*, i8** %203
%205 = call i32 @strcasecmp(i8* %204, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%206 = icmp eq i32 %205, 0
br label %207
207: ; preds = %201, %195
%208 = phi i1 [ false, %195 ], [ %206, %201 ]
%209 = zext i1 %208 to i64
%210 = select i1 %208, i32 0, i32 1
%211 = call i32 @check_for_db(i32** %6, i8* %198, i32 0, i32 %210)
%212 = icmp ne i32 %211, 0
br i1 %212, label %213, label %214
213: ; preds = %207
store i32 1, i32* %3
br label %241
214: ; preds = %207
%215 = load i32*, i32** %6
%216 = load i32, i32* %4
%217 = icmp sgt i32 %216, 3
br i1 %217, label %218, label %224
218: ; preds = %214
%219 = load i8**, i8*** %5
%220 = getelementptr inbounds i8*, i8** %219, i64 3
%221 = load i8*, i8** %220
%222 = call i32 @strcasecmp(i8* %221, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%223 = icmp eq i32 %222, 0
br label %224
224: ; preds = %218, %214
%225 = phi i1 [ false, %214 ], [ %223, %218 ]
%226 = zext i1 %225 to i64
%227 = select i1 %225, i32 1, i32 0
%228 = call i32 @verify(i32* %215, i32 %227)
br label %231
229: ; preds = %19
%230 = call i32 @print_help(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.22, i64 0, i64 0))
br label %231
231: ; preds = %229, %224, %186, %173, %165, %90, %89, %48, %28
br label %234
232: ; preds = %13
%233 = call i32 @print_help(i8* null)
br label %234
234: ; preds = %232, %231
%235 = load i32*, i32** %6
%236 = icmp ne i32* %235, null
br i1 %236, label %237, label %240
237: ; preds = %234
%238 = load i32*, i32** %6
%239 = call i32 @sqlite3_close(i32* %238)
br label %240
240: ; preds = %237, %234
store i32 0, i32* %3
br label %241
241: ; preds = %240, %213, %185, %172, %160, %153, %128, %109, %75, %37, %27, %11
%242 = load i32, i32* %3
ret i32 %242
}

LLVM IR (-O2):
%struct.option = type { i8*, i32, i8, i32 }
@main.long_options = internal global [13 x %struct.option] [%struct.option { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i32 0, i8 0, i32 98 }, %struct.option { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i32 2, i8 0, i32 99 }, %struct.option { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i32 0, i32 0), i32 2, i8 0, i32 101 }, %struct.option { i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i32 0, i32 0), i32 0, i8 0, i32 104 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i32 0, i8 0, i32 104 }, %struct.option { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i32 0, i32 0), i32 2, i8 0, i32 105 }, %struct.option { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i32 1, i8 0, i32 115 }, %struct.option { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i32 0, i32 0), i32 2, i8 0, i32 116 }, %struct.option { i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i32 0, i32 0), i32 2, i8 0, i32 116 }, %struct.option { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i32 0, i32 0), i32 2, i8 0, i32 118 }, %struct.option { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i32 0, i32 0), i32 2, i8 0, i32 99 }, %struct.option { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i32 0, i32 0), i32 1, i8 0, i32 100 }, %struct.option zeroinitializer]
@.str = [6 x i8] c"batch\00"
@.str.1 = [6 x i8] c"clean\00"
@.str.2 = [7 x i8] c"export\00"
@.str.3 = [2 x i8] c"h\00"
@.str.4 = [5 x i8] c"help\00"
@.str.5 = [7 x i8] c"import\00"
@.str.6 = [4 x i8] c"sql\00"
@.str.7 = [6 x i8] c"stats\00"
@.str.8 = [11 x i8] c"statistics\00"
@.str.9 = [7 x i8] c"verify\00"
@.str.10 = [7 x i8] c"vacuum\00"
@.str.11 = [6 x i8] c"essid\00"
@.str.12 = [17 x i8] c"bc:d:e:hi:s:t:v:\00"
@.str.13 = [4 x i8] c"all\00"
@.str.14 = [35 x i8] c"You must specify an export format.\00"
@.str.15 = [9 x i8] c"cowpatty\00"
@.str.16 = [40 x i8] c"You must specify essid and output file.\00"
@.str.17 = [33 x i8] c"Invalid export format specified.\00"
@.str.18 = [47 x i8] c"You must specifiy an import format and a file.\00"
@.str.19 = [7 x i8] c"passwd\00"
@.str.20 = [9 x i8] c"password\00"
@.str.21 = [33 x i8] c"Invalid import format specified.\00"
@.str.22 = [15 x i8] c"Invalid option\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = bitcast i32** %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = icmp slt i32 %0, 3
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @print_help(i8* null)
br label %173
10: ; preds = %2
store i32* null, i32** %3
store i32 0, i32* %4
%11 = call i32 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0), %struct.option* getelementptr inbounds ([13 x %struct.option], [13 x %struct.option]* @main.long_options, i64 0, i64 0), i32* %4)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %166
13: ; preds = %10
switch i32 %11, label %164 [
i32 98, label %14
i32 99, label %22
i32 101, label %39
i32 58, label %66
i32 63, label %66
i32 104, label %66
i32 105, label %68
i32 115, label %118
i32 116, label %128
i32 118, label %140
]
14: ; preds = %13
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @check_for_db(i32** %3, i8* %16, i32 0, i32 1)
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %173
19: ; preds = %14
%20 = load i32*, i32** %3
%21 = call i32 @batch_process(i32* %20)
br label %168
22: ; preds = %13
%23 = getelementptr inbounds i8*, i8** %1, i64 1
%24 = load i8*, i8** %23
%25 = call i32 @check_for_db(i32** %3, i8* %24, i32 0, i32 0)
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %173
27: ; preds = %22
%28 = load i32*, i32** %3
%29 = icmp ugt i32 %0, 3
br i1 %29, label %30, label %36
30: ; preds = %27
%31 = getelementptr inbounds i8*, i8** %1, i64 3
%32 = load i8*, i8** %31
%33 = call i32 @strcasecmp(i8* %32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%34 = icmp eq i32 %33, 0
%35 = zext i1 %34 to i32
br label %36
36: ; preds = %30, %27
%37 = phi i32 [ 0, %27 ], [ %35, %30 ]
%38 = call i32 @vacuum(i32* %28, i32 %37)
br label %168
39: ; preds = %13
%40 = icmp ult i32 %0, 4
br i1 %40, label %41, label %43
41: ; preds = %39
%42 = call i32 @print_help(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.14, i64 0, i64 0))
br label %168
43: ; preds = %39
%44 = getelementptr inbounds i8*, i8** %1, i64 3
%45 = load i8*, i8** %44
%46 = call i32 @strcmp(i8* dereferenceable(1) %45, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0))
%47 = icmp eq i32 %46, 0
br i1 %47, label %48, label %64
48: ; preds = %43
%49 = icmp ult i32 %0, 6
br i1 %49, label %50, label %52
50: ; preds = %48
%51 = call i32 @print_help(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.16, i64 0, i64 0))
br label %168
52: ; preds = %48
%53 = getelementptr inbounds i8*, i8** %1, i64 1
%54 = load i8*, i8** %53
%55 = call i32 @check_for_db(i32** %3, i8* %54, i32 0, i32 0)
%56 = icmp eq i32 %55, 0
br i1 %56, label %57, label %173
57: ; preds = %52
%58 = load i32*, i32** %3
%59 = getelementptr inbounds i8*, i8** %1, i64 4
%60 = load i8*, i8** %59
%61 = getelementptr inbounds i8*, i8** %1, i64 5
%62 = load i8*, i8** %61
%63 = call i32 @export_cowpatty(i32* %58, i8* %60, i8* %62)
br label %168
64: ; preds = %43
%65 = call i32 @print_help(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.17, i64 0, i64 0))
br label %168
66: ; preds = %13, %13, %13
%67 = call i32 @print_help(i8* null)
br label %168
68: ; preds = %13
%69 = icmp ult i32 %0, 5
br i1 %69, label %70, label %72
70: ; preds = %68
%71 = call i32 @print_help(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.18, i64 0, i64 0))
br label %168
72: ; preds = %68
%73 = getelementptr inbounds i8*, i8** %1, i64 3
%74 = load i8*, i8** %73
%75 = call i32 @strcasecmp(i8* %74, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0))
%76 = icmp eq i32 %75, 0
br i1 %76, label %77, label %87
77: ; preds = %72
%78 = getelementptr inbounds i8*, i8** %1, i64 1
%79 = load i8*, i8** %78
%80 = call i32 @check_for_db(i32** %3, i8* %79, i32 1, i32 0)
%81 = icmp eq i32 %80, 0
br i1 %81, label %82, label %173
82: ; preds = %77
%83 = load i32*, i32** %3
%84 = getelementptr inbounds i8*, i8** %1, i64 4
%85 = load i8*, i8** %84
%86 = call i32 @import_cowpatty(i32* %83, i8* %85)
br label %168
87: ; preds = %72
%88 = call i32 @strcasecmp(i8* %74, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0))
%89 = icmp eq i32 %88, 0
br i1 %89, label %90, label %100
90: ; preds = %87
%91 = getelementptr inbounds i8*, i8** %1, i64 1
%92 = load i8*, i8** %91
%93 = call i32 @check_for_db(i32** %3, i8* %92, i32 1, i32 0)
%94 = icmp eq i32 %93, 0
br i1 %94, label %95, label %173
95: ; preds = %90
%96 = load i32*, i32** %3
%97 = getelementptr inbounds i8*, i8** %1, i64 4
%98 = load i8*, i8** %97
%99 = call i32 @import_ascii(i32* %96, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i8* %98)
br label %168
100: ; preds = %87
%101 = call i32 @strcasecmp(i8* %74, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0))
%102 = icmp eq i32 %101, 0
br i1 %102, label %106, label %103
103: ; preds = %100
%104 = call i32 @strcasecmp(i8* %74, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.20, i64 0, i64 0))
%105 = icmp eq i32 %104, 0
br i1 %105, label %106, label %116
106: ; preds = %103, %100
%107 = getelementptr inbounds i8*, i8** %1, i64 1
%108 = load i8*, i8** %107
%109 = call i32 @check_for_db(i32** %3, i8* %108, i32 1, i32 0)
%110 = icmp eq i32 %109, 0
br i1 %110, label %111, label %173
111: ; preds = %106
%112 = load i32*, i32** %3
%113 = getelementptr inbounds i8*, i8** %1, i64 4
%114 = load i8*, i8** %113
%115 = call i32 @import_ascii(i32* %112, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0), i8* %114)
br label %168
116: ; preds = %103
%117 = call i32 @print_help(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.21, i64 0, i64 0))
br label %173
118: ; preds = %13
%119 = getelementptr inbounds i8*, i8** %1, i64 1
%120 = load i8*, i8** %119
%121 = call i32 @check_for_db(i32** %3, i8* %120, i32 0, i32 0)
%122 = icmp eq i32 %121, 0
br i1 %122, label %123, label %173
123: ; preds = %118
%124 = load i32*, i32** %3
%125 = getelementptr inbounds i8*, i8** %1, i64 3
%126 = load i8*, i8** %125
%127 = call i32 @sql_stdout(i32* %124, i8* %126, i32 0)
br label %168
128: ; preds = %13
%129 = getelementptr inbounds i8*, i8** %1, i64 1
%130 = load i8*, i8** %129
%131 = call i32 @check_for_db(i32** %3, i8* %130, i32 0, i32 1)
%132 = icmp eq i32 %131, 0
br i1 %132, label %133, label %173
133: ; preds = %128
%134 = load i32*, i32** %3
%135 = getelementptr inbounds i8*, i8** %1, i64 3
%136 = load i8*, i8** %135
%137 = icmp ne i8* %136, null
%138 = zext i1 %137 to i32
%139 = call i32 @show_stats(i32* %134, i32 %138)
br label %168
140: ; preds = %13
%141 = getelementptr inbounds i8*, i8** %1, i64 1
%142 = load i8*, i8** %141
%143 = icmp ugt i32 %0, 3
br i1 %143, label %144, label %152
144: ; preds = %140
%145 = getelementptr inbounds i8*, i8** %1, i64 3
%146 = load i8*, i8** %145
%147 = call i32 @strcasecmp(i8* %146, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%148 = icmp ne i32 %147, 0
%149 = zext i1 %148 to i32
%150 = call i32 @check_for_db(i32** %3, i8* %142, i32 0, i32 %149)
%151 = icmp eq i32 %150, 0
br i1 %151, label %155, label %173
152: ; preds = %140
%153 = call i32 @check_for_db(i32** %3, i8* %142, i32 0, i32 1)
%154 = icmp eq i32 %153, 0
br i1 %154, label %160, label %173
155: ; preds = %144
%156 = load i8*, i8** %145
%157 = call i32 @strcasecmp(i8* %156, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%158 = icmp eq i32 %157, 0
%159 = zext i1 %158 to i32
br label %160
160: ; preds = %152, %155
%161 = phi i32 [ %159, %155 ], [ 0, %152 ]
%162 = load i32*, i32** %3
%163 = call i32 @verify(i32* %162, i32 %161)
br label %168
164: ; preds = %13
%165 = call i32 @print_help(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.22, i64 0, i64 0))
br label %168
166: ; preds = %10
%167 = call i32 @print_help(i8* null)
br label %168
168: ; preds = %19, %36, %66, %123, %133, %160, %164, %64, %57, %50, %41, %82, %111, %95, %70, %166
%169 = load i32*, i32** %3
%170 = icmp eq i32* %169, null
br i1 %170, label %173, label %171
171: ; preds = %168
%172 = call i32 @sqlite3_close(i32* %169)
br label %173
173: ; preds = %152, %168, %171, %144, %128, %118, %106, %90, %77, %52, %22, %14, %116, %8
%174 = phi i32 [ 1, %8 ], [ 1, %116 ], [ 1, %14 ], [ 1, %22 ], [ 1, %52 ], [ 1, %77 ], [ 1, %90 ], [ 1, %106 ], [ 1, %118 ], [ 1, %128 ], [ 1, %144 ], [ 0, %171 ], [ 0, %168 ], [ 1, %152 ]
ret i32 %174
}