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

; 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.Vdbe = type { ptr, ptr, ptr, ptr, i16, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, i32, i16, i8, i8, i16, i32, i32, [5 x i32], ptr, ptr, ptr, ptr, i32, i32, ptr, ptr }
%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, %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 = 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 }

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @sqlite3VdbeEnter(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @sqlite3VdbeLeave(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @sqlite3VdbeCloseStatement(ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @sqlite3VdbeCheckFk(ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @sqlite3VdbeHalt(ptr noundef %0) #2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %10 = load ptr, ptr %3, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.Vdbe, ptr %10, i32 0, i32 0
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  store ptr %12, ptr %5, align 8, !tbaa !5
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.Vdbe, ptr %13, i32 0, i32 5
  %15 = load i32, ptr %14, align 4, !tbaa !14
  %16 = icmp ne i32 %15, 770837923
  br i1 %16, label %17, label %18

17:                                               ; preds = %1
  store i32 0, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %365

18:                                               ; preds = %1
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.sqlite3, ptr %19, i32 0, i32 17
  %21 = load i8, ptr %20, align 1, !tbaa !15
  %22 = icmp ne i8 %21, 0
  br i1 %22, label %23, label %26

23:                                               ; preds = %18
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.Vdbe, ptr %24, i32 0, i32 10
  store i32 7, ptr %25, align 8, !tbaa !21
  br label %26

26:                                               ; preds = %23, %18
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  call void @closeAllCursors(ptr noundef %27)
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.Vdbe, ptr %28, i32 0, i32 9
  %30 = load i32, ptr %29, align 4, !tbaa !22
  %31 = icmp sge i32 %30, 0
  br i1 %31, label %32, label %306

32:                                               ; preds = %26
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.Vdbe, ptr %33, i32 0, i32 31
  %35 = load i16, ptr %34, align 8
  %36 = lshr i16 %35, 8
  %37 = and i16 %36, 1
  %38 = zext i16 %37 to i32
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %40, label %306

40:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  call void @sqlite3VdbeEnter(ptr noundef %41)
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.Vdbe, ptr %42, i32 0, i32 10
  %44 = load i32, ptr %43, align 8, !tbaa !21
  %45 = and i32 %44, 255
  store i32 %45, ptr %7, align 4, !tbaa !23
  %46 = load i32, ptr %7, align 4, !tbaa !23
  %47 = icmp eq i32 %46, 7
  br i1 %47, label %57, label %48

48:                                               ; preds = %40
  %49 = load i32, ptr %7, align 4, !tbaa !23
  %50 = icmp eq i32 %49, 10
  br i1 %50, label %57, label %51

51:                                               ; preds = %48
  %52 = load i32, ptr %7, align 4, !tbaa !23
  %53 = icmp eq i32 %52, 9
  br i1 %53, label %57, label %54

54:                                               ; preds = %51
  %55 = load i32, ptr %7, align 4, !tbaa !23
  %56 = icmp eq i32 %55, 13
  br label %57

57:                                               ; preds = %54, %51, %48, %40
  %58 = phi i1 [ true, %51 ], [ true, %48 ], [ true, %40 ], [ %56, %54 ]
  %59 = zext i1 %58 to i32
  store i32 %59, ptr %9, align 4, !tbaa !23
  %60 = load i32, ptr %9, align 4, !tbaa !23
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %62, label %97

62:                                               ; preds = %57
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.Vdbe, ptr %63, i32 0, i32 31
  %65 = load i16, ptr %64, align 8
  %66 = lshr i16 %65, 7
  %67 = and i16 %66, 1
  %68 = zext i16 %67 to i32
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %73

70:                                               ; preds = %62
  %71 = load i32, ptr %7, align 4, !tbaa !23
  %72 = icmp ne i32 %71, 9
  br i1 %72, label %73, label %96

73:                                               ; preds = %70, %62
  %74 = load i32, ptr %7, align 4, !tbaa !23
  %75 = icmp eq i32 %74, 7
  br i1 %75, label %79, label %76

76:                                               ; preds = %73
  %77 = load i32, ptr %7, align 4, !tbaa !23
  %78 = icmp eq i32 %77, 13
  br i1 %78, label %79, label %88

79:                                               ; preds = %76, %73
  %80 = load ptr, ptr %3, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.Vdbe, ptr %80, i32 0, i32 31
  %82 = load i16, ptr %81, align 8
  %83 = lshr i16 %82, 6
  %84 = and i16 %83, 1
  %85 = zext i16 %84 to i32
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %88

87:                                               ; preds = %79
  store i32 2, ptr %8, align 4, !tbaa !23
  br label %95

88:                                               ; preds = %79, %76
  %89 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sqlite3RollbackAll(ptr noundef %89, i32 noundef 516)
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sqlite3CloseSavepoints(ptr noundef %90)
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.sqlite3, ptr %91, i32 0, i32 15
  store i8 1, ptr %92, align 1, !tbaa !24
  %93 = load ptr, ptr %3, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.Vdbe, ptr %93, i32 0, i32 11
  store i32 0, ptr %94, align 4, !tbaa !25
  br label %95

95:                                               ; preds = %88, %87
  br label %96

96:                                               ; preds = %95, %70
  br label %97

97:                                               ; preds = %96, %57
  %98 = load ptr, ptr %3, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.Vdbe, ptr %98, i32 0, i32 10
  %100 = load i32, ptr %99, align 8, !tbaa !21
  %101 = icmp eq i32 %100, 0
  br i1 %101, label %102, label %105

102:                                              ; preds = %97
  %103 = load ptr, ptr %3, align 8, !tbaa !5
  %104 = call i32 @sqlite3VdbeCheckFk(ptr noundef %103, i32 noundef 0)
  br label %105

105:                                              ; preds = %102, %97
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.sqlite3, ptr %106, i32 0, i32 64
  %108 = load i32, ptr %107, align 4, !tbaa !26
  %109 = icmp sgt i32 %108, 0
  br i1 %109, label %110, label %115

110:                                              ; preds = %105
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.sqlite3, ptr %111, i32 0, i32 67
  %113 = load ptr, ptr %112, align 8, !tbaa !27
  %114 = icmp eq ptr %113, null
  br i1 %114, label %210, label %115

115:                                              ; preds = %110, %105
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.sqlite3, ptr %116, i32 0, i32 15
  %118 = load i8, ptr %117, align 1, !tbaa !24
  %119 = zext i8 %118 to i32
  %120 = icmp ne i32 %119, 0
  br i1 %120, label %121, label %210

121:                                              ; preds = %115
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.sqlite3, ptr %122, i32 0, i32 36
  %124 = load i32, ptr %123, align 4, !tbaa !28
  %125 = load ptr, ptr %3, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.Vdbe, ptr %125, i32 0, i32 31
  %127 = load i16, ptr %126, align 8
  %128 = lshr i16 %127, 7
  %129 = and i16 %128, 1
  %130 = zext i16 %129 to i32
  %131 = icmp eq i32 %130, 0
  %132 = zext i1 %131 to i32
  %133 = icmp eq i32 %124, %132
  br i1 %133, label %134, label %210

134:                                              ; preds = %121
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.Vdbe, ptr %135, i32 0, i32 10
  %137 = load i32, ptr %136, align 8, !tbaa !21
  %138 = icmp eq i32 %137, 0
  br i1 %138, label %148, label %139

139:                                              ; preds = %134
  %140 = load ptr, ptr %3, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.Vdbe, ptr %140, i32 0, i32 29
  %142 = load i8, ptr %141, align 2, !tbaa !29
  %143 = zext i8 %142 to i32
  %144 = icmp eq i32 %143, 3
  br i1 %144, label %145, label %203

145:                                              ; preds = %139
  %146 = load i32, ptr %9, align 4, !tbaa !23
  %147 = icmp ne i32 %146, 0
  br i1 %147, label %203, label %148

148:                                              ; preds = %145, %134
  %149 = load ptr, ptr %3, align 8, !tbaa !5
  %150 = call i32 @sqlite3VdbeCheckFk(ptr noundef %149, i32 noundef 1)
  store i32 %150, ptr %4, align 4, !tbaa !23
  %151 = load i32, ptr %4, align 4, !tbaa !23
  %152 = icmp ne i32 %151, 0
  br i1 %152, label %153, label %164

153:                                              ; preds = %148
  %154 = load ptr, ptr %3, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.Vdbe, ptr %154, i32 0, i32 31
  %156 = load i16, ptr %155, align 8
  %157 = lshr i16 %156, 7
  %158 = and i16 %157, 1
  %159 = zext i16 %158 to i32
  %160 = icmp ne i32 %159, 0
  br i1 %160, label %161, label %163

161:                                              ; preds = %153
  %162 = load ptr, ptr %3, align 8, !tbaa !5
  call void @sqlite3VdbeLeave(ptr noundef %162)
  store i32 1, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %303

163:                                              ; preds = %153
  store i32 787, ptr %4, align 4, !tbaa !23
  br label %168

164:                                              ; preds = %148
  %165 = load ptr, ptr %5, align 8, !tbaa !5
  %166 = load ptr, ptr %3, align 8, !tbaa !5
  %167 = call i32 @vdbeCommit(ptr noundef %165, ptr noundef %166)
  store i32 %167, ptr %4, align 4, !tbaa !23
  br label %168

168:                                              ; preds = %164, %163
  %169 = load i32, ptr %4, align 4, !tbaa !23
  %170 = icmp eq i32 %169, 5
  br i1 %170, label %171, label %181

171:                                              ; preds = %168
  %172 = load ptr, ptr %3, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.Vdbe, ptr %172, i32 0, i32 31
  %174 = load i16, ptr %173, align 8
  %175 = lshr i16 %174, 7
  %176 = and i16 %175, 1
  %177 = zext i16 %176 to i32
  %178 = icmp ne i32 %177, 0
  br i1 %178, label %179, label %181

179:                                              ; preds = %171
  %180 = load ptr, ptr %3, align 8, !tbaa !5
  call void @sqlite3VdbeLeave(ptr noundef %180)
  store i32 5, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %303

181:                                              ; preds = %171, %168
  %182 = load i32, ptr %4, align 4, !tbaa !23
  %183 = icmp ne i32 %182, 0
  br i1 %183, label %184, label %191

184:                                              ; preds = %181
  %185 = load i32, ptr %4, align 4, !tbaa !23
  %186 = load ptr, ptr %3, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.Vdbe, ptr %186, i32 0, i32 10
  store i32 %185, ptr %187, align 8, !tbaa !21
  %188 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sqlite3RollbackAll(ptr noundef %188, i32 noundef 0)
  %189 = load ptr, ptr %3, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.Vdbe, ptr %189, i32 0, i32 11
  store i32 0, ptr %190, align 4, !tbaa !25
  br label %201

191:                                              ; preds = %181
  %192 = load ptr, ptr %5, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.sqlite3, ptr %192, i32 0, i32 77
  store i64 0, ptr %193, align 8, !tbaa !30
  %194 = load ptr, ptr %5, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.sqlite3, ptr %194, i32 0, i32 78
  store i64 0, ptr %195, align 8, !tbaa !31
  %196 = load ptr, ptr %5, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.sqlite3, ptr %196, i32 0, i32 6
  %198 = load i32, ptr %197, align 4, !tbaa !32
  %199 = and i32 %198, -33554433
  store i32 %199, ptr %197, align 4, !tbaa !32
  %200 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sqlite3CommitInternalChanges(ptr noundef %200)
  br label %201

201:                                              ; preds = %191, %184
  br label %202

202:                                              ; preds = %201
  br label %207

203:                                              ; preds = %145, %139
  %204 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sqlite3RollbackAll(ptr noundef %204, i32 noundef 0)
  %205 = load ptr, ptr %3, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.Vdbe, ptr %205, i32 0, i32 11
  store i32 0, ptr %206, align 4, !tbaa !25
  br label %207

207:                                              ; preds = %203, %202
  %208 = load ptr, ptr %5, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.sqlite3, ptr %208, i32 0, i32 76
  store i32 0, ptr %209, align 8, !tbaa !33
  br label %242

210:                                              ; preds = %121, %115, %110
  %211 = load i32, ptr %8, align 4, !tbaa !23
  %212 = icmp eq i32 %211, 0
  br i1 %212, label %213, label %241

213:                                              ; preds = %210
  %214 = load ptr, ptr %3, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.Vdbe, ptr %214, i32 0, i32 10
  %216 = load i32, ptr %215, align 8, !tbaa !21
  %217 = icmp eq i32 %216, 0
  br i1 %217, label %224, label %218

218:                                              ; preds = %213
  %219 = load ptr, ptr %3, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.Vdbe, ptr %219, i32 0, i32 29
  %221 = load i8, ptr %220, align 2, !tbaa !29
  %222 = zext i8 %221 to i32
  %223 = icmp eq i32 %222, 3
  br i1 %223, label %224, label %225

224:                                              ; preds = %218, %213
  store i32 1, ptr %8, align 4, !tbaa !23
  br label %240

225:                                              ; preds = %218
  %226 = load ptr, ptr %3, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.Vdbe, ptr %226, i32 0, i32 29
  %228 = load i8, ptr %227, align 2, !tbaa !29
  %229 = zext i8 %228 to i32
  %230 = icmp eq i32 %229, 2
  br i1 %230, label %231, label %232

231:                                              ; preds = %225
  store i32 2, ptr %8, align 4, !tbaa !23
  br label %239

232:                                              ; preds = %225
  %233 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sqlite3RollbackAll(ptr noundef %233, i32 noundef 516)
  %234 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sqlite3CloseSavepoints(ptr noundef %234)
  %235 = load ptr, ptr %5, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.sqlite3, ptr %235, i32 0, i32 15
  store i8 1, ptr %236, align 1, !tbaa !24
  %237 = load ptr, ptr %3, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.Vdbe, ptr %237, i32 0, i32 11
  store i32 0, ptr %238, align 4, !tbaa !25
  br label %239

239:                                              ; preds = %232, %231
  br label %240

240:                                              ; preds = %239, %224
  br label %241

241:                                              ; preds = %240, %210
  br label %242

242:                                              ; preds = %241, %207
  %243 = load i32, ptr %8, align 4, !tbaa !23
  %244 = icmp ne i32 %243, 0
  br i1 %244, label %245, label %280

245:                                              ; preds = %242
  %246 = load ptr, ptr %3, align 8, !tbaa !5
  %247 = load i32, ptr %8, align 4, !tbaa !23
  %248 = call i32 @sqlite3VdbeCloseStatement(ptr noundef %246, i32 noundef %247)
  store i32 %248, ptr %4, align 4, !tbaa !23
  %249 = load i32, ptr %4, align 4, !tbaa !23
  %250 = icmp ne i32 %249, 0
  br i1 %250, label %251, label %279

251:                                              ; preds = %245
  %252 = load ptr, ptr %3, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.Vdbe, ptr %252, i32 0, i32 10
  %254 = load i32, ptr %253, align 8, !tbaa !21
  %255 = icmp eq i32 %254, 0
  br i1 %255, label %262, label %256

256:                                              ; preds = %251
  %257 = load ptr, ptr %3, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.Vdbe, ptr %257, i32 0, i32 10
  %259 = load i32, ptr %258, align 8, !tbaa !21
  %260 = and i32 %259, 255
  %261 = icmp eq i32 %260, 19
  br i1 %261, label %262, label %272

262:                                              ; preds = %256, %251
  %263 = load i32, ptr %4, align 4, !tbaa !23
  %264 = load ptr, ptr %3, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct.Vdbe, ptr %264, i32 0, i32 10
  store i32 %263, ptr %265, align 8, !tbaa !21
  %266 = load ptr, ptr %5, align 8, !tbaa !5
  %267 = load ptr, ptr %3, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.Vdbe, ptr %267, i32 0, i32 22
  %269 = load ptr, ptr %268, align 8, !tbaa !34
  call void @sqlite3DbFree(ptr noundef %266, ptr noundef %269)
  %270 = load ptr, ptr %3, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct.Vdbe, ptr %270, i32 0, i32 22
  store ptr null, ptr %271, align 8, !tbaa !34
  br label %272

272:                                              ; preds = %262, %256
  %273 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sqlite3RollbackAll(ptr noundef %273, i32 noundef 516)
  %274 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sqlite3CloseSavepoints(ptr noundef %274)
  %275 = load ptr, ptr %5, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct.sqlite3, ptr %275, i32 0, i32 15
  store i8 1, ptr %276, align 1, !tbaa !24
  %277 = load ptr, ptr %3, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct.Vdbe, ptr %277, i32 0, i32 11
  store i32 0, ptr %278, align 4, !tbaa !25
  br label %279

279:                                              ; preds = %272, %245
  br label %280

280:                                              ; preds = %279, %242
  %281 = load ptr, ptr %3, align 8, !tbaa !5
  %282 = getelementptr inbounds %struct.Vdbe, ptr %281, i32 0, i32 31
  %283 = load i16, ptr %282, align 8
  %284 = lshr i16 %283, 4
  %285 = and i16 %284, 1
  %286 = zext i16 %285 to i32
  %287 = icmp ne i32 %286, 0
  br i1 %287, label %288, label %301

288:                                              ; preds = %280
  %289 = load i32, ptr %8, align 4, !tbaa !23
  %290 = icmp ne i32 %289, 2
  br i1 %290, label %291, label %296

291:                                              ; preds = %288
  %292 = load ptr, ptr %5, align 8, !tbaa !5
  %293 = load ptr, ptr %3, align 8, !tbaa !5
  %294 = getelementptr inbounds %struct.Vdbe, ptr %293, i32 0, i32 11
  %295 = load i32, ptr %294, align 4, !tbaa !25
  call void @sqlite3VdbeSetChanges(ptr noundef %292, i32 noundef %295)
  br label %298

296:                                              ; preds = %288
  %297 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sqlite3VdbeSetChanges(ptr noundef %297, i32 noundef 0)
  br label %298

298:                                              ; preds = %296, %291
  %299 = load ptr, ptr %3, align 8, !tbaa !5
  %300 = getelementptr inbounds %struct.Vdbe, ptr %299, i32 0, i32 11
  store i32 0, ptr %300, align 4, !tbaa !25
  br label %301

301:                                              ; preds = %298, %280
  %302 = load ptr, ptr %3, align 8, !tbaa !5
  call void @sqlite3VdbeLeave(ptr noundef %302)
  store i32 0, ptr %6, align 4
  br label %303

303:                                              ; preds = %301, %179, %161
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  %304 = load i32, ptr %6, align 4
  switch i32 %304, label %365 [
    i32 0, label %305
  ]

305:                                              ; preds = %303
  br label %306

306:                                              ; preds = %305, %32, %26
  %307 = load ptr, ptr %3, align 8, !tbaa !5
  %308 = getelementptr inbounds %struct.Vdbe, ptr %307, i32 0, i32 9
  %309 = load i32, ptr %308, align 4, !tbaa !22
  %310 = icmp sge i32 %309, 0
  br i1 %310, label %311, label %342

311:                                              ; preds = %306
  %312 = load ptr, ptr %5, align 8, !tbaa !5
  %313 = getelementptr inbounds %struct.sqlite3, ptr %312, i32 0, i32 34
  %314 = load i32, ptr %313, align 4, !tbaa !35
  %315 = add nsw i32 %314, -1
  store i32 %315, ptr %313, align 4, !tbaa !35
  %316 = load ptr, ptr %3, align 8, !tbaa !5
  %317 = getelementptr inbounds %struct.Vdbe, ptr %316, i32 0, i32 31
  %318 = load i16, ptr %317, align 8
  %319 = lshr i16 %318, 7
  %320 = and i16 %319, 1
  %321 = zext i16 %320 to i32
  %322 = icmp ne i32 %321, 0
  br i1 %322, label %328, label %323

323:                                              ; preds = %311
  %324 = load ptr, ptr %5, align 8, !tbaa !5
  %325 = getelementptr inbounds %struct.sqlite3, ptr %324, i32 0, i32 36
  %326 = load i32, ptr %325, align 4, !tbaa !28
  %327 = add nsw i32 %326, -1
  store i32 %327, ptr %325, align 4, !tbaa !28
  br label %328

328:                                              ; preds = %323, %311
  %329 = load ptr, ptr %3, align 8, !tbaa !5
  %330 = getelementptr inbounds %struct.Vdbe, ptr %329, i32 0, i32 31
  %331 = load i16, ptr %330, align 8
  %332 = lshr i16 %331, 8
  %333 = and i16 %332, 1
  %334 = zext i16 %333 to i32
  %335 = icmp ne i32 %334, 0
  br i1 %335, label %336, label %341

336:                                              ; preds = %328
  %337 = load ptr, ptr %5, align 8, !tbaa !5
  %338 = getelementptr inbounds %struct.sqlite3, ptr %337, i32 0, i32 35
  %339 = load i32, ptr %338, align 8, !tbaa !36
  %340 = add nsw i32 %339, -1
  store i32 %340, ptr %338, align 8, !tbaa !36
  br label %341

341:                                              ; preds = %336, %328
  br label %342

342:                                              ; preds = %341, %306
  %343 = load ptr, ptr %3, align 8, !tbaa !5
  %344 = getelementptr inbounds %struct.Vdbe, ptr %343, i32 0, i32 5
  store i32 832317811, ptr %344, align 4, !tbaa !14
  %345 = load ptr, ptr %5, align 8, !tbaa !5
  %346 = getelementptr inbounds %struct.sqlite3, ptr %345, i32 0, i32 17
  %347 = load i8, ptr %346, align 1, !tbaa !15
  %348 = icmp ne i8 %347, 0
  br i1 %348, label %349, label %352

349:                                              ; preds = %342
  %350 = load ptr, ptr %3, align 8, !tbaa !5
  %351 = getelementptr inbounds %struct.Vdbe, ptr %350, i32 0, i32 10
  store i32 7, ptr %351, align 8, !tbaa !21
  br label %352

352:                                              ; preds = %349, %342
  %353 = load ptr, ptr %5, align 8, !tbaa !5
  %354 = getelementptr inbounds %struct.sqlite3, ptr %353, i32 0, i32 15
  %355 = load i8, ptr %354, align 1, !tbaa !24
  %356 = icmp ne i8 %355, 0
  br i1 %356, label %357, label %358

357:                                              ; preds = %352
  br label %358

358:                                              ; preds = %357, %352
  %359 = load ptr, ptr %3, align 8, !tbaa !5
  %360 = getelementptr inbounds %struct.Vdbe, ptr %359, i32 0, i32 10
  %361 = load i32, ptr %360, align 8, !tbaa !21
  %362 = icmp eq i32 %361, 5
  %363 = zext i1 %362 to i64
  %364 = select i1 %362, i32 5, i32 0
  store i32 %364, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %365

365:                                              ; preds = %358, %303, %17
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  %366 = load i32, ptr %2, align 4
  ret i32 %366
}

; Function Attrs: nounwind uwtable
declare hidden void @closeAllCursors(ptr noundef) #2

declare void @sqlite3RollbackAll(ptr noundef, i32 noundef) #1

declare void @sqlite3CloseSavepoints(ptr noundef) #1

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

declare void @sqlite3CommitInternalChanges(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @sqlite3VdbeSetChanges(ptr noundef, i32 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #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 = !{!"Vdbe", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !12, i64 60, !12, i64 64, !13, i64 72, !13, i64 80, !13, i64 88, !13, 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, !13, i64 176, !12, i64 184, !11, i64 188, !7, i64 190, !7, i64 191, !12, i64 192, !12, i64 192, !12, i64 192, !12, i64 192, !12, i64 192, !12, i64 192, !12, i64 192, !12, i64 193, !12, i64 193, !12, i64 196, !12, i64 200, !7, i64 204, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !12, i64 256, !12, i64 260, !6, i64 264, !6, i64 272}
!11 = !{!"short", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = !{!10, !12, i64 36}
!15 = !{!16, !7, i64 85}
!16 = !{!"sqlite3", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !12, i64 40, !12, i64 44, !13, i64 48, !13, i64 56, !12, i64 64, !12, i64 68, !12, i64 72, !12, i64 76, !11, 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, !12, i64 96, !12, i64 100, !12, i64 104, !12, i64 108, !7, i64 112, !12, i64 160, !17, i64 164, !12, i64 172, !12, i64 176, !12, i64 180, !12, i64 184, !12, i64 188, !12, 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, !12, i64 432, !12, 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, !12, i64 632, !12, i64 636, !12, i64 640, !13, i64 648, !13, i64 656, !6, i64 664}
!17 = !{!"sqlite3InitInfo", !12, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7}
!18 = !{!"Lookaside", !12, i64 0, !11, i64 4, !7, i64 6, !12, i64 8, !12, i64 12, !7, i64 16, !6, i64 32, !6, i64 40, !6, i64 48}
!19 = !{!"Hash", !12, i64 0, !12, i64 4, !6, i64 8, !6, i64 16}
!20 = !{!"BusyHandler", !6, i64 0, !6, i64 8, !12, i64 16}
!21 = !{!10, !12, i64 56}
!22 = !{!10, !12, i64 52}
!23 = !{!12, !12, i64 0}
!24 = !{!16, !7, i64 83}
!25 = !{!10, !12, i64 60}
!26 = !{!16, !12, i64 436}
!27 = !{!16, !6, i64 472}
!28 = !{!16, !12, i64 180}
!29 = !{!10, !7, i64 190}
!30 = !{!16, !13, i64 648}
!31 = !{!16, !13, i64 656}
!32 = !{!16, !12, i64 44}
!33 = !{!16, !12, i64 640}
!34 = !{!10, !6, i64 144}
!35 = !{!16, !12, i64 172}
!36 = !{!16, !12, i64 176}


; 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"

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

; Function Attrs: nounwind uwtable
declare dso_local void @sqlite3VdbeEnter(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @sqlite3VdbeLeave(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @sqlite3VdbeCloseStatement(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @sqlite3VdbeCheckFk(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i32 @sqlite3VdbeHalt(ptr noundef %0) local_unnamed_addr #1 {
  %2 = load ptr, ptr %0, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 36
  %4 = load i32, ptr %3, align 4, !tbaa !13
  %.not = icmp eq i32 %4, 770837923
  br i1 %.not, label %5, label %.thread147

5:                                                ; preds = %1
  %6 = getelementptr inbounds i8, ptr %2, i64 85
  %7 = load i8, ptr %6, align 1, !tbaa !14
  %.not113 = icmp eq i8 %7, 0
  br i1 %.not113, label %10, label %8

8:                                                ; preds = %5
  %9 = getelementptr inbounds i8, ptr %0, i64 56
  store i32 7, ptr %9, align 8, !tbaa !20
  br label %10

10:                                               ; preds = %8, %5
  tail call void @closeAllCursors(ptr noundef nonnull %0)
  %11 = getelementptr inbounds i8, ptr %0, i64 52
  %12 = load i32, ptr %11, align 4, !tbaa !21
  %13 = icmp sgt i32 %12, -1
  br i1 %13, label %14, label %.thread151

14:                                               ; preds = %10
  %15 = getelementptr inbounds i8, ptr %0, i64 192
  %16 = load i16, ptr %15, align 8
  %17 = and i16 %16, 256
  %.not114 = icmp eq i16 %17, 0
  br i1 %.not114, label %.thread167, label %18

18:                                               ; preds = %14
  tail call void @sqlite3VdbeEnter(ptr noundef nonnull %0)
  %19 = getelementptr inbounds i8, ptr %0, i64 56
  %20 = load i32, ptr %19, align 8, !tbaa !20
  %trunc = trunc i32 %20 to i8
  switch i8 %trunc, label %switch.edge [
    i8 10, label %21
    i8 9, label %21
    i8 7, label %21
    i8 13, label %21
  ]

21:                                               ; preds = %18, %18, %18, %18
  %22 = and i32 %20, 255
  %23 = load i16, ptr %15, align 8
  %24 = and i16 %23, 128
  %25 = icmp eq i16 %24, 0
  %26 = icmp ne i32 %22, 9
  %or.cond5 = or i1 %26, %25
  br i1 %or.cond5, label %27, label %switch.edge.thread

27:                                               ; preds = %21
  switch i8 %trunc, label %30 [
    i8 13, label %28
    i8 7, label %28
  ]

28:                                               ; preds = %27, %27
  %29 = and i16 %23, 64
  %.not115 = icmp eq i16 %29, 0
  br i1 %.not115, label %30, label %switch.edge

30:                                               ; preds = %27, %28
  tail call void @sqlite3RollbackAll(ptr noundef nonnull %2, i32 noundef 516) #3
  tail call void @sqlite3CloseSavepoints(ptr noundef nonnull %2) #3
  %31 = getelementptr inbounds i8, ptr %2, i64 83
  store i8 1, ptr %31, align 1, !tbaa !22
  %32 = getelementptr inbounds i8, ptr %0, i64 60
  store i32 0, ptr %32, align 4, !tbaa !23
  %.pr.pre = load i32, ptr %19, align 8, !tbaa !20
  br label %switch.edge

switch.edge:                                      ; preds = %28, %30, %18
  %33 = phi i32 [ %20, %18 ], [ %20, %28 ], [ %.pr.pre, %30 ]
  %34 = phi i1 [ false, %18 ], [ true, %28 ], [ true, %30 ]
  %35 = phi i1 [ true, %18 ], [ false, %28 ], [ true, %30 ]
  %.0105 = phi i32 [ 0, %18 ], [ 2, %28 ], [ 0, %30 ]
  %36 = icmp eq i32 %33, 0
  br i1 %36, label %37, label %switch.edge.thread

37:                                               ; preds = %switch.edge
  %38 = tail call i32 @sqlite3VdbeCheckFk(ptr noundef nonnull %0, i32 noundef 0)
  br label %switch.edge.thread

switch.edge.thread:                               ; preds = %21, %37, %switch.edge
  %.0105159 = phi i32 [ %.0105, %37 ], [ %.0105, %switch.edge ], [ 0, %21 ]
  %39 = phi i1 [ %35, %37 ], [ %35, %switch.edge ], [ true, %21 ]
  %40 = phi i1 [ %34, %37 ], [ %34, %switch.edge ], [ true, %21 ]
  %41 = getelementptr inbounds i8, ptr %2, i64 436
  %42 = load i32, ptr %41, align 4, !tbaa !24
  %43 = icmp sgt i32 %42, 0
  br i1 %43, label %44, label %48

44:                                               ; preds = %switch.edge.thread
  %45 = getelementptr inbounds i8, ptr %2, i64 472
  %46 = load ptr, ptr %45, align 8, !tbaa !25
  %47 = icmp eq ptr %46, null
  br i1 %47, label %88, label %48

48:                                               ; preds = %44, %switch.edge.thread
  %49 = getelementptr inbounds i8, ptr %2, i64 83
  %50 = load i8, ptr %49, align 1, !tbaa !22
  %.not116 = icmp eq i8 %50, 0
  br i1 %.not116, label %88, label %51

51:                                               ; preds = %48
  %52 = getelementptr inbounds i8, ptr %2, i64 180
  %53 = load i32, ptr %52, align 4, !tbaa !26
  %54 = load i16, ptr %15, align 8
  %55 = and i16 %54, 128
  %56 = icmp eq i16 %55, 0
  %57 = zext i1 %56 to i32
  %58 = icmp eq i32 %53, %57
  br i1 %58, label %59, label %88

59:                                               ; preds = %51
  %60 = load i32, ptr %19, align 8, !tbaa !20
  %61 = icmp eq i32 %60, 0
  br i1 %61, label %66, label %62

62:                                               ; preds = %59
  %63 = getelementptr inbounds i8, ptr %0, i64 190
  %64 = load i8, ptr %63, align 2, !tbaa !27
  %65 = icmp ne i8 %64, 3
  %or.cond9 = or i1 %40, %65
  br i1 %or.cond9, label %84, label %66

66:                                               ; preds = %62, %59
  %67 = tail call i32 @sqlite3VdbeCheckFk(ptr noundef nonnull %0, i32 noundef 1)
  %.not117 = icmp eq i32 %67, 0
  br i1 %.not117, label %72, label %68

68:                                               ; preds = %66
  %69 = load i16, ptr %15, align 8
  %70 = and i16 %69, 128
  %.not118 = icmp eq i16 %70, 0
  br i1 %.not118, label %.thread, label %71

71:                                               ; preds = %68
  tail call void @sqlite3VdbeLeave(ptr noundef nonnull %0)
  br label %.thread147

72:                                               ; preds = %66
  %73 = tail call i32 @vdbeCommit(ptr noundef nonnull %2, ptr noundef nonnull %0)
  switch i32 %73, label %.thread [
    i32 5, label %74
    i32 0, label %79
  ]

74:                                               ; preds = %72
  %75 = load i16, ptr %15, align 8
  %76 = and i16 %75, 128
  %.not119 = icmp eq i16 %76, 0
  br i1 %.not119, label %.thread, label %77

77:                                               ; preds = %74
  tail call void @sqlite3VdbeLeave(ptr noundef nonnull %0)
  br label %.thread147

.thread:                                          ; preds = %68, %74, %72
  %.0107130 = phi i32 [ %73, %72 ], [ 5, %74 ], [ 787, %68 ]
  store i32 %.0107130, ptr %19, align 8, !tbaa !20
  tail call void @sqlite3RollbackAll(ptr noundef nonnull %2, i32 noundef 0) #3
  %78 = getelementptr inbounds i8, ptr %0, i64 60
  store i32 0, ptr %78, align 4, !tbaa !23
  br label %86

79:                                               ; preds = %72
  %80 = getelementptr inbounds i8, ptr %2, i64 648
  %81 = getelementptr inbounds i8, ptr %2, i64 44
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %80, i8 0, i64 16, i1 false)
  %82 = load i32, ptr %81, align 4, !tbaa !28
  %83 = and i32 %82, -33554433
  store i32 %83, ptr %81, align 4, !tbaa !28
  tail call void @sqlite3CommitInternalChanges(ptr noundef nonnull %2) #3
  br label %86

84:                                               ; preds = %62
  tail call void @sqlite3RollbackAll(ptr noundef nonnull %2, i32 noundef 0) #3
  %85 = getelementptr inbounds i8, ptr %0, i64 60
  store i32 0, ptr %85, align 4, !tbaa !23
  br label %86

86:                                               ; preds = %79, %.thread, %84
  %87 = getelementptr inbounds i8, ptr %2, i64 640
  store i32 0, ptr %87, align 8, !tbaa !29
  br label %96

88:                                               ; preds = %51, %48, %44
  br i1 %39, label %89, label %96

89:                                               ; preds = %88
  %90 = load i32, ptr %19, align 8, !tbaa !20
  %91 = icmp eq i32 %90, 0
  br i1 %91, label %.thread131, label %92

92:                                               ; preds = %89
  %93 = getelementptr inbounds i8, ptr %0, i64 190
  %94 = load i8, ptr %93, align 2, !tbaa !27
  switch i8 %94, label %.thread139 [
    i8 3, label %.thread131
    i8 2, label %95
  ]

95:                                               ; preds = %92
  br label %.thread131

96:                                               ; preds = %88, %86
  %.not121 = icmp eq i32 %.0105159, 0
  br i1 %.not121, label %.thread160, label %.thread131

.thread131:                                       ; preds = %89, %92, %95, %96
  %.1106134 = phi i32 [ %.0105159, %96 ], [ 1, %89 ], [ 1, %92 ], [ 2, %95 ]
  %97 = tail call i32 @sqlite3VdbeCloseStatement(ptr noundef nonnull %0, i32 noundef %.1106134)
  %.not122 = icmp eq i32 %97, 0
  br i1 %.not122, label %109, label %98

98:                                               ; preds = %.thread131
  %99 = load i32, ptr %19, align 8, !tbaa !20
  %100 = icmp eq i32 %99, 0
  %101 = and i32 %99, 255
  %102 = icmp eq i32 %101, 19
  %or.cond = or i1 %100, %102
  br i1 %or.cond, label %103, label %106

103:                                              ; preds = %98
  store i32 %97, ptr %19, align 8, !tbaa !20
  %104 = getelementptr inbounds i8, ptr %0, i64 144
  %105 = load ptr, ptr %104, align 8, !tbaa !30
  tail call void @sqlite3DbFree(ptr noundef nonnull %2, ptr noundef %105) #3
  store ptr null, ptr %104, align 8, !tbaa !30
  br label %106

106:                                              ; preds = %98, %103
  tail call void @sqlite3RollbackAll(ptr noundef nonnull %2, i32 noundef 516) #3
  tail call void @sqlite3CloseSavepoints(ptr noundef nonnull %2) #3
  %107 = getelementptr inbounds i8, ptr %2, i64 83
  store i8 1, ptr %107, align 1, !tbaa !22
  %108 = getelementptr inbounds i8, ptr %0, i64 60
  store i32 0, ptr %108, align 4, !tbaa !23
  br label %109

109:                                              ; preds = %.thread131, %106
  %110 = load i16, ptr %15, align 8
  %111 = and i16 %110, 16
  %.not123 = icmp eq i16 %111, 0
  br i1 %.not123, label %120, label %118

.thread160:                                       ; preds = %96
  %112 = load i16, ptr %15, align 8
  %113 = and i16 %112, 16
  %.not123162 = icmp eq i16 %113, 0
  br i1 %.not123162, label %120, label %..thread143_crit_edge

.thread139:                                       ; preds = %92
  tail call void @sqlite3RollbackAll(ptr noundef nonnull %2, i32 noundef 516) #3
  tail call void @sqlite3CloseSavepoints(ptr noundef nonnull %2) #3
  %114 = getelementptr inbounds i8, ptr %2, i64 83
  store i8 1, ptr %114, align 1, !tbaa !22
  %115 = getelementptr inbounds i8, ptr %0, i64 60
  store i32 0, ptr %115, align 4, !tbaa !23
  %116 = load i16, ptr %15, align 8
  %117 = and i16 %116, 16
  %.not123141 = icmp eq i16 %117, 0
  br i1 %.not123141, label %120, label %.thread143

118:                                              ; preds = %109
  %.not124 = icmp eq i32 %.1106134, 2
  br i1 %.not124, label %.thread143, label %..thread143_crit_edge

..thread143_crit_edge:                            ; preds = %.thread160, %118
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 60
  %.pre = load i32, ptr %.phi.trans.insert, align 4, !tbaa !23
  br label %.thread143

.thread143:                                       ; preds = %118, %.thread139, %..thread143_crit_edge
  %.sink = phi i32 [ %.pre, %..thread143_crit_edge ], [ 0, %.thread139 ], [ 0, %118 ]
  tail call void @sqlite3VdbeSetChanges(ptr noundef nonnull %2, i32 noundef %.sink)
  %119 = getelementptr inbounds i8, ptr %0, i64 60
  store i32 0, ptr %119, align 4, !tbaa !23
  br label %120

120:                                              ; preds = %.thread139, %.thread143, %109, %.thread160
  tail call void @sqlite3VdbeLeave(ptr noundef nonnull %0)
  %.pr150.pre = load i32, ptr %11, align 4, !tbaa !21
  %121 = icmp sgt i32 %.pr150.pre, -1
  br i1 %121, label %.thread167, label %.thread151

.thread167:                                       ; preds = %14, %120
  %122 = getelementptr inbounds i8, ptr %2, i64 172
  %123 = load i32, ptr %122, align 4, !tbaa !31
  %124 = add nsw i32 %123, -1
  store i32 %124, ptr %122, align 4, !tbaa !31
  %125 = load i16, ptr %15, align 8
  %126 = and i16 %125, 128
  %.not125 = icmp eq i16 %126, 0
  br i1 %.not125, label %127, label %131

127:                                              ; preds = %.thread167
  %128 = getelementptr inbounds i8, ptr %2, i64 180
  %129 = load i32, ptr %128, align 4, !tbaa !26
  %130 = add nsw i32 %129, -1
  store i32 %130, ptr %128, align 4, !tbaa !26
  %.pre155 = load i16, ptr %15, align 8
  br label %131

131:                                              ; preds = %127, %.thread167
  %132 = phi i16 [ %.pre155, %127 ], [ %125, %.thread167 ]
  %133 = and i16 %132, 256
  %.not126 = icmp eq i16 %133, 0
  br i1 %.not126, label %.thread151, label %134

134:                                              ; preds = %131
  %135 = getelementptr inbounds i8, ptr %2, i64 176
  %136 = load i32, ptr %135, align 8, !tbaa !32
  %137 = add nsw i32 %136, -1
  store i32 %137, ptr %135, align 8, !tbaa !32
  br label %.thread151

.thread151:                                       ; preds = %10, %131, %134, %120
  store i32 832317811, ptr %3, align 4, !tbaa !13
  %138 = load i8, ptr %6, align 1, !tbaa !14
  %.not127 = icmp eq i8 %138, 0
  %.phi.trans.insert156 = getelementptr inbounds i8, ptr %0, i64 56
  br i1 %.not127, label %.thread151._crit_edge, label %141

.thread151._crit_edge:                            ; preds = %.thread151
  %.pre157 = load i32, ptr %.phi.trans.insert156, align 8, !tbaa !20
  %139 = icmp eq i32 %.pre157, 5
  %140 = select i1 %139, i32 5, i32 0
  br label %.thread147

141:                                              ; preds = %.thread151
  store i32 7, ptr %.phi.trans.insert156, align 8, !tbaa !20
  br label %.thread147

.thread147:                                       ; preds = %141, %.thread151._crit_edge, %77, %71, %1
  %.1 = phi i32 [ 0, %1 ], [ 5, %77 ], [ 1, %71 ], [ %140, %.thread151._crit_edge ], [ 0, %141 ]
  ret i32 %.1
}

; Function Attrs: nounwind uwtable
declare hidden void @closeAllCursors(ptr noundef) local_unnamed_addr #1

declare void @sqlite3RollbackAll(ptr noundef, i32 noundef) local_unnamed_addr #0

declare void @sqlite3CloseSavepoints(ptr noundef) local_unnamed_addr #0

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

declare void @sqlite3CommitInternalChanges(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @sqlite3VdbeSetChanges(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

attributes #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 = { 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !7, i64 0}
!6 = !{!"Vdbe", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, 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, !12, i64 176, !11, i64 184, !10, i64 188, !8, i64 190, !8, i64 191, !11, i64 192, !11, i64 192, !11, i64 192, !11, i64 192, !11, i64 192, !11, i64 192, !11, i64 192, !11, i64 193, !11, i64 193, !11, i64 196, !11, i64 200, !8, i64 204, !7, i64 224, !7, i64 232, !7, i64 240, !7, i64 248, !11, i64 256, !11, i64 260, !7, i64 264, !7, i64 272}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"long long", !8, i64 0}
!13 = !{!6, !11, i64 36}
!14 = !{!15, !8, i64 85}
!15 = !{!"sqlite3", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !11, i64 40, !11, i64 44, !12, i64 48, !12, i64 56, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !10, 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, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !8, i64 112, !11, i64 160, !16, i64 164, !11, i64 172, !11, i64 176, !11, i64 180, !11, i64 184, !11, i64 188, !11, 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, !11, i64 432, !11, 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, !11, i64 632, !11, i64 636, !11, i64 640, !12, i64 648, !12, i64 656, !7, i64 664}
!16 = !{!"sqlite3InitInfo", !11, i64 0, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7}
!17 = !{!"Lookaside", !11, i64 0, !10, i64 4, !8, i64 6, !11, i64 8, !11, i64 12, !8, i64 16, !7, i64 32, !7, i64 40, !7, i64 48}
!18 = !{!"Hash", !11, i64 0, !11, i64 4, !7, i64 8, !7, i64 16}
!19 = !{!"BusyHandler", !7, i64 0, !7, i64 8, !11, i64 16}
!20 = !{!6, !11, i64 56}
!21 = !{!6, !11, i64 52}
!22 = !{!15, !8, i64 83}
!23 = !{!6, !11, i64 60}
!24 = !{!15, !11, i64 436}
!25 = !{!15, !7, i64 472}
!26 = !{!15, !11, i64 180}
!27 = !{!6, !8, i64 190}
!28 = !{!15, !11, i64 44}
!29 = !{!15, !11, i64 640}
!30 = !{!6, !7, i64 144}
!31 = !{!15, !11, i64 172}
!32 = !{!15, !11, i64 176}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,MemCpyOptPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass