#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*/ sprintf(char *, char *, char *);
void update(char queries[100], char s2[], int i) {
  if (i == 0)
    sprintf(queries, "select rowid from words where adjective='%s'", s2);
  if (i == 1)
    sprintf(queries, "select rowid from words where adverb='%s'", s2);
  if (i == 2)
    sprintf(queries, "select rowid from words where conjunction='%s'", s2);
  if (i == 3)
    sprintf(queries, "select rowid from words where determiner='%s'", s2);
  if (i == 4)
    sprintf(queries, "select rowid from words where nouns='%s'", s2);
  if (i == 5)
    sprintf(queries, "select rowid from words where prefix='%s'", s2);
  if (i == 6)
    sprintf(queries, "select rowid from words where preposition='%s'", s2);
  if (i == 7)
    sprintf(queries, "select rowid from words where pronoun='%s'", s2);
  if (i == 8)
    sprintf(queries, "select rowid from words where suffix='%s'", s2);
  if (i == 9)
    sprintf(queries, "select rowid from words where verb='%s'", s2);
  if (i == 10)
    sprintf(queries, "select rowid from words where punctuation='%s'", s2);
  if (i == 11)
    sprintf(queries, "select rowid from words where intergection='%s'", s2);
  if (i == 12)
    sprintf(queries, "select rowid from words where unknown='%s'", s2);
  if (i == -1)
    sprintf(queries, "select rowid from words where unknown='%s'", s2);
}


x86 assembly (clang, -O0):
<update>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1141 <update+0x31>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xec4(%rip),%rsi
call   1030 <sprintf@plt>
cmpl   $0x1,-0x14(%rbp)
jne    115f <update+0x4f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rsi
call   1030 <sprintf@plt>
cmpl   $0x2,-0x14(%rbp)
jne    117d <update+0x6d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xedf(%rip),%rsi
call   1030 <sprintf@plt>
cmpl   $0x3,-0x14(%rbp)
jne    119b <update+0x8b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xef0(%rip),%rsi
call   1030 <sprintf@plt>
cmpl   $0x4,-0x14(%rbp)
jne    11b9 <update+0xa9>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xf00(%rip),%rsi
call   1030 <sprintf@plt>
cmpl   $0x5,-0x14(%rbp)
jne    11d7 <update+0xc7>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xf0b(%rip),%rsi
call   1030 <sprintf@plt>
cmpl   $0x6,-0x14(%rbp)
jne    11f5 <update+0xe5>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xf17(%rip),%rsi
call   1030 <sprintf@plt>
cmpl   $0x7,-0x14(%rbp)
jne    1213 <update+0x103>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xf28(%rip),%rsi
call   1030 <sprintf@plt>
cmpl   $0x8,-0x14(%rbp)
jne    1231 <update+0x121>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xf35(%rip),%rsi
call   1030 <sprintf@plt>
cmpl   $0x9,-0x14(%rbp)
jne    124f <update+0x13f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xf41(%rip),%rsi
call   1030 <sprintf@plt>
cmpl   $0xa,-0x14(%rbp)
jne    126d <update+0x15d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xf4b(%rip),%rsi
call   1030 <sprintf@plt>
cmpl   $0xb,-0x14(%rbp)
jne    128b <update+0x17b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xf5c(%rip),%rsi
call   1030 <sprintf@plt>
cmpl   $0xc,-0x14(%rbp)
jne    12a9 <update+0x199>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xf6e(%rip),%rsi
call   1030 <sprintf@plt>
cmpl   $0xffffffff,-0x14(%rbp)
jne    12c7 <update+0x1b7>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xf50(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update>:
add    $0x1,%edx
cmp    $0xd,%edx
ja     1134 <update+0x24>
mov    %rsi,%rax
movslq %edx,%rcx
lea    0x111b(%rip),%rdx
movslq (%rdx,%rcx,4),%rsi
add    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <sprintf@plt>
ret

LLVM IR (-O0):
@.str = [45 x i8] c"select rowid from words where adjective='%s'\00"
@.str.1 = [42 x i8] c"select rowid from words where adverb='%s'\00"
@.str.2 = [47 x i8] c"select rowid from words where conjunction='%s'\00"
@.str.3 = [46 x i8] c"select rowid from words where determiner='%s'\00"
@.str.4 = [41 x i8] c"select rowid from words where nouns='%s'\00"
@.str.5 = [42 x i8] c"select rowid from words where prefix='%s'\00"
@.str.6 = [47 x i8] c"select rowid from words where preposition='%s'\00"
@.str.7 = [43 x i8] c"select rowid from words where pronoun='%s'\00"
@.str.8 = [42 x i8] c"select rowid from words where suffix='%s'\00"
@.str.9 = [40 x i8] c"select rowid from words where verb='%s'\00"
@.str.10 = [47 x i8] c"select rowid from words where punctuation='%s'\00"
@.str.11 = [48 x i8] c"select rowid from words where intergection='%s'\00"
@.str.12 = [43 x i8] c"select rowid from words where unknown='%s'\00"
define void @update(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %9, %3
%14 = load i32, i32* %6
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i8*, i8** %4
%18 = load i8*, i8** %5
%19 = call i32 @sprintf(i8* %17, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %16, %13
%21 = load i32, i32* %6
%22 = icmp eq i32 %21, 2
br i1 %22, label %23, label %27
23: ; preds = %20
%24 = load i8*, i8** %4
%25 = load i8*, i8** %5
%26 = call i32 @sprintf(i8* %24, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i8* %25)
br label %27
27: ; preds = %23, %20
%28 = load i32, i32* %6
%29 = icmp eq i32 %28, 3
br i1 %29, label %30, label %34
30: ; preds = %27
%31 = load i8*, i8** %4
%32 = load i8*, i8** %5
%33 = call i32 @sprintf(i8* %31, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), i8* %32)
br label %34
34: ; preds = %30, %27
%35 = load i32, i32* %6
%36 = icmp eq i32 %35, 4
br i1 %36, label %37, label %41
37: ; preds = %34
%38 = load i8*, i8** %4
%39 = load i8*, i8** %5
%40 = call i32 @sprintf(i8* %38, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), i8* %39)
br label %41
41: ; preds = %37, %34
%42 = load i32, i32* %6
%43 = icmp eq i32 %42, 5
br i1 %43, label %44, label %48
44: ; preds = %41
%45 = load i8*, i8** %4
%46 = load i8*, i8** %5
%47 = call i32 @sprintf(i8* %45, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i8* %46)
br label %48
48: ; preds = %44, %41
%49 = load i32, i32* %6
%50 = icmp eq i32 %49, 6
br i1 %50, label %51, label %55
51: ; preds = %48
%52 = load i8*, i8** %4
%53 = load i8*, i8** %5
%54 = call i32 @sprintf(i8* %52, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0), i8* %53)
br label %55
55: ; preds = %51, %48
%56 = load i32, i32* %6
%57 = icmp eq i32 %56, 7
br i1 %57, label %58, label %62
58: ; preds = %55
%59 = load i8*, i8** %4
%60 = load i8*, i8** %5
%61 = call i32 @sprintf(i8* %59, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), i8* %60)
br label %62
62: ; preds = %58, %55
%63 = load i32, i32* %6
%64 = icmp eq i32 %63, 8
br i1 %64, label %65, label %69
65: ; preds = %62
%66 = load i8*, i8** %4
%67 = load i8*, i8** %5
%68 = call i32 @sprintf(i8* %66, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0), i8* %67)
br label %69
69: ; preds = %65, %62
%70 = load i32, i32* %6
%71 = icmp eq i32 %70, 9
br i1 %71, label %72, label %76
72: ; preds = %69
%73 = load i8*, i8** %4
%74 = load i8*, i8** %5
%75 = call i32 @sprintf(i8* %73, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), i8* %74)
br label %76
76: ; preds = %72, %69
%77 = load i32, i32* %6
%78 = icmp eq i32 %77, 10
br i1 %78, label %79, label %83
79: ; preds = %76
%80 = load i8*, i8** %4
%81 = load i8*, i8** %5
%82 = call i32 @sprintf(i8* %80, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0), i8* %81)
br label %83
83: ; preds = %79, %76
%84 = load i32, i32* %6
%85 = icmp eq i32 %84, 11
br i1 %85, label %86, label %90
86: ; preds = %83
%87 = load i8*, i8** %4
%88 = load i8*, i8** %5
%89 = call i32 @sprintf(i8* %87, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.11, i64 0, i64 0), i8* %88)
br label %90
90: ; preds = %86, %83
%91 = load i32, i32* %6
%92 = icmp eq i32 %91, 12
br i1 %92, label %93, label %97
93: ; preds = %90
%94 = load i8*, i8** %4
%95 = load i8*, i8** %5
%96 = call i32 @sprintf(i8* %94, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0), i8* %95)
br label %97
97: ; preds = %93, %90
%98 = load i32, i32* %6
%99 = icmp eq i32 %98, -1
br i1 %99, label %100, label %104
100: ; preds = %97
%101 = load i8*, i8** %4
%102 = load i8*, i8** %5
%103 = call i32 @sprintf(i8* %101, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0), i8* %102)
br label %104
104: ; preds = %100, %97
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"select rowid from words where adjective='%s'\00"
@.str.1 = [42 x i8] c"select rowid from words where adverb='%s'\00"
@.str.2 = [47 x i8] c"select rowid from words where conjunction='%s'\00"
@.str.3 = [46 x i8] c"select rowid from words where determiner='%s'\00"
@.str.4 = [41 x i8] c"select rowid from words where nouns='%s'\00"
@.str.5 = [42 x i8] c"select rowid from words where prefix='%s'\00"
@.str.6 = [47 x i8] c"select rowid from words where preposition='%s'\00"
@.str.7 = [43 x i8] c"select rowid from words where pronoun='%s'\00"
@.str.8 = [42 x i8] c"select rowid from words where suffix='%s'\00"
@.str.9 = [40 x i8] c"select rowid from words where verb='%s'\00"
@.str.10 = [47 x i8] c"select rowid from words where punctuation='%s'\00"
@.str.11 = [48 x i8] c"select rowid from words where intergection='%s'\00"
@.str.12 = [43 x i8] c"select rowid from words where unknown='%s'\00"
@reltable.update = [14 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([43 x i8]* @.str.12 to i64), i64 ptrtoint ([14 x i32]* @reltable.update to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([45 x i8]* @.str to i64), i64 ptrtoint ([14 x i32]* @reltable.update to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([42 x i8]* @.str.1 to i64), i64 ptrtoint ([14 x i32]* @reltable.update to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([47 x i8]* @.str.2 to i64), i64 ptrtoint ([14 x i32]* @reltable.update to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([46 x i8]* @.str.3 to i64), i64 ptrtoint ([14 x i32]* @reltable.update to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([41 x i8]* @.str.4 to i64), i64 ptrtoint ([14 x i32]* @reltable.update to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([42 x i8]* @.str.5 to i64), i64 ptrtoint ([14 x i32]* @reltable.update to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([47 x i8]* @.str.6 to i64), i64 ptrtoint ([14 x i32]* @reltable.update to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([43 x i8]* @.str.7 to i64), i64 ptrtoint ([14 x i32]* @reltable.update to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([42 x i8]* @.str.8 to i64), i64 ptrtoint ([14 x i32]* @reltable.update to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([40 x i8]* @.str.9 to i64), i64 ptrtoint ([14 x i32]* @reltable.update to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([47 x i8]* @.str.10 to i64), i64 ptrtoint ([14 x i32]* @reltable.update to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([48 x i8]* @.str.11 to i64), i64 ptrtoint ([14 x i32]* @reltable.update to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([43 x i8]* @.str.12 to i64), i64 ptrtoint ([14 x i32]* @reltable.update to i64)) to i32)]
define void @update(i8* nocapture writeonly %0, i8* %1, i32 %2) {
%4 = add i32 %2, 1
%5 = icmp ult i32 %4, 14
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = sext i32 %4 to i64
%8 = shl i64 %7, 2
%9 = call i8* @llvm.load.relative.i64(i8* bitcast ([14 x i32]* @reltable.update to i8*), i64 %8)
%10 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) %9, i8* %1)
br label %11
11: ; preds = %3, %6
ret void
}