; 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.ReusableSpace = type { ptr, i32, i32 }
%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.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, %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

declare ptr @sqlite3DbMallocRawNN(ptr noundef, i64 noundef) #1

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @sqlite3VdbeRewind(ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @sqlite3VdbeMakeReady(ptr noundef %0, ptr noundef %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %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
  %10 = alloca i32, align 4
  %11 = alloca %struct.ReusableSpace, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #4
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.Vdbe, ptr %12, i32 0, i32 0
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  store ptr %14, ptr %5, align 8, !tbaa !5
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.Parse, ptr %15, i32 0, i32 50
  %17 = load i16, ptr %16, align 8, !tbaa !14
  %18 = sext i16 %17 to i32
  store i32 %18, ptr %6, align 4, !tbaa !17
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.Parse, ptr %19, i32 0, i32 18
  %21 = load i32, ptr %20, align 8, !tbaa !18
  store i32 %21, ptr %7, align 4, !tbaa !17
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.Parse, ptr %22, i32 0, i32 17
  %24 = load i32, ptr %23, align 4, !tbaa !19
  store i32 %24, ptr %8, align 4, !tbaa !17
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.Parse, ptr %25, i32 0, i32 33
  %27 = load i32, ptr %26, align 8, !tbaa !20
  store i32 %27, ptr %9, align 4, !tbaa !17
  %28 = load i32, ptr %8, align 4, !tbaa !17
  %29 = load i32, ptr %7, align 4, !tbaa !17
  %30 = add nsw i32 %29, %28
  store i32 %30, ptr %7, align 4, !tbaa !17
  %31 = load i32, ptr %8, align 4, !tbaa !17
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %33, label %39

33:                                               ; preds = %2
  %34 = load i32, ptr %7, align 4, !tbaa !17
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %36, label %39

36:                                               ; preds = %33
  %37 = load i32, ptr %7, align 4, !tbaa !17
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %7, align 4, !tbaa !17
  br label %39

39:                                               ; preds = %36, %33, %2
  %40 = load ptr, ptr %3, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.Vdbe, ptr %40, i32 0, i32 27
  %42 = load i32, ptr %41, align 8, !tbaa !21
  %43 = sext i32 %42 to i64
  %44 = mul i64 24, %43
  %45 = add i64 %44, 7
  %46 = and i64 %45, -8
  %47 = trunc i64 %46 to i32
  store i32 %47, ptr %10, align 4, !tbaa !17
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.Vdbe, ptr %48, i32 0, i32 17
  %50 = load ptr, ptr %49, align 8, !tbaa !22
  %51 = load i32, ptr %10, align 4, !tbaa !17
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds i8, ptr %50, i64 %52
  %54 = getelementptr inbounds %struct.ReusableSpace, ptr %11, i32 0, i32 0
  store ptr %53, ptr %54, align 8, !tbaa !23
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.Parse, ptr %55, i32 0, i32 20
  %57 = load i32, ptr %56, align 8, !tbaa !25
  %58 = load i32, ptr %10, align 4, !tbaa !17
  %59 = sub nsw i32 %57, %58
  %60 = and i32 %59, -8
  %61 = getelementptr inbounds %struct.ReusableSpace, ptr %11, i32 0, i32 1
  store i32 %60, ptr %61, align 8, !tbaa !26
  %62 = load ptr, ptr %3, align 8, !tbaa !5
  call void @resolveP2Values(ptr noundef %62, ptr noundef %9)
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.Parse, ptr %63, i32 0, i32 8
  %65 = load i8, ptr %64, align 8, !tbaa !27
  %66 = zext i8 %65 to i32
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %68, label %74

68:                                               ; preds = %39
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.Parse, ptr %69, i32 0, i32 9
  %71 = load i8, ptr %70, align 1, !tbaa !28
  %72 = zext i8 %71 to i32
  %73 = icmp ne i32 %72, 0
  br label %74

74:                                               ; preds = %68, %39
  %75 = phi i1 [ false, %39 ], [ %73, %68 ]
  %76 = zext i1 %75 to i32
  %77 = trunc i32 %76 to i8
  %78 = zext i8 %77 to i32
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.Vdbe, ptr %79, i32 0, i32 31
  %81 = trunc i32 %78 to i16
  %82 = load i16, ptr %80, align 8
  %83 = and i16 %81, 1
  %84 = shl i16 %83, 6
  %85 = and i16 %82, -65
  %86 = or i16 %85, %84
  store i16 %86, ptr %80, align 8
  %87 = zext i16 %83 to i32
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.Parse, ptr %88, i32 0, i32 52
  %90 = load i8, ptr %89, align 1, !tbaa !29
  %91 = zext i8 %90 to i32
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %97

93:                                               ; preds = %74
  %94 = load i32, ptr %7, align 4, !tbaa !17
  %95 = icmp slt i32 %94, 10
  br i1 %95, label %96, label %97

96:                                               ; preds = %93
  store i32 10, ptr %7, align 4, !tbaa !17
  br label %97

97:                                               ; preds = %96, %93, %74
  %98 = load ptr, ptr %3, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.Vdbe, ptr %98, i32 0, i32 31
  %100 = load i16, ptr %99, align 8
  %101 = and i16 %100, -2
  %102 = or i16 %101, 0
  store i16 %102, ptr %99, align 8
  br label %103

103:                                              ; preds = %161, %97
  %104 = getelementptr inbounds %struct.ReusableSpace, ptr %11, i32 0, i32 2
  store i32 0, ptr %104, align 4, !tbaa !30
  %105 = load ptr, ptr %3, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.Vdbe, ptr %105, i32 0, i32 18
  %107 = load ptr, ptr %106, align 8, !tbaa !31
  %108 = load i32, ptr %7, align 4, !tbaa !17
  %109 = sext i32 %108 to i64
  %110 = mul i64 %109, 56
  %111 = trunc i64 %110 to i32
  %112 = call ptr @allocSpace(ptr noundef %11, ptr noundef %107, i32 noundef %111)
  %113 = load ptr, ptr %3, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.Vdbe, ptr %113, i32 0, i32 18
  store ptr %112, ptr %114, align 8, !tbaa !31
  %115 = load ptr, ptr %3, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.Vdbe, ptr %115, i32 0, i32 24
  %117 = load ptr, ptr %116, align 8, !tbaa !32
  %118 = load i32, ptr %6, align 4, !tbaa !17
  %119 = sext i32 %118 to i64
  %120 = mul i64 %119, 56
  %121 = trunc i64 %120 to i32
  %122 = call ptr @allocSpace(ptr noundef %11, ptr noundef %117, i32 noundef %121)
  %123 = load ptr, ptr %3, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.Vdbe, ptr %123, i32 0, i32 24
  store ptr %122, ptr %124, align 8, !tbaa !32
  %125 = load ptr, ptr %3, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.Vdbe, ptr %125, i32 0, i32 19
  %127 = load ptr, ptr %126, align 8, !tbaa !33
  %128 = load i32, ptr %9, align 4, !tbaa !17
  %129 = sext i32 %128 to i64
  %130 = mul i64 %129, 8
  %131 = trunc i64 %130 to i32
  %132 = call ptr @allocSpace(ptr noundef %11, ptr noundef %127, i32 noundef %131)
  %133 = load ptr, ptr %3, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.Vdbe, ptr %133, i32 0, i32 19
  store ptr %132, ptr %134, align 8, !tbaa !33
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.Vdbe, ptr %135, i32 0, i32 23
  %137 = load ptr, ptr %136, align 8, !tbaa !34
  %138 = load i32, ptr %8, align 4, !tbaa !17
  %139 = sext i32 %138 to i64
  %140 = mul i64 %139, 8
  %141 = trunc i64 %140 to i32
  %142 = call ptr @allocSpace(ptr noundef %11, ptr noundef %137, i32 noundef %141)
  %143 = load ptr, ptr %3, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.Vdbe, ptr %143, i32 0, i32 23
  store ptr %142, ptr %144, align 8, !tbaa !34
  %145 = getelementptr inbounds %struct.ReusableSpace, ptr %11, i32 0, i32 2
  %146 = load i32, ptr %145, align 4, !tbaa !30
  %147 = icmp eq i32 %146, 0
  br i1 %147, label %148, label %149

148:                                              ; preds = %103
  br label %167

149:                                              ; preds = %103
  %150 = load ptr, ptr %5, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.ReusableSpace, ptr %11, i32 0, i32 2
  %152 = load i32, ptr %151, align 4, !tbaa !30
  %153 = sext i32 %152 to i64
  %154 = call ptr @sqlite3DbMallocRawNN(ptr noundef %150, i64 noundef %153)
  %155 = load ptr, ptr %3, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.Vdbe, ptr %155, i32 0, i32 36
  store ptr %154, ptr %156, align 8, !tbaa !35
  %157 = getelementptr inbounds %struct.ReusableSpace, ptr %11, i32 0, i32 0
  store ptr %154, ptr %157, align 8, !tbaa !23
  %158 = getelementptr inbounds %struct.ReusableSpace, ptr %11, i32 0, i32 2
  %159 = load i32, ptr %158, align 4, !tbaa !30
  %160 = getelementptr inbounds %struct.ReusableSpace, ptr %11, i32 0, i32 1
  store i32 %159, ptr %160, align 8, !tbaa !26
  br label %161

161:                                              ; preds = %149
  %162 = load ptr, ptr %5, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.sqlite3, ptr %162, i32 0, i32 17
  %164 = load i8, ptr %163, align 1, !tbaa !36
  %165 = icmp ne i8 %164, 0
  %166 = xor i1 %165, true
  br i1 %166, label %103, label %167, !llvm.loop !42

167:                                              ; preds = %161, %148
  %168 = load ptr, ptr %4, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.Parse, ptr %168, i32 0, i32 58
  %170 = load ptr, ptr %169, align 8, !tbaa !44
  %171 = load ptr, ptr %3, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.Vdbe, ptr %171, i32 0, i32 25
  store ptr %170, ptr %172, align 8, !tbaa !45
  %173 = load ptr, ptr %4, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.Parse, ptr %173, i32 0, i32 58
  store ptr null, ptr %174, align 8, !tbaa !44
  %175 = load ptr, ptr %4, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.Parse, ptr %175, i32 0, i32 52
  %177 = load i8, ptr %176, align 1, !tbaa !29
  %178 = zext i8 %177 to i32
  %179 = load ptr, ptr %3, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.Vdbe, ptr %179, i32 0, i32 31
  %181 = trunc i32 %178 to i16
  %182 = load i16, ptr %180, align 8
  %183 = and i16 %181, 3
  %184 = shl i16 %183, 2
  %185 = and i16 %182, -13
  %186 = or i16 %185, %184
  store i16 %186, ptr %180, align 8
  %187 = zext i16 %183 to i32
  %188 = load ptr, ptr %5, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.sqlite3, ptr %188, i32 0, i32 17
  %190 = load i8, ptr %189, align 1, !tbaa !36
  %191 = icmp ne i8 %190, 0
  br i1 %191, label %192, label %199

192:                                              ; preds = %167
  %193 = load ptr, ptr %3, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.Vdbe, ptr %193, i32 0, i32 4
  store i16 0, ptr %194, align 8, !tbaa !46
  %195 = load ptr, ptr %3, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.Vdbe, ptr %195, i32 0, i32 7
  store i32 0, ptr %196, align 4, !tbaa !47
  %197 = load ptr, ptr %3, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.Vdbe, ptr %197, i32 0, i32 6
  store i32 0, ptr %198, align 8, !tbaa !48
  br label %226

199:                                              ; preds = %167
  %200 = load i32, ptr %8, align 4, !tbaa !17
  %201 = load ptr, ptr %3, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.Vdbe, ptr %201, i32 0, i32 7
  store i32 %200, ptr %202, align 4, !tbaa !47
  %203 = load i32, ptr %6, align 4, !tbaa !17
  %204 = trunc i32 %203 to i16
  %205 = load ptr, ptr %3, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.Vdbe, ptr %205, i32 0, i32 4
  store i16 %204, ptr %206, align 8, !tbaa !46
  %207 = load ptr, ptr %3, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.Vdbe, ptr %207, i32 0, i32 24
  %209 = load ptr, ptr %208, align 8, !tbaa !32
  %210 = load i32, ptr %6, align 4, !tbaa !17
  %211 = load ptr, ptr %5, align 8, !tbaa !5
  call void @initMemArray(ptr noundef %209, i32 noundef %210, ptr noundef %211, i16 noundef zeroext 1)
  %212 = load i32, ptr %7, align 4, !tbaa !17
  %213 = load ptr, ptr %3, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.Vdbe, ptr %213, i32 0, i32 6
  store i32 %212, ptr %214, align 8, !tbaa !48
  %215 = load ptr, ptr %3, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.Vdbe, ptr %215, i32 0, i32 18
  %217 = load ptr, ptr %216, align 8, !tbaa !31
  %218 = load i32, ptr %7, align 4, !tbaa !17
  %219 = load ptr, ptr %5, align 8, !tbaa !5
  call void @initMemArray(ptr noundef %217, i32 noundef %218, ptr noundef %219, i16 noundef zeroext 128)
  %220 = load ptr, ptr %3, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.Vdbe, ptr %220, i32 0, i32 23
  %222 = load ptr, ptr %221, align 8, !tbaa !34
  %223 = load i32, ptr %8, align 4, !tbaa !17
  %224 = sext i32 %223 to i64
  %225 = mul i64 %224, 8
  call void @llvm.memset.p0.i64(ptr align 8 %222, i8 0, i64 %225, i1 false)
  br label %226

226:                                              ; preds = %199, %192
  %227 = load ptr, ptr %3, align 8, !tbaa !5
  call void @sqlite3VdbeRewind(ptr noundef %227)
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret void
}

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

; Function Attrs: nounwind uwtable
declare hidden void @initMemArray(ptr noundef, i32 noundef, ptr noundef, i16 noundef zeroext) #3

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 #4 = { 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 = !{!15, !11, i64 464}
!15 = !{!"Parse", !6, i64 0, !6, i64 8, !6, i64 16, !12, 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, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !12, i64 60, !12, i64 64, !12, i64 68, !12, i64 72, !12, i64 76, !12, i64 80, !12, i64 84, !6, i64 88, !6, i64 96, !16, i64 104, !12, i64 120, !12, i64 124, !12, i64 128, !12, i64 132, !12, i64 136, !12, i64 140, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !12, i64 176, !12, i64 180, !12, i64 184, !12, i64 188, !7, i64 192, !7, i64 193, !7, i64 194, !7, i64 196, !7, i64 396, !16, i64 432, !16, i64 448, !11, i64 464, !7, i64 466, !7, i64 467, !7, i64 468, !12, i64 472, !12, i64 476, !12, i64 480, !12, i64 484, !6, i64 488, !6, i64 496, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !16, i64 536, !6, i64 552, !6, i64 560, !6, i64 568, !6, i64 576, !6, i64 584}
!16 = !{!"Token", !6, i64 0, !12, i64 8}
!17 = !{!12, !12, i64 0}
!18 = !{!15, !12, i64 56}
!19 = !{!15, !12, i64 52}
!20 = !{!15, !12, i64 136}
!21 = !{!10, !12, i64 184}
!22 = !{!10, !6, i64 104}
!23 = !{!24, !6, i64 0}
!24 = !{!"ReusableSpace", !6, i64 0, !12, i64 8, !12, i64 12}
!25 = !{!15, !12, i64 64}
!26 = !{!24, !12, i64 8}
!27 = !{!15, !7, i64 32}
!28 = !{!15, !7, i64 33}
!29 = !{!15, !7, i64 467}
!30 = !{!24, !12, i64 12}
!31 = !{!10, !6, i64 112}
!32 = !{!10, !6, i64 160}
!33 = !{!10, !6, i64 120}
!34 = !{!10, !6, i64 152}
!35 = !{!10, !6, i64 232}
!36 = !{!37, !7, i64 85}
!37 = !{!"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, !38, 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, !39, i64 344, !6, i64 400, !6, i64 408, !6, i64 416, !6, i64 424, !12, i64 432, !12, i64 436, !40, i64 440, !6, i64 464, !6, i64 472, !6, i64 480, !40, i64 488, !40, i64 512, !41, 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}
!38 = !{!"sqlite3InitInfo", !12, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7}
!39 = !{!"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}
!40 = !{!"Hash", !12, i64 0, !12, i64 4, !6, i64 8, !6, i64 16}
!41 = !{!"BusyHandler", !6, i64 0, !6, i64 8, !12, i64 16}
!42 = distinct !{!42, !43}
!43 = !{!"llvm.loop.mustprogress"}
!44 = !{!15, !6, i64 488}
!45 = !{!10, !6, i64 168}
!46 = !{!10, !11, i64 32}
!47 = !{!10, !12, i64 44}
!48 = !{!10, !12, i64 40}


; 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.ReusableSpace = type { ptr, i32, i32 }

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

declare ptr @sqlite3DbMallocRawNN(ptr noundef, i64 noundef) local_unnamed_addr #1

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @sqlite3VdbeMakeReady(ptr noundef %0, ptr nocapture noundef %1) local_unnamed_addr #3 {
  %3 = alloca i32, align 4
  %4 = alloca %struct.ReusableSpace, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  %5 = load ptr, ptr %0, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %1, i64 464
  %7 = load i16, ptr %6, align 8, !tbaa !13
  %8 = sext i16 %7 to i32
  %9 = getelementptr inbounds i8, ptr %1, i64 56
  %10 = load i32, ptr %9, align 8, !tbaa !16
  %11 = getelementptr inbounds i8, ptr %1, i64 52
  %12 = load i32, ptr %11, align 4, !tbaa !17
  %13 = getelementptr inbounds i8, ptr %1, i64 136
  %14 = load i32, ptr %13, align 8, !tbaa !18
  store i32 %14, ptr %3, align 4, !tbaa !19
  %15 = add nsw i32 %12, %10
  %16 = icmp eq i32 %12, 0
  %17 = icmp sgt i32 %15, 0
  %or.cond = select i1 %16, i1 %17, i1 false
  %18 = zext i1 %or.cond to i32
  %spec.select = add nuw nsw i32 %15, %18
  %19 = getelementptr inbounds i8, ptr %0, i64 184
  %20 = load i32, ptr %19, align 8, !tbaa !20
  %21 = mul i32 %20, 24
  %22 = getelementptr inbounds i8, ptr %0, i64 104
  %23 = load ptr, ptr %22, align 8, !tbaa !21
  %24 = sext i32 %21 to i64
  %25 = getelementptr inbounds i8, ptr %23, i64 %24
  store ptr %25, ptr %4, align 8, !tbaa !22
  %26 = getelementptr inbounds i8, ptr %1, i64 64
  %27 = load i32, ptr %26, align 8, !tbaa !24
  %28 = sub nsw i32 %27, %21
  %29 = and i32 %28, -8
  %30 = getelementptr inbounds i8, ptr %4, i64 8
  store i32 %29, ptr %30, align 8, !tbaa !25
  call void @resolveP2Values(ptr noundef nonnull %0, ptr noundef nonnull %3)
  %31 = getelementptr inbounds i8, ptr %1, i64 32
  %32 = load i8, ptr %31, align 8, !tbaa !26
  %.not = icmp eq i8 %32, 0
  br i1 %.not, label %37, label %33

33:                                               ; preds = %2
  %34 = getelementptr inbounds i8, ptr %1, i64 33
  %35 = load i8, ptr %34, align 1, !tbaa !27
  %.not64 = icmp eq i8 %35, 0
  %36 = select i1 %.not64, i16 0, i16 64
  br label %37

37:                                               ; preds = %33, %2
  %38 = phi i16 [ 0, %2 ], [ %36, %33 ]
  %39 = getelementptr inbounds i8, ptr %0, i64 192
  %40 = load i16, ptr %39, align 8
  %41 = and i16 %40, -65
  %42 = or disjoint i16 %41, %38
  store i16 %42, ptr %39, align 8
  %43 = getelementptr inbounds i8, ptr %1, i64 467
  %44 = load i8, ptr %43, align 1, !tbaa !28
  %.not65 = icmp eq i8 %44, 0
  %45 = call i32 @llvm.smax.i32(i32 %spec.select, i32 10)
  %spec.store.select = select i1 %.not65, i32 %spec.select, i32 %45
  %46 = and i16 %42, -2
  store i16 %46, ptr %39, align 8
  %47 = getelementptr inbounds i8, ptr %4, i64 12
  %48 = getelementptr inbounds i8, ptr %0, i64 112
  %49 = mul i32 %spec.store.select, 56
  %50 = getelementptr inbounds i8, ptr %0, i64 160
  %51 = mul nsw i32 %8, 56
  %52 = getelementptr inbounds i8, ptr %0, i64 120
  %53 = getelementptr inbounds i8, ptr %0, i64 152
  %54 = sext i32 %12 to i64
  %55 = shl nsw i64 %54, 3
  %56 = trunc i64 %55 to i32
  %57 = getelementptr inbounds i8, ptr %0, i64 232
  %58 = getelementptr inbounds i8, ptr %5, i64 85
  br label %59

59:                                               ; preds = %72, %37
  store i32 0, ptr %47, align 4, !tbaa !29
  %60 = load ptr, ptr %48, align 8, !tbaa !30
  %61 = call ptr @allocSpace(ptr noundef nonnull %4, ptr noundef %60, i32 noundef %49)
  store ptr %61, ptr %48, align 8, !tbaa !30
  %62 = load ptr, ptr %50, align 8, !tbaa !31
  %63 = call ptr @allocSpace(ptr noundef nonnull %4, ptr noundef %62, i32 noundef %51)
  store ptr %63, ptr %50, align 8, !tbaa !31
  %64 = load ptr, ptr %52, align 8, !tbaa !32
  %65 = load i32, ptr %3, align 4, !tbaa !19
  %66 = shl i32 %65, 3
  %67 = call ptr @allocSpace(ptr noundef nonnull %4, ptr noundef %64, i32 noundef %66)
  store ptr %67, ptr %52, align 8, !tbaa !32
  %68 = load ptr, ptr %53, align 8, !tbaa !33
  %69 = call ptr @allocSpace(ptr noundef nonnull %4, ptr noundef %68, i32 noundef %56)
  store ptr %69, ptr %53, align 8, !tbaa !33
  %70 = load i32, ptr %47, align 4, !tbaa !29
  %71 = icmp eq i32 %70, 0
  br i1 %71, label %77, label %72

72:                                               ; preds = %59
  %73 = sext i32 %70 to i64
  %74 = call ptr @sqlite3DbMallocRawNN(ptr noundef %5, i64 noundef %73) #5
  store ptr %74, ptr %57, align 8, !tbaa !34
  store ptr %74, ptr %4, align 8, !tbaa !22
  %75 = load i32, ptr %47, align 4, !tbaa !29
  store i32 %75, ptr %30, align 8, !tbaa !25
  %76 = load i8, ptr %58, align 1, !tbaa !35
  %.not66 = icmp eq i8 %76, 0
  br i1 %.not66, label %59, label %77, !llvm.loop !41

77:                                               ; preds = %59, %72
  %78 = getelementptr inbounds i8, ptr %1, i64 488
  %79 = load ptr, ptr %78, align 8, !tbaa !43
  %80 = getelementptr inbounds i8, ptr %0, i64 168
  store ptr %79, ptr %80, align 8, !tbaa !44
  store ptr null, ptr %78, align 8, !tbaa !43
  %81 = load i8, ptr %43, align 1, !tbaa !28
  %82 = load i16, ptr %39, align 8
  %83 = shl i8 %81, 2
  %84 = and i8 %83, 12
  %85 = zext nneg i8 %84 to i16
  %86 = and i16 %82, -13
  %87 = or disjoint i16 %86, %85
  store i16 %87, ptr %39, align 8
  %88 = load i8, ptr %58, align 1, !tbaa !35
  %.not67 = icmp eq i8 %88, 0
  br i1 %.not67, label %93, label %89

89:                                               ; preds = %77
  %90 = getelementptr inbounds i8, ptr %0, i64 32
  store i16 0, ptr %90, align 8, !tbaa !45
  %91 = getelementptr inbounds i8, ptr %0, i64 44
  store i32 0, ptr %91, align 4, !tbaa !46
  %92 = getelementptr inbounds i8, ptr %0, i64 40
  store i32 0, ptr %92, align 8, !tbaa !47
  br label %100

93:                                               ; preds = %77
  %94 = getelementptr inbounds i8, ptr %0, i64 44
  store i32 %12, ptr %94, align 4, !tbaa !46
  %95 = getelementptr inbounds i8, ptr %0, i64 32
  store i16 %7, ptr %95, align 8, !tbaa !45
  %96 = load ptr, ptr %50, align 8, !tbaa !31
  call void @initMemArray(ptr noundef %96, i32 noundef %8, ptr noundef nonnull %5, i16 noundef zeroext 1)
  %97 = getelementptr inbounds i8, ptr %0, i64 40
  store i32 %spec.store.select, ptr %97, align 8, !tbaa !47
  %98 = load ptr, ptr %48, align 8, !tbaa !30
  call void @initMemArray(ptr noundef %98, i32 noundef %spec.store.select, ptr noundef nonnull %5, i16 noundef zeroext 128)
  %99 = load ptr, ptr %53, align 8, !tbaa !33
  call void @llvm.memset.p0.i64(ptr align 8 %99, i8 0, i64 %55, i1 false)
  br label %100

100:                                              ; preds = %93, %89
  call void @sqlite3VdbeRewind(ptr noundef nonnull %0)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  ret void
}

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

; Function Attrs: nounwind uwtable
declare hidden void @initMemArray(ptr noundef, i32 noundef, ptr noundef, i16 noundef zeroext) local_unnamed_addr #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4

attributes #0 = { mustprogress 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 = !{!14, !10, i64 464}
!14 = !{!"Parse", !7, i64 0, !7, i64 8, !7, i64 16, !11, 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, !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, !7, i64 88, !7, i64 96, !15, i64 104, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !11, i64 176, !11, i64 180, !11, i64 184, !11, i64 188, !8, i64 192, !8, i64 193, !8, i64 194, !8, i64 196, !8, i64 396, !15, i64 432, !15, i64 448, !10, i64 464, !8, i64 466, !8, i64 467, !8, i64 468, !11, i64 472, !11, i64 476, !11, i64 480, !11, i64 484, !7, i64 488, !7, i64 496, !7, i64 504, !7, i64 512, !7, i64 520, !7, i64 528, !15, i64 536, !7, i64 552, !7, i64 560, !7, i64 568, !7, i64 576, !7, i64 584}
!15 = !{!"Token", !7, i64 0, !11, i64 8}
!16 = !{!14, !11, i64 56}
!17 = !{!14, !11, i64 52}
!18 = !{!14, !11, i64 136}
!19 = !{!11, !11, i64 0}
!20 = !{!6, !11, i64 184}
!21 = !{!6, !7, i64 104}
!22 = !{!23, !7, i64 0}
!23 = !{!"ReusableSpace", !7, i64 0, !11, i64 8, !11, i64 12}
!24 = !{!14, !11, i64 64}
!25 = !{!23, !11, i64 8}
!26 = !{!14, !8, i64 32}
!27 = !{!14, !8, i64 33}
!28 = !{!14, !8, i64 467}
!29 = !{!23, !11, i64 12}
!30 = !{!6, !7, i64 112}
!31 = !{!6, !7, i64 160}
!32 = !{!6, !7, i64 120}
!33 = !{!6, !7, i64 152}
!34 = !{!6, !7, i64 232}
!35 = !{!36, !8, i64 85}
!36 = !{!"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, !37, 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, !38, i64 344, !7, i64 400, !7, i64 408, !7, i64 416, !7, i64 424, !11, i64 432, !11, i64 436, !39, i64 440, !7, i64 464, !7, i64 472, !7, i64 480, !39, i64 488, !39, i64 512, !40, 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}
!37 = !{!"sqlite3InitInfo", !11, i64 0, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7}
!38 = !{!"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}
!39 = !{!"Hash", !11, i64 0, !11, i64 4, !7, i64 8, !7, i64 16}
!40 = !{!"BusyHandler", !7, i64 0, !7, i64 8, !11, i64 16}
!41 = distinct !{!41, !42}
!42 = !{!"llvm.loop.mustprogress"}
!43 = !{!14, !7, i64 488}
!44 = !{!6, !7, i64 168}
!45 = !{!6, !10, i64 32}
!46 = !{!6, !11, i64 44}
!47 = !{!6, !11, i64 40}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LICMPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass