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


x86 assembly (clang, -O0):
<update>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    113f <update+0x2f>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xec6(%rip),%rsi
call   1030 <sprintf@plt>
cmpl   $0x1,-0x10(%rbp)
jne    115c <update+0x4c>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed6(%rip),%rsi
call   1030 <sprintf@plt>
cmpl   $0x2,-0x10(%rbp)
jne    1179 <update+0x69>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xee3(%rip),%rsi
call   1030 <sprintf@plt>
cmpl   $0x3,-0x10(%rbp)
jne    1196 <update+0x86>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xef5(%rip),%rsi
call   1030 <sprintf@plt>
cmpl   $0x4,-0x10(%rbp)
jne    11b3 <update+0xa3>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xf06(%rip),%rsi
call   1030 <sprintf@plt>
cmpl   $0x5,-0x10(%rbp)
jne    11d0 <update+0xc0>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xf12(%rip),%rsi
call   1030 <sprintf@plt>
cmpl   $0x6,-0x10(%rbp)
jne    11ed <update+0xdd>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xf1f(%rip),%rsi
call   1030 <sprintf@plt>
cmpl   $0x7,-0x10(%rbp)
jne    120a <update+0xfa>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xf31(%rip),%rsi
call   1030 <sprintf@plt>
cmpl   $0x8,-0x10(%rbp)
jne    1227 <update+0x117>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xf3f(%rip),%rsi
call   1030 <sprintf@plt>
cmpl   $0x9,-0x10(%rbp)
jne    1244 <update+0x134>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xf4c(%rip),%rsi
call   1030 <sprintf@plt>
cmpl   $0xa,-0x10(%rbp)
jne    1261 <update+0x151>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xf57(%rip),%rsi
call   1030 <sprintf@plt>
cmpl   $0xb,-0x10(%rbp)
jne    127e <update+0x16e>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xf69(%rip),%rsi
call   1030 <sprintf@plt>
cmpl   $0xc,-0x10(%rbp)
jne    129b <update+0x18b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xf7c(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update>:
cmp    $0xc,%edx
ja     112f <update+0x1f>
mov    %esi,%eax
movslq %edx,%rcx
lea    0x111f(%rip),%rdx
movslq (%rdx,%rcx,4),%rsi
add    %rdx,%rsi
mov    %eax,%edx
jmp    1030 <sprintf@plt>
ret

LLVM IR (-O0):
@.str = [45 x i8] c"select adjective from words where rowid='%d'\00"
@.str.1 = [42 x i8] c"select adverb from words where rowid='%d'\00"
@.str.2 = [47 x i8] c"select conjunction from words where rowid='%d'\00"
@.str.3 = [46 x i8] c"select determiner from words where rowid='%d'\00"
@.str.4 = [41 x i8] c"select nouns from words where rowid='%d'\00"
@.str.5 = [42 x i8] c"select prefix from words where rowid='%d'\00"
@.str.6 = [47 x i8] c"select preposition from words where rowid='%d'\00"
@.str.7 = [43 x i8] c"select pronoun from words where rowid='%d'\00"
@.str.8 = [42 x i8] c"select suffix from words where rowid='%d'\00"
@.str.9 = [40 x i8] c"select verb from words where rowid='%d'\00"
@.str.10 = [47 x i8] c"select punctuation from words where rowid='%d'\00"
@.str.11 = [48 x i8] c"select intergection from words where rowid='%d'\00"
@.str.12 = [43 x i8] c"select unknown from words where rowid='%d'\00"
define void @update(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %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 i32, i32* %5
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %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 i32, i32* %5
%19 = call i32 @sprintf(i8* %17, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %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 i32, i32* %5
%26 = call i32 @sprintf(i8* %24, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i32 %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 i32, i32* %5
%33 = call i32 @sprintf(i8* %31, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), i32 %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 i32, i32* %5
%40 = call i32 @sprintf(i8* %38, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), i32 %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 i32, i32* %5
%47 = call i32 @sprintf(i8* %45, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i32 %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 i32, i32* %5
%54 = call i32 @sprintf(i8* %52, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0), i32 %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 i32, i32* %5
%61 = call i32 @sprintf(i8* %59, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), i32 %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 i32, i32* %5
%68 = call i32 @sprintf(i8* %66, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0), i32 %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 i32, i32* %5
%75 = call i32 @sprintf(i8* %73, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), i32 %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 i32, i32* %5
%82 = call i32 @sprintf(i8* %80, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0), i32 %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 i32, i32* %5
%89 = call i32 @sprintf(i8* %87, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.11, i64 0, i64 0), i32 %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 i32, i32* %5
%96 = call i32 @sprintf(i8* %94, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0), i32 %95)
br label %97
97: ; preds = %93, %90
ret void
}

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