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

/* Variables and functions */
int /*<<< orphan*/ isalpha(int);
scalar_t__ isdigit(int);
char *sqlite3_mprintf(char *, char const *);
int sqlite3_stricmp(char const *, char const *);
char *safeId(const char *zId) {
  static const char *azKeywords[] = {
      "ABORT",        "ACTION",       "ADD",
      "AFTER",        "ALL",          "ALTER",
      "ANALYZE",      "AND",          "AS",
      "ASC",          "ATTACH",       "AUTOINCREMENT",
      "BEFORE",       "BEGIN",        "BETWEEN",
      "BY",           "CASCADE",      "CASE",
      "CAST",         "CHECK",        "COLLATE",
      "COLUMN",       "COMMIT",       "CONFLICT",
      "CONSTRAINT",   "CREATE",       "CROSS",
      "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP",
      "DATABASE",     "DEFAULT",      "DEFERRABLE",
      "DEFERRED",     "DELETE",       "DESC",
      "DETACH",       "DISTINCT",     "DROP",
      "EACH",         "ELSE",         "END",
      "ESCAPE",       "EXCEPT",       "EXCLUSIVE",
      "EXISTS",       "EXPLAIN",      "FAIL",
      "FOR",          "FOREIGN",      "FROM",
      "FULL",         "GLOB",         "GROUP",
      "HAVING",       "IF",           "IGNORE",
      "IMMEDIATE",    "IN",           "INDEX",
      "INDEXED",      "INITIALLY",    "INNER",
      "INSERT",       "INSTEAD",      "INTERSECT",
      "INTO",         "IS",           "ISNULL",
      "JOIN",         "KEY",          "LEFT",
      "LIKE",         "LIMIT",        "MATCH",
      "NATURAL",      "NO",           "NOT",
      "NOTNULL",      "NULL",         "OF",
      "OFFSET",       "ON",           "OR",
      "ORDER",        "OUTER",        "PLAN",
      "PRAGMA",       "PRIMARY",      "QUERY",
      "RAISE",        "RECURSIVE",    "REFERENCES",
      "REGEXP",       "REINDEX",      "RELEASE",
      "RENAME",       "REPLACE",      "RESTRICT",
      "RIGHT",        "ROLLBACK",     "ROW",
      "SAVEPOINT",    "SELECT",       "SET",
      "TABLE",        "TEMP",         "TEMPORARY",
      "THEN",         "TO",           "TRANSACTION",
      "TRIGGER",      "UNION",        "UNIQUE",
      "UPDATE",       "USING",        "VACUUM",
      "VALUES",       "VIEW",         "VIRTUAL",
      "WHEN",         "WHERE",        "WITH",
      "WITHOUT",
  };
  int lwr, upr, mid, c, i, x;
  for (i = x = 0; (c = zId[i]) != 0; i++) {
    if (!isalpha(c) && c != '_') {
      if (i > 0 && isdigit(c)) {
        x++;
      } else {
        return sqlite3_mprintf("\"%w\"", zId);
      }
    }
  }
  if (x)
    return sqlite3_mprintf("%s", zId);
  lwr = 0;
  upr = sizeof(azKeywords) / sizeof(azKeywords[0]) - 1;
  while (lwr <= upr) {
    mid = (lwr + upr) / 2;
    c = sqlite3_stricmp(azKeywords[mid], zId);
    if (c == 0)
      return sqlite3_mprintf("\"%w\"", zId);
    if (c < 0) {
      lwr = mid + 1;
    } else {
      upr = mid - 1;
    }
  }
  return sqlite3_mprintf("%s", zId);
}


x86 assembly (clang, -O0):
<safeId>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
je     21e8 <safeId+0xa8>
mov    -0x20(%rbp),%edi
call   2040 <isalpha@plt>
cmp    $0x0,%eax
jne    21d5 <safeId+0x95>
cmpl   $0x5f,-0x20(%rbp)
je     21d5 <safeId+0x95>
cmpl   $0x0,-0x24(%rbp)
jle    21b7 <safeId+0x77>
mov    -0x20(%rbp),%edi
call   2030 <isdigit@plt>
cmp    $0x0,%rax
je     21b7 <safeId+0x77>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    21d0 <safeId+0x90>
mov    -0x10(%rbp),%rsi
lea    0x115e(%rip),%rdi
call   2060 <sqlite3_mprintf@plt>
mov    %rax,-0x8(%rbp)
jmp    22ae <safeId+0x16e>
jmp    21d5 <safeId+0x95>
jmp    21da <safeId+0x9a>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    215a <safeId+0x1a>
cmpl   $0x0,-0x28(%rbp)
je     220b <safeId+0xcb>
mov    -0x10(%rbp),%rsi
lea    0x1128(%rip),%rdi
call   2060 <sqlite3_mprintf@plt>
mov    %rax,-0x8(%rbp)
jmp    22ae <safeId+0x16e>
movl   $0x0,-0x14(%rbp)
movl   $0x7b,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     229a <safeId+0x15a>
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
movslq -0x1c(%rbp),%rcx
lea    0x2e0f(%rip),%rax
mov    (%rax,%rcx,8),%rdi
mov    -0x10(%rbp),%rsi
call   2050 <sqlite3_stricmp@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    2274 <safeId+0x134>
mov    -0x10(%rbp),%rsi
lea    0x10ba(%rip),%rdi
call   2060 <sqlite3_mprintf@plt>
mov    %rax,-0x8(%rbp)
jmp    22ae <safeId+0x16e>
cmpl   $0x0,-0x20(%rbp)
jge    228c <safeId+0x14c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    2295 <safeId+0x155>
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    2219 <safeId+0xd9>
mov    -0x10(%rbp),%rsi
lea    0x1080(%rip),%rdi
call   2060 <sqlite3_mprintf@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safeId>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r15
mov    (%rdi),%bl
test   %bl,%bl
je     11b0 <safeId+0x70>
xor    %ebp,%ebp
lea    0x13b3(%rip),%r14
xor    %r12d,%r12d
jmp    117e <safeId+0x3e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl 0x1(%r15,%rbp,1),%ebx
add    $0x1,%rbp
test   %bl,%bl
je     11ab <safeId+0x6b>
movsbl %bl,%r13d
mov    %r13d,%edi
call   1040 <isalpha@plt>
test   %eax,%eax
jne    1170 <safeId+0x30>
cmp    $0x5f,%bl
je     1170 <safeId+0x30>
test   %rbp,%rbp
je     1216 <safeId+0xd6>
mov    %r13d,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     1216 <safeId+0xd6>
add    $0x1,%r12d
jmp    1170 <safeId+0x30>
test   %r12d,%r12d
jne    120f <safeId+0xcf>
xor    %ebp,%ebp
mov    $0x7b,%ebx
lea    0xe42(%rip),%r13
lea    0x134b(%rip),%r14
jmp    11db <safeId+0x9b>
nopw   0x0(%rax,%rax,1)
add    $0xffffffff,%r12d
mov    %r12d,%ebx
cmp    %ebx,%ebp
jg     120f <safeId+0xcf>
lea    (%rbx,%rbp,1),%eax
mov    %eax,%r12d
shr    $0x1f,%r12d
add    %eax,%r12d
sar    %r12d
movslq %r12d,%rax
movslq 0x0(%r13,%rax,4),%rdi
add    %r13,%rdi
mov    %r15,%rsi
call   1050 <sqlite3_stricmp@plt>
test   %eax,%eax
je     1216 <safeId+0xd6>
jns    11d0 <safeId+0x90>
add    $0x1,%r12d
mov    %r12d,%ebp
cmp    %ebx,%ebp
jle    11db <safeId+0x9b>
lea    0x12ff(%rip),%r14
mov    %r14,%rdi
mov    %r15,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <sqlite3_mprintf@plt>

LLVM IR (-O0):
@safeId.azKeywords = internal global [124 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.27, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.28, i32 0, i32 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.30, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.31, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.32, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.33, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.34, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.35, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.36, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.37, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.38, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.39, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.40, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.41, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.42, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.43, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.44, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.45, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.46, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.47, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.48, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.49, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.50, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.51, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.52, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.53, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.54, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.55, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.56, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.57, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.58, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.59, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.60, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.61, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.62, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.63, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.64, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.65, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.66, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.67, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.68, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.69, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.70, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.71, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.72, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.73, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.74, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.75, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.76, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.77, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.78, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.79, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.80, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.81, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.82, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.83, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.84, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.85, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.86, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.87, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.88, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.89, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.90, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.91, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.92, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.93, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.94, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.95, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.96, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.97, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.98, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.99, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.100, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.101, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.102, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.103, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.104, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.105, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.106, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.107, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.108, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.109, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.110, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.111, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.112, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.113, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.114, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.115, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.116, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.117, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.118, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.119, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.120, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.121, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.122, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.123, i32 0, i32 0)]
@.str = [6 x i8] c"ABORT\00"
@.str.1 = [7 x i8] c"ACTION\00"
@.str.2 = [4 x i8] c"ADD\00"
@.str.3 = [6 x i8] c"AFTER\00"
@.str.4 = [4 x i8] c"ALL\00"
@.str.5 = [6 x i8] c"ALTER\00"
@.str.6 = [8 x i8] c"ANALYZE\00"
@.str.7 = [4 x i8] c"AND\00"
@.str.8 = [3 x i8] c"AS\00"
@.str.9 = [4 x i8] c"ASC\00"
@.str.10 = [7 x i8] c"ATTACH\00"
@.str.11 = [14 x i8] c"AUTOINCREMENT\00"
@.str.12 = [7 x i8] c"BEFORE\00"
@.str.13 = [6 x i8] c"BEGIN\00"
@.str.14 = [8 x i8] c"BETWEEN\00"
@.str.15 = [3 x i8] c"BY\00"
@.str.16 = [8 x i8] c"CASCADE\00"
@.str.17 = [5 x i8] c"CASE\00"
@.str.18 = [5 x i8] c"CAST\00"
@.str.19 = [6 x i8] c"CHECK\00"
@.str.20 = [8 x i8] c"COLLATE\00"
@.str.21 = [7 x i8] c"COLUMN\00"
@.str.22 = [7 x i8] c"COMMIT\00"
@.str.23 = [9 x i8] c"CONFLICT\00"
@.str.24 = [11 x i8] c"CONSTRAINT\00"
@.str.25 = [7 x i8] c"CREATE\00"
@.str.26 = [6 x i8] c"CROSS\00"
@.str.27 = [13 x i8] c"CURRENT_DATE\00"
@.str.28 = [13 x i8] c"CURRENT_TIME\00"
@.str.29 = [18 x i8] c"CURRENT_TIMESTAMP\00"
@.str.30 = [9 x i8] c"DATABASE\00"
@.str.31 = [8 x i8] c"DEFAULT\00"
@.str.32 = [11 x i8] c"DEFERRABLE\00"
@.str.33 = [9 x i8] c"DEFERRED\00"
@.str.34 = [7 x i8] c"DELETE\00"
@.str.35 = [5 x i8] c"DESC\00"
@.str.36 = [7 x i8] c"DETACH\00"
@.str.37 = [9 x i8] c"DISTINCT\00"
@.str.38 = [5 x i8] c"DROP\00"
@.str.39 = [5 x i8] c"EACH\00"
@.str.40 = [5 x i8] c"ELSE\00"
@.str.41 = [4 x i8] c"END\00"
@.str.42 = [7 x i8] c"ESCAPE\00"
@.str.43 = [7 x i8] c"EXCEPT\00"
@.str.44 = [10 x i8] c"EXCLUSIVE\00"
@.str.45 = [7 x i8] c"EXISTS\00"
@.str.46 = [8 x i8] c"EXPLAIN\00"
@.str.47 = [5 x i8] c"FAIL\00"
@.str.48 = [4 x i8] c"FOR\00"
@.str.49 = [8 x i8] c"FOREIGN\00"
@.str.50 = [5 x i8] c"FROM\00"
@.str.51 = [5 x i8] c"FULL\00"
@.str.52 = [5 x i8] c"GLOB\00"
@.str.53 = [6 x i8] c"GROUP\00"
@.str.54 = [7 x i8] c"HAVING\00"
@.str.55 = [3 x i8] c"IF\00"
@.str.56 = [7 x i8] c"IGNORE\00"
@.str.57 = [10 x i8] c"IMMEDIATE\00"
@.str.58 = [3 x i8] c"IN\00"
@.str.59 = [6 x i8] c"INDEX\00"
@.str.60 = [8 x i8] c"INDEXED\00"
@.str.61 = [10 x i8] c"INITIALLY\00"
@.str.62 = [6 x i8] c"INNER\00"
@.str.63 = [7 x i8] c"INSERT\00"
@.str.64 = [8 x i8] c"INSTEAD\00"
@.str.65 = [10 x i8] c"INTERSECT\00"
@.str.66 = [5 x i8] c"INTO\00"
@.str.67 = [3 x i8] c"IS\00"
@.str.68 = [7 x i8] c"ISNULL\00"
@.str.69 = [5 x i8] c"JOIN\00"
@.str.70 = [4 x i8] c"KEY\00"
@.str.71 = [5 x i8] c"LEFT\00"
@.str.72 = [5 x i8] c"LIKE\00"
@.str.73 = [6 x i8] c"LIMIT\00"
@.str.74 = [6 x i8] c"MATCH\00"
@.str.75 = [8 x i8] c"NATURAL\00"
@.str.76 = [3 x i8] c"NO\00"
@.str.77 = [4 x i8] c"NOT\00"
@.str.78 = [8 x i8] c"NOTNULL\00"
@.str.79 = [5 x i8] c"NULL\00"
@.str.80 = [3 x i8] c"OF\00"
@.str.81 = [7 x i8] c"OFFSET\00"
@.str.82 = [3 x i8] c"ON\00"
@.str.83 = [3 x i8] c"OR\00"
@.str.84 = [6 x i8] c"ORDER\00"
@.str.85 = [6 x i8] c"OUTER\00"
@.str.86 = [5 x i8] c"PLAN\00"
@.str.87 = [7 x i8] c"PRAGMA\00"
@.str.88 = [8 x i8] c"PRIMARY\00"
@.str.89 = [6 x i8] c"QUERY\00"
@.str.90 = [6 x i8] c"RAISE\00"
@.str.91 = [10 x i8] c"RECURSIVE\00"
@.str.92 = [11 x i8] c"REFERENCES\00"
@.str.93 = [7 x i8] c"REGEXP\00"
@.str.94 = [8 x i8] c"REINDEX\00"
@.str.95 = [8 x i8] c"RELEASE\00"
@.str.96 = [7 x i8] c"RENAME\00"
@.str.97 = [8 x i8] c"REPLACE\00"
@.str.98 = [9 x i8] c"RESTRICT\00"
@.str.99 = [6 x i8] c"RIGHT\00"
@.str.100 = [9 x i8] c"ROLLBACK\00"
@.str.101 = [4 x i8] c"ROW\00"
@.str.102 = [10 x i8] c"SAVEPOINT\00"
@.str.103 = [7 x i8] c"SELECT\00"
@.str.104 = [4 x i8] c"SET\00"
@.str.105 = [6 x i8] c"TABLE\00"
@.str.106 = [5 x i8] c"TEMP\00"
@.str.107 = [10 x i8] c"TEMPORARY\00"
@.str.108 = [5 x i8] c"THEN\00"
@.str.109 = [3 x i8] c"TO\00"
@.str.110 = [12 x i8] c"TRANSACTION\00"
@.str.111 = [8 x i8] c"TRIGGER\00"
@.str.112 = [6 x i8] c"UNION\00"
@.str.113 = [7 x i8] c"UNIQUE\00"
@.str.114 = [7 x i8] c"UPDATE\00"
@.str.115 = [6 x i8] c"USING\00"
@.str.116 = [7 x i8] c"VACUUM\00"
@.str.117 = [7 x i8] c"VALUES\00"
@.str.118 = [5 x i8] c"VIEW\00"
@.str.119 = [8 x i8] c"VIRTUAL\00"
@.str.120 = [5 x i8] c"WHEN\00"
@.str.121 = [6 x i8] c"WHERE\00"
@.str.122 = [5 x i8] c"WITH\00"
@.str.123 = [8 x i8] c"WITHOUT\00"
@.str.124 = [5 x i8] c"\22%w\22\00"
@.str.125 = [3 x i8] c"%s\00"
define i8* @safeId(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %9
store i32 0, i32* %8
br label %10
10: ; preds = %40, %1
%11 = load i8*, i8** %3
%12 = load i32, i32* %8
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
store i32 %16, i32* %7
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %43
18: ; preds = %10
%19 = load i32, i32* %7
%20 = call i32 @isalpha(i32 %19)
%21 = icmp ne i32 %20, 0
br i1 %21, label %39, label %22
22: ; preds = %18
%23 = load i32, i32* %7
%24 = icmp ne i32 %23, 95
br i1 %24, label %25, label %39
25: ; preds = %22
%26 = load i32, i32* %8
%27 = icmp sgt i32 %26, 0
br i1 %27, label %28, label %35
28: ; preds = %25
%29 = load i32, i32* %7
%30 = call i64 @isdigit(i32 %29)
%31 = icmp ne i64 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %28
%33 = load i32, i32* %9
%34 = add nsw i32 %33, 1
store i32 %34, i32* %9
br label %38
35: ; preds = %28, %25
%36 = load i8*, i8** %3
%37 = call i8* @sqlite3_mprintf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.124, i64 0, i64 0), i8* %36)
store i8* %37, i8** %2
br label %83
38: ; preds = %32
br label %39
39: ; preds = %38, %22, %18
br label %40
40: ; preds = %39
%41 = load i32, i32* %8
%42 = add nsw i32 %41, 1
store i32 %42, i32* %8
br label %10
43: ; preds = %10
%44 = load i32, i32* %9
%45 = icmp ne i32 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %43
%47 = load i8*, i8** %3
%48 = call i8* @sqlite3_mprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.125, i64 0, i64 0), i8* %47)
store i8* %48, i8** %2
br label %83
49: ; preds = %43
store i32 0, i32* %4
store i32 123, i32* %5
br label %50
50: ; preds = %79, %49
%51 = load i32, i32* %4
%52 = load i32, i32* %5
%53 = icmp sle i32 %51, %52
br i1 %53, label %54, label %80
54: ; preds = %50
%55 = load i32, i32* %4
%56 = load i32, i32* %5
%57 = add nsw i32 %55, %56
%58 = sdiv i32 %57, 2
store i32 %58, i32* %6
%59 = load i32, i32* %6
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [124 x i8*], [124 x i8*]* @safeId.azKeywords, i64 0, i64 %60
%62 = load i8*, i8** %61
%63 = load i8*, i8** %3
%64 = call i32 @sqlite3_stricmp(i8* %62, i8* %63)
store i32 %64, i32* %7
%65 = load i32, i32* %7
%66 = icmp eq i32 %65, 0
br i1 %66, label %67, label %70
67: ; preds = %54
%68 = load i8*, i8** %3
%69 = call i8* @sqlite3_mprintf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.124, i64 0, i64 0), i8* %68)
store i8* %69, i8** %2
br label %83
70: ; preds = %54
%71 = load i32, i32* %7
%72 = icmp slt i32 %71, 0
br i1 %72, label %73, label %76
73: ; preds = %70
%74 = load i32, i32* %6
%75 = add nsw i32 %74, 1
store i32 %75, i32* %4
br label %79
76: ; preds = %70
%77 = load i32, i32* %6
%78 = sub nsw i32 %77, 1
store i32 %78, i32* %5
br label %79
79: ; preds = %76, %73
br label %50
80: ; preds = %50
%81 = load i8*, i8** %3
%82 = call i8* @sqlite3_mprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.125, i64 0, i64 0), i8* %81)
store i8* %82, i8** %2
br label %83
83: ; preds = %80, %67, %46, %35
%84 = load i8*, i8** %2
ret i8* %84
}

LLVM IR (-O2):
@reltable.safeId = internal unnamed_addr constant [124 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.1 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.2 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.3 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.4 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.5 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.6 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.7 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.8 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.9 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.10 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.11 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.12 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.13 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.14 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.15 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.16 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.17 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.18 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.19 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.20 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.21 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.22 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.23 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.24 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.25 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.26 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.27 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.28 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.29 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.30 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.31 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.32 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.33 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.34 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.35 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.36 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.37 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.38 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.39 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.40 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.41 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.42 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.43 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.44 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.45 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.46 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.47 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.48 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.49 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.50 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.51 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.52 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.53 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.54 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.55 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.56 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.57 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.58 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.59 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.60 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.61 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.62 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.63 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.64 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.65 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.66 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.67 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.68 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.69 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.70 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.71 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.72 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.73 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.74 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.75 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.76 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.77 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.78 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.79 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.80 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.81 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.82 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.83 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.84 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.85 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.86 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.87 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.88 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.89 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.90 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.91 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.92 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.93 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.94 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.95 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.96 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.97 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.98 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.99 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.100 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.101 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.102 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.103 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.104 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.105 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.106 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.107 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.108 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.109 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.110 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.111 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.112 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.113 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.114 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.115 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.116 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.117 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.118 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.119 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.120 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.121 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.122 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.123 to i64), i64 ptrtoint ([124 x i32]* @reltable.safeId to i64)) to i32)]
@.str = [6 x i8] c"ABORT\00"
@.str.1 = [7 x i8] c"ACTION\00"
@.str.2 = [4 x i8] c"ADD\00"
@.str.3 = [6 x i8] c"AFTER\00"
@.str.4 = [4 x i8] c"ALL\00"
@.str.5 = [6 x i8] c"ALTER\00"
@.str.6 = [8 x i8] c"ANALYZE\00"
@.str.7 = [4 x i8] c"AND\00"
@.str.8 = [3 x i8] c"AS\00"
@.str.9 = [4 x i8] c"ASC\00"
@.str.10 = [7 x i8] c"ATTACH\00"
@.str.11 = [14 x i8] c"AUTOINCREMENT\00"
@.str.12 = [7 x i8] c"BEFORE\00"
@.str.13 = [6 x i8] c"BEGIN\00"
@.str.14 = [8 x i8] c"BETWEEN\00"
@.str.15 = [3 x i8] c"BY\00"
@.str.16 = [8 x i8] c"CASCADE\00"
@.str.17 = [5 x i8] c"CASE\00"
@.str.18 = [5 x i8] c"CAST\00"
@.str.19 = [6 x i8] c"CHECK\00"
@.str.20 = [8 x i8] c"COLLATE\00"
@.str.21 = [7 x i8] c"COLUMN\00"
@.str.22 = [7 x i8] c"COMMIT\00"
@.str.23 = [9 x i8] c"CONFLICT\00"
@.str.24 = [11 x i8] c"CONSTRAINT\00"
@.str.25 = [7 x i8] c"CREATE\00"
@.str.26 = [6 x i8] c"CROSS\00"
@.str.27 = [13 x i8] c"CURRENT_DATE\00"
@.str.28 = [13 x i8] c"CURRENT_TIME\00"
@.str.29 = [18 x i8] c"CURRENT_TIMESTAMP\00"
@.str.30 = [9 x i8] c"DATABASE\00"
@.str.31 = [8 x i8] c"DEFAULT\00"
@.str.32 = [11 x i8] c"DEFERRABLE\00"
@.str.33 = [9 x i8] c"DEFERRED\00"
@.str.34 = [7 x i8] c"DELETE\00"
@.str.35 = [5 x i8] c"DESC\00"
@.str.36 = [7 x i8] c"DETACH\00"
@.str.37 = [9 x i8] c"DISTINCT\00"
@.str.38 = [5 x i8] c"DROP\00"
@.str.39 = [5 x i8] c"EACH\00"
@.str.40 = [5 x i8] c"ELSE\00"
@.str.41 = [4 x i8] c"END\00"
@.str.42 = [7 x i8] c"ESCAPE\00"
@.str.43 = [7 x i8] c"EXCEPT\00"
@.str.44 = [10 x i8] c"EXCLUSIVE\00"
@.str.45 = [7 x i8] c"EXISTS\00"
@.str.46 = [8 x i8] c"EXPLAIN\00"
@.str.47 = [5 x i8] c"FAIL\00"
@.str.48 = [4 x i8] c"FOR\00"
@.str.49 = [8 x i8] c"FOREIGN\00"
@.str.50 = [5 x i8] c"FROM\00"
@.str.51 = [5 x i8] c"FULL\00"
@.str.52 = [5 x i8] c"GLOB\00"
@.str.53 = [6 x i8] c"GROUP\00"
@.str.54 = [7 x i8] c"HAVING\00"
@.str.55 = [3 x i8] c"IF\00"
@.str.56 = [7 x i8] c"IGNORE\00"
@.str.57 = [10 x i8] c"IMMEDIATE\00"
@.str.58 = [3 x i8] c"IN\00"
@.str.59 = [6 x i8] c"INDEX\00"
@.str.60 = [8 x i8] c"INDEXED\00"
@.str.61 = [10 x i8] c"INITIALLY\00"
@.str.62 = [6 x i8] c"INNER\00"
@.str.63 = [7 x i8] c"INSERT\00"
@.str.64 = [8 x i8] c"INSTEAD\00"
@.str.65 = [10 x i8] c"INTERSECT\00"
@.str.66 = [5 x i8] c"INTO\00"
@.str.67 = [3 x i8] c"IS\00"
@.str.68 = [7 x i8] c"ISNULL\00"
@.str.69 = [5 x i8] c"JOIN\00"
@.str.70 = [4 x i8] c"KEY\00"
@.str.71 = [5 x i8] c"LEFT\00"
@.str.72 = [5 x i8] c"LIKE\00"
@.str.73 = [6 x i8] c"LIMIT\00"
@.str.74 = [6 x i8] c"MATCH\00"
@.str.75 = [8 x i8] c"NATURAL\00"
@.str.76 = [3 x i8] c"NO\00"
@.str.77 = [4 x i8] c"NOT\00"
@.str.78 = [8 x i8] c"NOTNULL\00"
@.str.79 = [5 x i8] c"NULL\00"
@.str.80 = [3 x i8] c"OF\00"
@.str.81 = [7 x i8] c"OFFSET\00"
@.str.82 = [3 x i8] c"ON\00"
@.str.83 = [3 x i8] c"OR\00"
@.str.84 = [6 x i8] c"ORDER\00"
@.str.85 = [6 x i8] c"OUTER\00"
@.str.86 = [5 x i8] c"PLAN\00"
@.str.87 = [7 x i8] c"PRAGMA\00"
@.str.88 = [8 x i8] c"PRIMARY\00"
@.str.89 = [6 x i8] c"QUERY\00"
@.str.90 = [6 x i8] c"RAISE\00"
@.str.91 = [10 x i8] c"RECURSIVE\00"
@.str.92 = [11 x i8] c"REFERENCES\00"
@.str.93 = [7 x i8] c"REGEXP\00"
@.str.94 = [8 x i8] c"REINDEX\00"
@.str.95 = [8 x i8] c"RELEASE\00"
@.str.96 = [7 x i8] c"RENAME\00"
@.str.97 = [8 x i8] c"REPLACE\00"
@.str.98 = [9 x i8] c"RESTRICT\00"
@.str.99 = [6 x i8] c"RIGHT\00"
@.str.100 = [9 x i8] c"ROLLBACK\00"
@.str.101 = [4 x i8] c"ROW\00"
@.str.102 = [10 x i8] c"SAVEPOINT\00"
@.str.103 = [7 x i8] c"SELECT\00"
@.str.104 = [4 x i8] c"SET\00"
@.str.105 = [6 x i8] c"TABLE\00"
@.str.106 = [5 x i8] c"TEMP\00"
@.str.107 = [10 x i8] c"TEMPORARY\00"
@.str.108 = [5 x i8] c"THEN\00"
@.str.109 = [3 x i8] c"TO\00"
@.str.110 = [12 x i8] c"TRANSACTION\00"
@.str.111 = [8 x i8] c"TRIGGER\00"
@.str.112 = [6 x i8] c"UNION\00"
@.str.113 = [7 x i8] c"UNIQUE\00"
@.str.114 = [7 x i8] c"UPDATE\00"
@.str.115 = [6 x i8] c"USING\00"
@.str.116 = [7 x i8] c"VACUUM\00"
@.str.117 = [7 x i8] c"VALUES\00"
@.str.118 = [5 x i8] c"VIEW\00"
@.str.119 = [8 x i8] c"VIRTUAL\00"
@.str.120 = [5 x i8] c"WHEN\00"
@.str.121 = [6 x i8] c"WHERE\00"
@.str.122 = [5 x i8] c"WITH\00"
@.str.123 = [8 x i8] c"WITHOUT\00"
@.str.124 = [5 x i8] c"\22%w\22\00"
@.str.125 = [3 x i8] c"%s\00"
define i8* @safeId(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %28, label %4
4: ; preds = %1, %20
%5 = phi i64 [ %22, %20 ], [ 0, %1 ]
%6 = phi i8 [ %24, %20 ], [ %2, %1 ]
%7 = phi i32 [ %21, %20 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = tail call i32 @isalpha(i32 %8)
%10 = icmp eq i32 %9, 0
%11 = icmp ne i8 %6, 95
%12 = select i1 %10, i1 %11, i1 false
br i1 %12, label %13, label %20
13: ; preds = %4
%14 = icmp eq i64 %5, 0
br i1 %14, label %46, label %15
15: ; preds = %13
%16 = tail call i64 @isdigit(i32 %8)
%17 = icmp eq i64 %16, 0
br i1 %17, label %46, label %18
18: ; preds = %15
%19 = add nsw i32 %7, 1
br label %20
20: ; preds = %4, %18
%21 = phi i32 [ %19, %18 ], [ %7, %4 ]
%22 = add nuw i64 %5, 1
%23 = getelementptr inbounds i8, i8* %0, i64 %22
%24 = load i8, i8* %23
%25 = icmp eq i8 %24, 0
br i1 %25, label %26, label %4
26: ; preds = %20
%27 = icmp eq i32 %21, 0
br i1 %27, label %28, label %46
28: ; preds = %1, %26
br label %29
29: ; preds = %28, %39
%30 = phi i32 [ %44, %39 ], [ 123, %28 ]
%31 = phi i32 [ %43, %39 ], [ 0, %28 ]
%32 = add nsw i32 %30, %31
%33 = sdiv i32 %32, 2
%34 = sext i32 %33 to i64
%35 = shl i64 %34, 2
%36 = call i8* @llvm.load.relative.i64(i8* bitcast ([124 x i32]* @reltable.safeId to i8*), i64 %35)
%37 = tail call i32 @sqlite3_stricmp(i8* %36, i8* %0)
%38 = icmp eq i32 %37, 0
br i1 %38, label %46, label %39
39: ; preds = %29
%40 = icmp slt i32 %37, 0
%41 = add nsw i32 %33, 1
%42 = add nsw i32 %33, -1
%43 = select i1 %40, i32 %41, i32 %31
%44 = select i1 %40, i32 %30, i32 %42
%45 = icmp sgt i32 %43, %44
br i1 %45, label %46, label %29
46: ; preds = %13, %15, %39, %29, %26
%47 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.125, i64 0, i64 0), %26 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.124, i64 0, i64 0), %29 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.125, i64 0, i64 0), %39 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.124, i64 0, i64 0), %15 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.124, i64 0, i64 0), %13 ]
%48 = tail call i8* @sqlite3_mprintf(i8* %47, i8* %0)
ret i8* %48
}