#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
char *sqlite3_libversion();
char *sqlite3_sourceid();
void usage(const char *argv0) {
  printf("Usage: %s [OPTIONS] DATABASE LOG\n\n", argv0);
  printf(
      "DATABASE is an SQLite database against which various statements\n"
      "have been run.  The SQL text is stored in LOG.  LOG is an SQLite\n"
      "database with this schema:\n"
      "\n"
      "    CREATE TABLE sqllog(sql TEXT);\n"
      "\n"
      "This utility program analyzes statements contained in LOG and prints\n"
      "a report showing how many times each index in DATABASE is used by the\n"
      "statements in LOG.\n"
      "\n"
      "DATABASE only needs to contain the schema used by the statements in\n"
      "LOG. The content can be removed from DATABASE.\n");
  printf("\nOPTIONS:\n\n"
         "    --progress N   Show a progress message after every N input rows\n"
         "    -q             Omit error message when parsing log entries\n"
         "    --using NAME   Print SQL statements that use index NAME\n");
  printf("\nAnalysis will be done by SQLite version %s dated %.20s\n"
         "checkin number %.40s. Different versions\n"
         "of SQLite might use different indexes.\n",
         sqlite3_libversion(), sqlite3_sourceid(), sqlite3_sourceid() + 21);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0x1084(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <sqlite3_libversion@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <sqlite3_sourceid@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <sqlite3_sourceid@plt>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
add    $0x15,%rcx
lea    0x1115(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rsi
lea    0xea2(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf40(%rip),%rdi
call   1040 <puts@plt>
lea    0x1107(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <sqlite3_libversion@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1060 <sqlite3_sourceid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <sqlite3_sourceid@plt>
lea    0x15(%rax),%rcx
lea    0xe80(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Usage: %s [OPTIONS] DATABASE LOG\0A\0A\00"
@.str.1 = [468 x i8] c"DATABASE is an SQLite database against which various statements\0Ahave been run. The SQL text is stored in LOG. LOG is an SQLite\0Adatabase with this schema:\0A\0A CREATE TABLE sqllog(sql TEXT);\0A\0AThis utility program analyzes statements contained in LOG and prints\0Aa report showing how many times each index in DATABASE is used by the\0Astatements in LOG.\0A\0ADATABASE only needs to contain the schema used by the statements in\0ALOG. The content can be removed from DATABASE.\0A\00"
@.str.2 = [203 x i8] c"\0AOPTIONS:\0A\0A --progress N Show a progress message after every N input rows\0A -q Omit error message when parsing log entries\0A --using NAME Print SQL statements that use index NAME\0A\00"
@.str.3 = [137 x i8] c"\0AAnalysis will be done by SQLite version %s dated %.20s\0Acheckin number %.40s. Different versions\0Aof SQLite might use different indexes.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([468 x i8], [468 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([203 x i8], [203 x i8]* @.str.2, i64 0, i64 0))
%7 = call i8* (...) @sqlite3_libversion()
%8 = call i8* (...) @sqlite3_sourceid()
%9 = call i8* (...) @sqlite3_sourceid()
%10 = getelementptr inbounds i8, i8* %9, i64 21
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.3, i64 0, i64 0), i8* %7, i8* %8, i8* %10)
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [35 x i8] c"Usage: %s [OPTIONS] DATABASE LOG\0A\0A\00"
@.str.3 = [137 x i8] c"\0AAnalysis will be done by SQLite version %s dated %.20s\0Acheckin number %.40s. Different versions\0Aof SQLite might use different indexes.\0A\00"
@str = [467 x i8] c"DATABASE is an SQLite database against which various statements\0Ahave been run. The SQL text is stored in LOG. LOG is an SQLite\0Adatabase with this schema:\0A\0A CREATE TABLE sqllog(sql TEXT);\0A\0AThis utility program analyzes statements contained in LOG and prints\0Aa report showing how many times each index in DATABASE is used by the\0Astatements in LOG.\0A\0ADATABASE only needs to contain the schema used by the statements in\0ALOG. The content can be removed from DATABASE.\00"
@str.4 = [202 x i8] c"\0AOPTIONS:\0A\0A --progress N Show a progress message after every N input rows\0A -q Omit error message when parsing log entries\0A --using NAME Print SQL statements that use index NAME\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([467 x i8], [467 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([202 x i8], [202 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i8* (...) @sqlite3_libversion()
%6 = tail call i8* (...) @sqlite3_sourceid()
%7 = tail call i8* (...) @sqlite3_sourceid()
%8 = getelementptr inbounds i8, i8* %7, i64 21
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([137 x i8], [137 x i8]* @.str.3, i64 0, i64 0), i8* %5, i8* %6, i8* %8)
%10 = tail call i32 @exit(i32 1)
unreachable
}