; LLVM IR from ibr-ds/STANlite :: Enclave/sqlite (alter)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.Parse = type { ptr, ptr, ptr, i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, %struct.Token, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i8, i8, i8, [10 x %struct.yColCache], [8 x i32], %struct.Token, %struct.Token, i16, i8, i8, i8, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, %struct.Token, ptr, ptr, ptr, ptr, ptr }
%struct.yColCache = type { i32, i16, i8, i32, i32, i32 }
%struct.Token = type { ptr, i32 }
%struct.sqlite3 = type { ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i64, i32, i32, i32, i32, i16, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i32, [12 x i32], i32, %struct.sqlite3InitInfo, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %union.anon.0, %struct.Lookaside, ptr, ptr, ptr, ptr, i32, i32, %struct.Hash, ptr, ptr, ptr, %struct.Hash, %struct.Hash, %struct.BusyHandler, [2 x %struct.Db], ptr, i32, i32, i32, i64, i64, ptr }
%struct.sqlite3InitInfo = type { i32, i8, i8, i8, i8 }
%union.anon.0 = type { double }
%struct.Lookaside = type { i32, i16, i8, i32, i32, [3 x i32], ptr, ptr, ptr }
%struct.Hash = type { i32, i32, ptr, ptr }
%struct.BusyHandler = type { ptr, ptr, i32 }
%struct.Db = type { ptr, ptr, i8, i8, ptr }
%struct.SrcList = type { i32, i32, [1 x %struct.SrcList_item] }
%struct.SrcList_item = type { ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, %struct.anon, i8, i32, ptr, ptr, i64, %union.anon.1, ptr }
%struct.anon = type { i8, i8, [2 x i8] }
%union.anon.1 = type { ptr }
%struct.Table = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i16, i16, i16, i16, i8, i32, i32, ptr, ptr, ptr, ptr, ptr }
%struct.VTable = type { ptr, ptr, ptr, i32, i8, i32, ptr }
%struct.sqlite3_vtab = type { ptr, i32, ptr }
%struct.sqlite3_module = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.FKey = type { ptr, ptr, ptr, ptr, ptr, i32, i8, [2 x i8], [2 x ptr], [1 x %struct.sColMap] }
%struct.sColMap = type { i32, ptr }

@.str.3 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [384 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [92 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @sqlite3AlterRenameTable(ptr noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.Parse, ptr %21, i32 0, i32 0
  %23 = load ptr, ptr %22, align 8, !tbaa !9
  store ptr %23, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  store ptr null, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  store ptr null, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  %24 = load ptr, ptr %11, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.sqlite3, ptr %24, i32 0, i32 6
  %26 = load i32, ptr %25, align 4, !tbaa !14
  store i32 %26, ptr %17, align 4, !tbaa !21
  %27 = load ptr, ptr %11, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.sqlite3, ptr %27, i32 0, i32 17
  %29 = load i8, ptr %28, align 1, !tbaa !22
  %30 = icmp ne i8 %29, 0
  br i1 %30, label %31, label %32

31:                                               ; preds = %3
  br label %265

32:                                               ; preds = %3
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.SrcList, ptr %34, i32 0, i32 2
  %36 = getelementptr inbounds [1 x %struct.SrcList_item], ptr %35, i64 0, i64 0
  %37 = call ptr @sqlite3LocateTableItem(ptr noundef %33, i32 noundef 0, ptr noundef %36)
  store ptr %37, ptr %9, align 8, !tbaa !5
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  %39 = icmp ne ptr %38, null
  br i1 %39, label %41, label %40

40:                                               ; preds = %32
  br label %265

41:                                               ; preds = %32
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.Parse, ptr %42, i32 0, i32 0
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  %45 = load ptr, ptr %9, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.Table, ptr %45, i32 0, i32 20
  %47 = load ptr, ptr %46, align 8, !tbaa !23
  %48 = call i32 @sqlite3SchemaToIndex(ptr noundef %44, ptr noundef %47)
  store i32 %48, ptr %7, align 4, !tbaa !21
  %49 = load ptr, ptr %11, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.sqlite3, ptr %49, i32 0, i32 4
  %51 = load ptr, ptr %50, align 8, !tbaa !25
  %52 = load i32, ptr %7, align 4, !tbaa !21
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds %struct.Db, ptr %51, i64 %53
  %55 = getelementptr inbounds %struct.Db, ptr %54, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8, !tbaa !26
  store ptr %56, ptr %8, align 8, !tbaa !5
  %57 = load ptr, ptr %11, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.sqlite3, ptr %57, i32 0, i32 6
  %59 = load i32, ptr %58, align 4, !tbaa !14
  %60 = or i32 %59, 2097152
  store i32 %60, ptr %58, align 4, !tbaa !14
  %61 = load ptr, ptr %11, align 8, !tbaa !5
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = call ptr @sqlite3NameFromToken(ptr noundef %61, ptr noundef %62)
  store ptr %63, ptr %10, align 8, !tbaa !5
  %64 = load ptr, ptr %10, align 8, !tbaa !5
  %65 = icmp ne ptr %64, null
  br i1 %65, label %67, label %66

66:                                               ; preds = %41
  br label %265

67:                                               ; preds = %41
  %68 = load ptr, ptr %11, align 8, !tbaa !5
  %69 = load ptr, ptr %10, align 8, !tbaa !5
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  %71 = call ptr @sqlite3FindTable(ptr noundef %68, ptr noundef %69, ptr noundef %70)
  %72 = icmp ne ptr %71, null
  br i1 %72, label %79, label %73

73:                                               ; preds = %67
  %74 = load ptr, ptr %11, align 8, !tbaa !5
  %75 = load ptr, ptr %10, align 8, !tbaa !5
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = call ptr @sqlite3FindIndex(ptr noundef %74, ptr noundef %75, ptr noundef %76)
  %78 = icmp ne ptr %77, null
  br i1 %78, label %79, label %82

79:                                               ; preds = %73, %67
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = load ptr, ptr %10, align 8, !tbaa !5
  call void (ptr, ptr, ...) @sqlite3ErrorMsg(ptr noundef %80, ptr noundef @.str.3, ptr noundef %81)
  br label %265

82:                                               ; preds = %73
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.Table, ptr %84, i32 0, i32 0
  %86 = load ptr, ptr %85, align 8, !tbaa !28
  %87 = call i32 @isSystemTable(ptr noundef %83, ptr noundef %86)
  %88 = icmp ne i32 0, %87
  br i1 %88, label %89, label %90

89:                                               ; preds = %82
  br label %265

90:                                               ; preds = %82
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  %92 = load ptr, ptr %10, align 8, !tbaa !5
  %93 = call i32 @sqlite3CheckObjectName(ptr noundef %91, ptr noundef %92)
  %94 = icmp ne i32 0, %93
  br i1 %94, label %95, label %96

95:                                               ; preds = %90
  br label %265

96:                                               ; preds = %90
  %97 = load ptr, ptr %9, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.Table, ptr %97, i32 0, i32 3
  %99 = load ptr, ptr %98, align 8, !tbaa !29
  %100 = icmp ne ptr %99, null
  br i1 %100, label %101, label %106

101:                                              ; preds = %96
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = load ptr, ptr %9, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.Table, ptr %103, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !28
  call void (ptr, ptr, ...) @sqlite3ErrorMsg(ptr noundef %102, ptr noundef @.str.4, ptr noundef %105)
  br label %265

106:                                              ; preds = %96
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = load ptr, ptr %8, align 8, !tbaa !5
  %109 = load ptr, ptr %9, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.Table, ptr %109, i32 0, i32 0
  %111 = load ptr, ptr %110, align 8, !tbaa !28
  %112 = call i32 @sqlite3AuthCheck(ptr noundef %107, i32 noundef 26, ptr noundef %108, ptr noundef %111, ptr noundef null)
  %113 = icmp ne i32 %112, 0
  br i1 %113, label %114, label %115

114:                                              ; preds = %106
  br label %265

115:                                              ; preds = %106
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = load ptr, ptr %9, align 8, !tbaa !5
  %118 = call i32 @sqlite3ViewGetColumnNames(ptr noundef %116, ptr noundef %117)
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %120, label %121

120:                                              ; preds = %115
  br label %265

121:                                              ; preds = %115
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.Table, ptr %122, i32 0, i32 16
  %124 = load i32, ptr %123, align 4, !tbaa !30
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %126, label %140

126:                                              ; preds = %121
  %127 = load ptr, ptr %11, align 8, !tbaa !5
  %128 = load ptr, ptr %9, align 8, !tbaa !5
  %129 = call ptr @sqlite3GetVTable(ptr noundef %127, ptr noundef %128)
  store ptr %129, ptr %16, align 8, !tbaa !5
  %130 = load ptr, ptr %16, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.VTable, ptr %130, i32 0, i32 2
  %132 = load ptr, ptr %131, align 8, !tbaa !31
  %133 = getelementptr inbounds %struct.sqlite3_vtab, ptr %132, i32 0, i32 0
  %134 = load ptr, ptr %133, align 8, !tbaa !33
  %135 = getelementptr inbounds %struct.sqlite3_module, ptr %134, i32 0, i32 19
  %136 = load ptr, ptr %135, align 8, !tbaa !35
  %137 = icmp eq ptr %136, null
  br i1 %137, label %138, label %139

138:                                              ; preds = %126
  store ptr null, ptr %16, align 8, !tbaa !5
  br label %139

139:                                              ; preds = %138, %126
  br label %140

140:                                              ; preds = %139, %121
  %141 = load ptr, ptr %4, align 8, !tbaa !5
  %142 = call ptr @sqlite3GetVdbe(ptr noundef %141)
  store ptr %142, ptr %14, align 8, !tbaa !5
  %143 = load ptr, ptr %14, align 8, !tbaa !5
  %144 = icmp eq ptr %143, null
  br i1 %144, label %145, label %146

145:                                              ; preds = %140
  br label %265

146:                                              ; preds = %140
  %147 = load ptr, ptr %4, align 8, !tbaa !5
  %148 = load ptr, ptr %16, align 8, !tbaa !5
  %149 = icmp ne ptr %148, null
  %150 = zext i1 %149 to i32
  %151 = load i32, ptr %7, align 4, !tbaa !21
  call void @sqlite3BeginWriteOperation(ptr noundef %147, i32 noundef %150, i32 noundef %151)
  %152 = load ptr, ptr %4, align 8, !tbaa !5
  %153 = load i32, ptr %7, align 4, !tbaa !21
  call void @sqlite3ChangeCookie(ptr noundef %152, i32 noundef %153)
  %154 = load ptr, ptr %16, align 8, !tbaa !5
  %155 = icmp ne ptr %154, null
  br i1 %155, label %156, label %170

156:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  %157 = load ptr, ptr %4, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.Parse, ptr %157, i32 0, i32 18
  %159 = load i32, ptr %158, align 8, !tbaa !37
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %158, align 8, !tbaa !37
  store i32 %160, ptr %18, align 4, !tbaa !21
  %161 = load ptr, ptr %14, align 8, !tbaa !5
  %162 = load i32, ptr %18, align 4, !tbaa !21
  %163 = load ptr, ptr %10, align 8, !tbaa !5
  %164 = call i32 @sqlite3VdbeLoadString(ptr noundef %161, i32 noundef %162, ptr noundef %163)
  %165 = load ptr, ptr %14, align 8, !tbaa !5
  %166 = load i32, ptr %18, align 4, !tbaa !21
  %167 = load ptr, ptr %16, align 8, !tbaa !5
  %168 = call i32 @sqlite3VdbeAddOp4(ptr noundef %165, i32 noundef 158, i32 noundef %166, i32 noundef 0, i32 noundef 0, ptr noundef %167, i32 noundef -8)
  %169 = load ptr, ptr %4, align 8, !tbaa !5
  call void @sqlite3MayAbort(ptr noundef %169)
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  br label %170

170:                                              ; preds = %156, %146
  %171 = load ptr, ptr %9, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.Table, ptr %171, i32 0, i32 0
  %173 = load ptr, ptr %172, align 8, !tbaa !28
  store ptr %173, ptr %13, align 8, !tbaa !5
  %174 = load ptr, ptr %13, align 8, !tbaa !5
  %175 = call i32 @sqlite3Utf8CharLen(ptr noundef %174, i32 noundef -1)
  store i32 %175, ptr %12, align 4, !tbaa !21
  %176 = load ptr, ptr %11, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.sqlite3, ptr %176, i32 0, i32 6
  %178 = load i32, ptr %177, align 4, !tbaa !14
  %179 = and i32 %178, 524288
  %180 = icmp ne i32 %179, 0
  br i1 %180, label %181, label %195

181:                                              ; preds = %170
  %182 = load ptr, ptr %4, align 8, !tbaa !5
  %183 = load ptr, ptr %9, align 8, !tbaa !5
  %184 = call ptr @whereForeignKeys(ptr noundef %182, ptr noundef %183)
  store ptr %184, ptr %15, align 8, !tbaa !5
  %185 = icmp ne ptr %184, null
  br i1 %185, label %186, label %194

186:                                              ; preds = %181
  %187 = load ptr, ptr %4, align 8, !tbaa !5
  %188 = load ptr, ptr %8, align 8, !tbaa !5
  %189 = load ptr, ptr %13, align 8, !tbaa !5
  %190 = load ptr, ptr %10, align 8, !tbaa !5
  %191 = load ptr, ptr %15, align 8, !tbaa !5
  call void (ptr, ptr, ...) @sqlite3NestedParse(ptr noundef %187, ptr noundef @.str.5, ptr noundef %188, ptr noundef @.str.6, ptr noundef %189, ptr noundef %190, ptr noundef %191)
  %192 = load ptr, ptr %11, align 8, !tbaa !5
  %193 = load ptr, ptr %15, align 8, !tbaa !5
  call void @sqlite3DbFree(ptr noundef %192, ptr noundef %193)
  br label %194

194:                                              ; preds = %186, %181
  br label %195

195:                                              ; preds = %194, %170
  %196 = load ptr, ptr %4, align 8, !tbaa !5
  %197 = load ptr, ptr %8, align 8, !tbaa !5
  %198 = load ptr, ptr %10, align 8, !tbaa !5
  %199 = load ptr, ptr %10, align 8, !tbaa !5
  %200 = load ptr, ptr %10, align 8, !tbaa !5
  %201 = load ptr, ptr %10, align 8, !tbaa !5
  %202 = load ptr, ptr %10, align 8, !tbaa !5
  %203 = load i32, ptr %12, align 4, !tbaa !21
  %204 = load ptr, ptr %13, align 8, !tbaa !5
  call void (ptr, ptr, ...) @sqlite3NestedParse(ptr noundef %196, ptr noundef @.str.7, ptr noundef %197, ptr noundef @.str.6, ptr noundef %198, ptr noundef %199, ptr noundef %200, ptr noundef %201, ptr noundef %202, i32 noundef %203, ptr noundef %204)
  %205 = load ptr, ptr %11, align 8, !tbaa !5
  %206 = load ptr, ptr %8, align 8, !tbaa !5
  %207 = call ptr @sqlite3FindTable(ptr noundef %205, ptr noundef @.str.8, ptr noundef %206)
  %208 = icmp ne ptr %207, null
  br i1 %208, label %209, label %216

209:                                              ; preds = %195
  %210 = load ptr, ptr %4, align 8, !tbaa !5
  %211 = load ptr, ptr %8, align 8, !tbaa !5
  %212 = load ptr, ptr %10, align 8, !tbaa !5
  %213 = load ptr, ptr %9, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.Table, ptr %213, i32 0, i32 0
  %215 = load ptr, ptr %214, align 8, !tbaa !28
  call void (ptr, ptr, ...) @sqlite3NestedParse(ptr noundef %210, ptr noundef @.str.9, ptr noundef %211, ptr noundef %212, ptr noundef %215)
  br label %216

216:                                              ; preds = %209, %195
  %217 = load ptr, ptr %4, align 8, !tbaa !5
  %218 = load ptr, ptr %9, align 8, !tbaa !5
  %219 = call ptr @whereTempTriggers(ptr noundef %217, ptr noundef %218)
  store ptr %219, ptr %15, align 8, !tbaa !5
  %220 = icmp ne ptr %219, null
  br i1 %220, label %221, label %228

221:                                              ; preds = %216
  %222 = load ptr, ptr %4, align 8, !tbaa !5
  %223 = load ptr, ptr %10, align 8, !tbaa !5
  %224 = load ptr, ptr %10, align 8, !tbaa !5
  %225 = load ptr, ptr %15, align 8, !tbaa !5
  call void (ptr, ptr, ...) @sqlite3NestedParse(ptr noundef %222, ptr noundef @.str.10, ptr noundef %223, ptr noundef %224, ptr noundef %225)
  %226 = load ptr, ptr %11, align 8, !tbaa !5
  %227 = load ptr, ptr %15, align 8, !tbaa !5
  call void @sqlite3DbFree(ptr noundef %226, ptr noundef %227)
  br label %228

228:                                              ; preds = %221, %216
  %229 = load ptr, ptr %11, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.sqlite3, ptr %229, i32 0, i32 6
  %231 = load i32, ptr %230, align 4, !tbaa !14
  %232 = and i32 %231, 524288
  %233 = icmp ne i32 %232, 0
  br i1 %233, label %234, label %261

234:                                              ; preds = %228
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  %235 = load ptr, ptr %9, align 8, !tbaa !5
  %236 = call ptr @sqlite3FkReferences(ptr noundef %235)
  store ptr %236, ptr %19, align 8, !tbaa !5
  br label %237

237:                                              ; preds = %256, %234
  %238 = load ptr, ptr %19, align 8, !tbaa !5
  %239 = icmp ne ptr %238, null
  br i1 %239, label %240, label %260

240:                                              ; preds = %237
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  %241 = load ptr, ptr %19, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.FKey, ptr %241, i32 0, i32 0
  %243 = load ptr, ptr %242, align 8, !tbaa !38
  store ptr %243, ptr %20, align 8, !tbaa !5
  %244 = load ptr, ptr %20, align 8, !tbaa !5
  %245 = load ptr, ptr %9, align 8, !tbaa !5
  %246 = icmp ne ptr %244, %245
  br i1 %246, label %247, label %255

247:                                              ; preds = %240
  %248 = load ptr, ptr %4, align 8, !tbaa !5
  %249 = load ptr, ptr %19, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.FKey, ptr %249, i32 0, i32 0
  %251 = load ptr, ptr %250, align 8, !tbaa !38
  %252 = load ptr, ptr %20, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.Table, ptr %252, i32 0, i32 0
  %254 = load ptr, ptr %253, align 8, !tbaa !28
  call void @reloadTableSchema(ptr noundef %248, ptr noundef %251, ptr noundef %254)
  br label %255

255:                                              ; preds = %247, %240
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  br label %256

256:                                              ; preds = %255
  %257 = load ptr, ptr %19, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.FKey, ptr %257, i32 0, i32 3
  %259 = load ptr, ptr %258, align 8, !tbaa !40
  store ptr %259, ptr %19, align 8, !tbaa !5
  br label %237, !llvm.loop !41

260:                                              ; preds = %237
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  br label %261

261:                                              ; preds = %260, %228
  %262 = load ptr, ptr %4, align 8, !tbaa !5
  %263 = load ptr, ptr %9, align 8, !tbaa !5
  %264 = load ptr, ptr %10, align 8, !tbaa !5
  call void @reloadTableSchema(ptr noundef %262, ptr noundef %263, ptr noundef %264)
  br label %265

265:                                              ; preds = %261, %145, %120, %114, %101, %95, %89, %79, %66, %40, %31
  %266 = load ptr, ptr %11, align 8, !tbaa !5
  %267 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sqlite3SrcListDelete(ptr noundef %266, ptr noundef %267)
  %268 = load ptr, ptr %11, align 8, !tbaa !5
  %269 = load ptr, ptr %10, align 8, !tbaa !5
  call void @sqlite3DbFree(ptr noundef %268, ptr noundef %269)
  %270 = load i32, ptr %17, align 4, !tbaa !21
  %271 = load ptr, ptr %11, align 8, !tbaa !5
  %272 = getelementptr inbounds %struct.sqlite3, ptr %271, i32 0, i32 6
  store i32 %270, ptr %272, align 4, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

declare ptr @sqlite3LocateTableItem(ptr noundef, i32 noundef, ptr noundef) #2

declare i32 @sqlite3SchemaToIndex(ptr noundef, ptr noundef) #2

declare ptr @sqlite3NameFromToken(ptr noundef, ptr noundef) #2

declare ptr @sqlite3FindTable(ptr noundef, ptr noundef, ptr noundef) #2

declare ptr @sqlite3FindIndex(ptr noundef, ptr noundef, ptr noundef) #2

declare void @sqlite3ErrorMsg(ptr noundef, ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @isSystemTable(ptr noundef, ptr noundef) #0

declare i32 @sqlite3CheckObjectName(ptr noundef, ptr noundef) #2

declare i32 @sqlite3AuthCheck(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare i32 @sqlite3ViewGetColumnNames(ptr noundef, ptr noundef) #2

declare ptr @sqlite3GetVTable(ptr noundef, ptr noundef) #2

declare ptr @sqlite3GetVdbe(ptr noundef) #2

declare void @sqlite3BeginWriteOperation(ptr noundef, i32 noundef, i32 noundef) #2

declare void @sqlite3ChangeCookie(ptr noundef, i32 noundef) #2

declare i32 @sqlite3VdbeLoadString(ptr noundef, i32 noundef, ptr noundef) #2

declare i32 @sqlite3VdbeAddOp4(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef) #2

declare void @sqlite3MayAbort(ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

declare i32 @sqlite3Utf8CharLen(ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden ptr @whereForeignKeys(ptr noundef, ptr noundef) #0

declare void @sqlite3NestedParse(ptr noundef, ptr noundef, ...) #2

declare void @sqlite3DbFree(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden ptr @whereTempTriggers(ptr noundef, ptr noundef) #0

declare ptr @sqlite3FkReferences(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @reloadTableSchema(ptr noundef, ptr noundef, ptr noundef) #0

declare void @sqlite3SrcListDelete(ptr noundef, ptr noundef) #2

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"Parse", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !7, i64 28, !7, i64 29, !7, i64 30, !7, i64 31, !7, i64 32, !7, i64 33, !7, i64 34, !7, i64 35, !7, i64 36, !7, i64 37, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !6, i64 88, !6, i64 96, !12, i64 104, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !11, i64 176, !11, i64 180, !11, i64 184, !11, i64 188, !7, i64 192, !7, i64 193, !7, i64 194, !7, i64 196, !7, i64 396, !12, i64 432, !12, i64 448, !13, i64 464, !7, i64 466, !7, i64 467, !7, i64 468, !11, i64 472, !11, i64 476, !11, i64 480, !11, i64 484, !6, i64 488, !6, i64 496, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !12, i64 536, !6, i64 552, !6, i64 560, !6, i64 568, !6, i64 576, !6, i64 584}
!11 = !{!"int", !7, i64 0}
!12 = !{!"Token", !6, i64 0, !11, i64 8}
!13 = !{!"short", !7, i64 0}
!14 = !{!15, !11, i64 44}
!15 = !{!"sqlite3", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !11, i64 40, !11, i64 44, !16, i64 48, !16, i64 56, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !13, i64 80, !7, i64 82, !7, i64 83, !7, i64 84, !7, i64 85, !7, i64 86, !7, i64 87, !7, i64 88, !7, i64 89, !7, i64 90, !7, i64 91, !7, i64 92, !7, i64 93, !7, i64 94, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !7, i64 112, !11, i64 160, !17, i64 164, !11, i64 172, !11, i64 176, !11, i64 180, !11, i64 184, !11, i64 188, !11, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !7, i64 336, !18, i64 344, !6, i64 400, !6, i64 408, !6, i64 416, !6, i64 424, !11, i64 432, !11, i64 436, !19, i64 440, !6, i64 464, !6, i64 472, !6, i64 480, !19, i64 488, !19, i64 512, !20, i64 536, !7, i64 560, !6, i64 624, !11, i64 632, !11, i64 636, !11, i64 640, !16, i64 648, !16, i64 656, !6, i64 664}
!16 = !{!"long long", !7, i64 0}
!17 = !{!"sqlite3InitInfo", !11, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7}
!18 = !{!"Lookaside", !11, i64 0, !13, i64 4, !7, i64 6, !11, i64 8, !11, i64 12, !7, i64 16, !6, i64 32, !6, i64 40, !6, i64 48}
!19 = !{!"Hash", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 16}
!20 = !{!"BusyHandler", !6, i64 0, !6, i64 8, !11, i64 16}
!21 = !{!11, !11, i64 0}
!22 = !{!15, !7, i64 85}
!23 = !{!24, !6, i64 112}
!24 = !{!"Table", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !11, i64 56, !11, i64 60, !11, i64 64, !13, i64 68, !13, i64 70, !13, i64 72, !13, i64 74, !7, i64 76, !11, i64 80, !11, i64 84, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!25 = !{!15, !6, i64 32}
!26 = !{!27, !6, i64 0}
!27 = !{!"Db", !6, i64 0, !6, i64 8, !7, i64 16, !7, i64 17, !6, i64 24}
!28 = !{!24, !6, i64 0}
!29 = !{!24, !6, i64 24}
!30 = !{!24, !11, i64 84}
!31 = !{!32, !6, i64 16}
!32 = !{!"VTable", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !7, i64 28, !11, i64 32, !6, i64 40}
!33 = !{!34, !6, i64 0}
!34 = !{!"sqlite3_vtab", !6, i64 0, !11, i64 8, !6, i64 16}
!35 = !{!36, !6, i64 152}
!36 = !{!"sqlite3_module", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176}
!37 = !{!10, !11, i64 56}
!38 = !{!39, !6, i64 0}
!39 = !{!"FKey", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !11, i64 40, !7, i64 44, !7, i64 45, !7, i64 48, !7, i64 64}
!40 = !{!39, !6, i64 24}
!41 = distinct !{!41, !42}
!42 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.Db = type { ptr, ptr, i8, i8, ptr }

@.str.3 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [384 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [92 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @sqlite3AlterRenameTable(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = load ptr, ptr %0, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %4, i64 44
  %6 = load i32, ptr %5, align 4, !tbaa !13
  %7 = getelementptr inbounds i8, ptr %4, i64 85
  %8 = load i8, ptr %7, align 1, !tbaa !20
  %.not = icmp eq i8 %8, 0
  br i1 %.not, label %9, label %93

9:                                                ; preds = %3
  %10 = getelementptr inbounds i8, ptr %1, i64 8
  %11 = tail call ptr @sqlite3LocateTableItem(ptr noundef nonnull %0, i32 noundef 0, ptr noundef nonnull %10) #2
  %.not115 = icmp eq ptr %11, null
  br i1 %.not115, label %93, label %12

12:                                               ; preds = %9
  %13 = load ptr, ptr %0, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %11, i64 112
  %15 = load ptr, ptr %14, align 8, !tbaa !21
  %16 = tail call i32 @sqlite3SchemaToIndex(ptr noundef %13, ptr noundef %15) #2
  %17 = getelementptr inbounds i8, ptr %4, i64 32
  %18 = load ptr, ptr %17, align 8, !tbaa !23
  %19 = sext i32 %16 to i64
  %20 = getelementptr inbounds %struct.Db, ptr %18, i64 %19
  %21 = load ptr, ptr %20, align 8, !tbaa !24
  %22 = load i32, ptr %5, align 4, !tbaa !13
  %23 = or i32 %22, 2097152
  store i32 %23, ptr %5, align 4, !tbaa !13
  %24 = tail call ptr @sqlite3NameFromToken(ptr noundef nonnull %4, ptr noundef %2) #2
  %.not116 = icmp eq ptr %24, null
  br i1 %.not116, label %93, label %25

25:                                               ; preds = %12
  %26 = tail call ptr @sqlite3FindTable(ptr noundef nonnull %4, ptr noundef nonnull %24, ptr noundef %21) #2
  %.not117 = icmp eq ptr %26, null
  br i1 %.not117, label %27, label %29

27:                                               ; preds = %25
  %28 = tail call ptr @sqlite3FindIndex(ptr noundef nonnull %4, ptr noundef nonnull %24, ptr noundef %21) #2
  %.not118 = icmp eq ptr %28, null
  br i1 %.not118, label %30, label %29

29:                                               ; preds = %27, %25
  tail call void (ptr, ptr, ...) @sqlite3ErrorMsg(ptr noundef nonnull %0, ptr noundef nonnull @.str.3, ptr noundef nonnull %24) #2
  br label %93

30:                                               ; preds = %27
  %31 = load ptr, ptr %11, align 8, !tbaa !26
  %32 = tail call i32 @isSystemTable(ptr noundef nonnull %0, ptr noundef %31)
  %.not119 = icmp eq i32 %32, 0
  br i1 %.not119, label %33, label %93

33:                                               ; preds = %30
  %34 = tail call i32 @sqlite3CheckObjectName(ptr noundef nonnull %0, ptr noundef nonnull %24) #2
  %.not120 = icmp eq i32 %34, 0
  br i1 %.not120, label %35, label %93

35:                                               ; preds = %33
  %36 = getelementptr inbounds i8, ptr %11, i64 24
  %37 = load ptr, ptr %36, align 8, !tbaa !27
  %.not121 = icmp eq ptr %37, null
  %38 = load ptr, ptr %11, align 8, !tbaa !26
  br i1 %.not121, label %40, label %39

39:                                               ; preds = %35
  tail call void (ptr, ptr, ...) @sqlite3ErrorMsg(ptr noundef nonnull %0, ptr noundef nonnull @.str.4, ptr noundef %38) #2
  br label %93

40:                                               ; preds = %35
  %41 = tail call i32 @sqlite3AuthCheck(ptr noundef nonnull %0, i32 noundef 26, ptr noundef %21, ptr noundef %38, ptr noundef null) #2
  %.not122 = icmp eq i32 %41, 0
  br i1 %.not122, label %42, label %93

42:                                               ; preds = %40
  %43 = tail call i32 @sqlite3ViewGetColumnNames(ptr noundef nonnull %0, ptr noundef nonnull %11) #2
  %.not123 = icmp eq i32 %43, 0
  br i1 %.not123, label %44, label %93

44:                                               ; preds = %42
  %45 = getelementptr inbounds i8, ptr %11, i64 84
  %46 = load i32, ptr %45, align 4, !tbaa !28
  %.not124 = icmp eq i32 %46, 0
  br i1 %.not124, label %55, label %47

47:                                               ; preds = %44
  %48 = tail call ptr @sqlite3GetVTable(ptr noundef nonnull %4, ptr noundef nonnull %11) #2
  %49 = getelementptr inbounds i8, ptr %48, i64 16
  %50 = load ptr, ptr %49, align 8, !tbaa !29
  %51 = load ptr, ptr %50, align 8, !tbaa !31
  %52 = getelementptr inbounds i8, ptr %51, i64 152
  %53 = load ptr, ptr %52, align 8, !tbaa !33
  %54 = icmp eq ptr %53, null
  %spec.store.select = select i1 %54, ptr null, ptr %48
  br label %55

55:                                               ; preds = %47, %44
  %.0108 = phi ptr [ %spec.store.select, %47 ], [ null, %44 ]
  %56 = tail call ptr @sqlite3GetVdbe(ptr noundef nonnull %0) #2
  %57 = icmp eq ptr %56, null
  br i1 %57, label %93, label %58

58:                                               ; preds = %55
  %59 = icmp ne ptr %.0108, null
  %60 = zext i1 %59 to i32
  tail call void @sqlite3BeginWriteOperation(ptr noundef nonnull %0, i32 noundef %60, i32 noundef %16) #2
  tail call void @sqlite3ChangeCookie(ptr noundef nonnull %0, i32 noundef %16) #2
  br i1 %59, label %61, label %67

61:                                               ; preds = %58
  %62 = getelementptr inbounds i8, ptr %0, i64 56
  %63 = load i32, ptr %62, align 8, !tbaa !35
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %62, align 8, !tbaa !35
  %65 = tail call i32 @sqlite3VdbeLoadString(ptr noundef nonnull %56, i32 noundef %64, ptr noundef nonnull %24) #2
  %66 = tail call i32 @sqlite3VdbeAddOp4(ptr noundef nonnull %56, i32 noundef 158, i32 noundef %64, i32 noundef 0, i32 noundef 0, ptr noundef nonnull %.0108, i32 noundef -8) #2
  tail call void @sqlite3MayAbort(ptr noundef nonnull %0) #2
  br label %67

67:                                               ; preds = %61, %58
  %68 = load ptr, ptr %11, align 8, !tbaa !26
  %69 = tail call i32 @sqlite3Utf8CharLen(ptr noundef %68, i32 noundef -1) #2
  %70 = load i32, ptr %5, align 4, !tbaa !13
  %71 = and i32 %70, 524288
  %.not125 = icmp eq i32 %71, 0
  br i1 %.not125, label %75, label %72

72:                                               ; preds = %67
  %73 = tail call ptr @whereForeignKeys(ptr noundef nonnull %0, ptr noundef nonnull %11)
  %.not126 = icmp eq ptr %73, null
  br i1 %.not126, label %75, label %74

74:                                               ; preds = %72
  tail call void (ptr, ptr, ...) @sqlite3NestedParse(ptr noundef nonnull %0, ptr noundef nonnull @.str.5, ptr noundef %21, ptr noundef nonnull @.str.6, ptr noundef %68, ptr noundef nonnull %24, ptr noundef nonnull %73) #2
  tail call void @sqlite3DbFree(ptr noundef nonnull %4, ptr noundef nonnull %73) #2
  br label %75

75:                                               ; preds = %72, %74, %67
  tail call void (ptr, ptr, ...) @sqlite3NestedParse(ptr noundef nonnull %0, ptr noundef nonnull @.str.7, ptr noundef %21, ptr noundef nonnull @.str.6, ptr noundef nonnull %24, ptr noundef nonnull %24, ptr noundef nonnull %24, ptr noundef nonnull %24, ptr noundef nonnull %24, i32 noundef %69, ptr noundef %68) #2
  %76 = tail call ptr @sqlite3FindTable(ptr noundef nonnull %4, ptr noundef nonnull @.str.8, ptr noundef %21) #2
  %.not127 = icmp eq ptr %76, null
  br i1 %.not127, label %79, label %77

77:                                               ; preds = %75
  %78 = load ptr, ptr %11, align 8, !tbaa !26
  tail call void (ptr, ptr, ...) @sqlite3NestedParse(ptr noundef nonnull %0, ptr noundef nonnull @.str.9, ptr noundef %21, ptr noundef nonnull %24, ptr noundef %78) #2
  br label %79

79:                                               ; preds = %77, %75
  %80 = tail call ptr @whereTempTriggers(ptr noundef nonnull %0, ptr noundef nonnull %11)
  %.not128 = icmp eq ptr %80, null
  br i1 %.not128, label %82, label %81

81:                                               ; preds = %79
  tail call void (ptr, ptr, ...) @sqlite3NestedParse(ptr noundef nonnull %0, ptr noundef nonnull @.str.10, ptr noundef nonnull %24, ptr noundef nonnull %24, ptr noundef nonnull %80) #2
  tail call void @sqlite3DbFree(ptr noundef nonnull %4, ptr noundef nonnull %80) #2
  br label %82

82:                                               ; preds = %81, %79
  %83 = load i32, ptr %5, align 4, !tbaa !13
  %84 = and i32 %83, 524288
  %.not129 = icmp eq i32 %84, 0
  br i1 %.not129, label %.loopexit, label %85

85:                                               ; preds = %82
  %86 = tail call ptr @sqlite3FkReferences(ptr noundef nonnull %11) #2
  %.not130132 = icmp eq ptr %86, null
  br i1 %.not130132, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %85, %90
  %.0107133 = phi ptr [ %92, %90 ], [ %86, %85 ]
  %87 = load ptr, ptr %.0107133, align 8, !tbaa !36
  %.not131 = icmp eq ptr %87, %11
  br i1 %.not131, label %90, label %88

88:                                               ; preds = %.lr.ph
  %89 = load ptr, ptr %87, align 8, !tbaa !26
  tail call void @reloadTableSchema(ptr noundef nonnull %0, ptr noundef nonnull %87, ptr noundef %89)
  br label %90

90:                                               ; preds = %88, %.lr.ph
  %91 = getelementptr inbounds i8, ptr %.0107133, i64 24
  %92 = load ptr, ptr %91, align 8, !tbaa !38
  %.not130 = icmp eq ptr %92, null
  br i1 %.not130, label %.loopexit, label %.lr.ph, !llvm.loop !39

.loopexit:                                        ; preds = %90, %85, %82
  tail call void @reloadTableSchema(ptr noundef nonnull %0, ptr noundef nonnull %11, ptr noundef %24)
  br label %93

93:                                               ; preds = %55, %42, %40, %33, %30, %12, %9, %3, %.loopexit, %39, %29
  %.0 = phi ptr [ null, %3 ], [ %24, %29 ], [ %24, %30 ], [ %24, %33 ], [ %24, %39 ], [ %24, %40 ], [ %24, %42 ], [ %24, %55 ], [ %24, %.loopexit ], [ null, %12 ], [ null, %9 ]
  tail call void @sqlite3SrcListDelete(ptr noundef %4, ptr noundef %1) #2
  tail call void @sqlite3DbFree(ptr noundef %4, ptr noundef %.0) #2
  store i32 %6, ptr %5, align 4, !tbaa !13
  ret void
}

declare ptr @sqlite3LocateTableItem(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare i32 @sqlite3SchemaToIndex(ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @sqlite3NameFromToken(ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @sqlite3FindTable(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @sqlite3FindIndex(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @sqlite3ErrorMsg(ptr noundef, ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @isSystemTable(ptr noundef, ptr noundef) local_unnamed_addr #0

declare i32 @sqlite3CheckObjectName(ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @sqlite3AuthCheck(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @sqlite3ViewGetColumnNames(ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @sqlite3GetVTable(ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @sqlite3GetVdbe(ptr noundef) local_unnamed_addr #1

declare void @sqlite3BeginWriteOperation(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @sqlite3ChangeCookie(ptr noundef, i32 noundef) local_unnamed_addr #1

declare i32 @sqlite3VdbeLoadString(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare i32 @sqlite3VdbeAddOp4(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @sqlite3MayAbort(ptr noundef) local_unnamed_addr #1

declare i32 @sqlite3Utf8CharLen(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden ptr @whereForeignKeys(ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @sqlite3NestedParse(ptr noundef, ptr noundef, ...) local_unnamed_addr #1

declare void @sqlite3DbFree(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden ptr @whereTempTriggers(ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @sqlite3FkReferences(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @reloadTableSchema(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @sqlite3SrcListDelete(ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"Parse", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !8, i64 28, !8, i64 29, !8, i64 30, !8, i64 31, !8, i64 32, !8, i64 33, !8, i64 34, !8, i64 35, !8, i64 36, !8, i64 37, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !7, i64 88, !7, i64 96, !11, i64 104, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !10, i64 136, !10, i64 140, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !8, i64 192, !8, i64 193, !8, i64 194, !8, i64 196, !8, i64 396, !11, i64 432, !11, i64 448, !12, i64 464, !8, i64 466, !8, i64 467, !8, i64 468, !10, i64 472, !10, i64 476, !10, i64 480, !10, i64 484, !7, i64 488, !7, i64 496, !7, i64 504, !7, i64 512, !7, i64 520, !7, i64 528, !11, i64 536, !7, i64 552, !7, i64 560, !7, i64 568, !7, i64 576, !7, i64 584}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"Token", !7, i64 0, !10, i64 8}
!12 = !{!"short", !8, i64 0}
!13 = !{!14, !10, i64 44}
!14 = !{!"sqlite3", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !10, i64 44, !15, i64 48, !15, i64 56, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !12, i64 80, !8, i64 82, !8, i64 83, !8, i64 84, !8, i64 85, !8, i64 86, !8, i64 87, !8, i64 88, !8, i64 89, !8, i64 90, !8, i64 91, !8, i64 92, !8, i64 93, !8, i64 94, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !8, i64 112, !10, i64 160, !16, i64 164, !10, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !10, i64 192, !7, i64 200, !7, i64 208, !7, i64 216, !7, i64 224, !7, i64 232, !7, i64 240, !7, i64 248, !7, i64 256, !7, i64 264, !7, i64 272, !7, i64 280, !7, i64 288, !7, i64 296, !7, i64 304, !7, i64 312, !7, i64 320, !7, i64 328, !8, i64 336, !17, i64 344, !7, i64 400, !7, i64 408, !7, i64 416, !7, i64 424, !10, i64 432, !10, i64 436, !18, i64 440, !7, i64 464, !7, i64 472, !7, i64 480, !18, i64 488, !18, i64 512, !19, i64 536, !8, i64 560, !7, i64 624, !10, i64 632, !10, i64 636, !10, i64 640, !15, i64 648, !15, i64 656, !7, i64 664}
!15 = !{!"long long", !8, i64 0}
!16 = !{!"sqlite3InitInfo", !10, i64 0, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7}
!17 = !{!"Lookaside", !10, i64 0, !12, i64 4, !8, i64 6, !10, i64 8, !10, i64 12, !8, i64 16, !7, i64 32, !7, i64 40, !7, i64 48}
!18 = !{!"Hash", !10, i64 0, !10, i64 4, !7, i64 8, !7, i64 16}
!19 = !{!"BusyHandler", !7, i64 0, !7, i64 8, !10, i64 16}
!20 = !{!14, !8, i64 85}
!21 = !{!22, !7, i64 112}
!22 = !{!"Table", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !10, i64 56, !10, i64 60, !10, i64 64, !12, i64 68, !12, i64 70, !12, i64 72, !12, i64 74, !8, i64 76, !10, i64 80, !10, i64 84, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120}
!23 = !{!14, !7, i64 32}
!24 = !{!25, !7, i64 0}
!25 = !{!"Db", !7, i64 0, !7, i64 8, !8, i64 16, !8, i64 17, !7, i64 24}
!26 = !{!22, !7, i64 0}
!27 = !{!22, !7, i64 24}
!28 = !{!22, !10, i64 84}
!29 = !{!30, !7, i64 16}
!30 = !{!"VTable", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !8, i64 28, !10, i64 32, !7, i64 40}
!31 = !{!32, !7, i64 0}
!32 = !{!"sqlite3_vtab", !7, i64 0, !10, i64 8, !7, i64 16}
!33 = !{!34, !7, i64 152}
!34 = !{!"sqlite3_module", !10, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176}
!35 = !{!6, !10, i64 56}
!36 = !{!37, !7, i64 0}
!37 = !{!"FKey", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !8, i64 44, !8, i64 45, !8, i64 48, !8, i64 64}
!38 = !{!37, !7, i64 24}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass